summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-12-15 08:25:19 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-12-15 08:25:19 +0100
commit3913a7c1833e31a47c2daae69275b730c58a72a3 (patch)
treec96010ed5af7e044bd025808f1f41e5e3c8a30df /arch
parenta2501c9e889abd22b47d42956d27b02607dbb0d8 (diff)
parent13a55ef0c39703884ac285b9c652d18a940429eb (diff)
downloadbarebox-3913a7c1833e31a47c2daae69275b730c58a72a3.tar.gz
barebox-3913a7c1833e31a47c2daae69275b730c58a72a3.tar.xz
Merge branch 'for-next/rockchip'
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/pine64-quartz64/Makefile3
-rw-r--r--arch/arm/boards/pine64-quartz64/board.c40
-rw-r--r--arch/arm/boards/pine64-quartz64/lowlevel.c39
-rw-r--r--arch/arm/configs/rockchip_v8_defconfig1
-rw-r--r--arch/arm/dts/Makefile1
-rw-r--r--arch/arm/dts/rk3566-quartz64-a.dts12
-rw-r--r--arch/arm/mach-rockchip/Kconfig6
-rw-r--r--arch/arm/mach-rockchip/rockchip.c2
9 files changed, 105 insertions, 0 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index d7460142bb..50b07462bb 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -184,3 +184,4 @@ obj-$(CONFIG_MACH_TQMLS1046A) += tqmls1046a/
obj-$(CONFIG_MACH_MNT_REFORM) += mnt-reform/
obj-$(CONFIG_MACH_SKOV_ARM9CPU) += skov-arm9cpu/
obj-$(CONFIG_MACH_RK3568_EVB) += rockchip-rk3568-evb/
+obj-$(CONFIG_MACH_PINE64_QUARTZ64) += pine64-quartz64/
diff --git a/arch/arm/boards/pine64-quartz64/Makefile b/arch/arm/boards/pine64-quartz64/Makefile
new file mode 100644
index 0000000000..b37b6c870b
--- /dev/null
+++ b/arch/arm/boards/pine64-quartz64/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/pine64-quartz64/board.c b/arch/arm/boards/pine64-quartz64/board.c
new file mode 100644
index 0000000000..981de90dd7
--- /dev/null
+++ b/arch/arm/boards/pine64-quartz64/board.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <common.h>
+#include <init.h>
+
+struct quartz64_model {
+ const char *name;
+ const char *shortname;
+};
+
+static int quartz64_probe(struct device_d *dev)
+{
+ const struct quartz64_model *model;
+
+ model = device_get_match_data(dev);
+
+ barebox_set_model(model->name);
+ barebox_set_hostname(model->shortname);
+
+ return 0;
+}
+
+static const struct quartz64_model quartz64a = {
+ .name = "Pine64 Quartz64 Model A",
+ .shortname = "quartz64a",
+};
+
+static const struct of_device_id quartz64_of_match[] = {
+ {
+ .compatible = "pine64,quartz64-a",
+ .data = &quartz64a,
+ },
+ { /* sentinel */ },
+};
+
+static struct driver_d quartz64_board_driver = {
+ .name = "board-quartz64",
+ .probe = quartz64_probe,
+ .of_compatible = quartz64_of_match,
+};
+coredevice_platform_driver(quartz64_board_driver);
diff --git a/arch/arm/boards/pine64-quartz64/lowlevel.c b/arch/arm/boards/pine64-quartz64/lowlevel.c
new file mode 100644
index 0000000000..b295885522
--- /dev/null
+++ b/arch/arm/boards/pine64-quartz64/lowlevel.c
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/hardware.h>
+#include <mach/atf.h>
+#include <debug_ll.h>
+#include <mach/rockchip.h>
+
+extern char __dtb_rk3566_quartz64_a_start[];
+
+static noinline void start_quartz64(void *fdt)
+{
+ /*
+ * Image execution starts at 0x0, but this is used for ATF and
+ * OP-TEE later, so move away from here.
+ */
+ if (current_el() == 3)
+ relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
+ else
+ relocate_to_current_adr();
+
+ setup_c();
+
+ if (current_el() == 3) {
+ rk3568_lowlevel_init();
+ rk3568_atf_load_bl31(fdt);
+ /* not reached */
+ }
+
+ barebox_arm_entry(RK3568_DRAM_BOTTOM, 0x80000000 - RK3568_DRAM_BOTTOM,
+ fdt);
+}
+
+ENTRY_FUNCTION(start_quartz64a, r0, r1, r2)
+{
+ start_quartz64(__dtb_rk3566_quartz64_a_start);
+}
diff --git a/arch/arm/configs/rockchip_v8_defconfig b/arch/arm/configs/rockchip_v8_defconfig
index 4e5393768c..4ceb036db6 100644
--- a/arch/arm/configs/rockchip_v8_defconfig
+++ b/arch/arm/configs/rockchip_v8_defconfig
@@ -1,5 +1,6 @@
CONFIG_ARCH_ROCKCHIP=y
CONFIG_MACH_RK3568_EVB=y
+CONFIG_MACH_PINE64_QUARTZ64=y
CONFIG_BOARD_ARM_GENERIC_DT=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_ARM_PSCI_CLIENT=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 552cca732f..76c96752cd 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -74,6 +74,7 @@ lwl-$(CONFIG_MACH_PHYTEC_SOM_IMX6) += imx6q-phytec-phycard.dtb.o \
imx6ull-phytec-phycore-som-emmc.dtb.o
lwl-$(CONFIG_MACH_PHYTEC_PHYCORE_IMX7) += imx7d-phyboard-zeta.dtb.o
lwl-$(CONFIG_MACH_PHYTEC_SOM_IMX8MQ) += imx8mq-phytec-phycore-som.dtb.o
+lwl-$(CONFIG_MACH_PINE64_QUARTZ64) += rk3566-quartz64-a.dtb.o
lwl-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_AX3) += armada-xp-openblocks-ax3-4-bb.dtb.o
lwl-$(CONFIG_MACH_PLATHOME_OPENBLOCKS_A6) += kirkwood-openblocks_a6-bb.dtb.o
lwl-$(CONFIG_MACH_PROTONIC_IMX6) += \
diff --git a/arch/arm/dts/rk3566-quartz64-a.dts b/arch/arm/dts/rk3566-quartz64-a.dts
new file mode 100644
index 0000000000..8639ca0886
--- /dev/null
+++ b/arch/arm/dts/rk3566-quartz64-a.dts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include <arm64/rockchip/rk3566-quartz64-a.dts>
+
+/ {
+ memory@a00000 {
+ device_type = "memory";
+ reg = <0x0 0x00a00000 0x0 0x7f600000>;
+ };
+};
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 1ad7ccedf6..5603fc12c3 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -50,6 +50,12 @@ config MACH_RK3568_EVB
help
Say Y here if you are using a RK3568 EVB
+config MACH_PINE64_QUARTZ64
+ select ARCH_RK3568
+ bool "Pine64 Quartz64"
+ help
+ Say Y here if you are using a Pine64 Quartz64
+
comment "select board features:"
config ARCH_RK3568_OPTEE
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index c185b0cc2b..698d23e3a5 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -9,6 +9,8 @@ static int rockchip_init(void)
return rk3188_init();
if (of_machine_is_compatible("rockchip,rk3288"))
return rk3288_init();
+ if (of_machine_is_compatible("rockchip,rk3566"))
+ return rk3568_init();
if (of_machine_is_compatible("rockchip,rk3568"))
return rk3568_init();