summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/pine64-quartz64/lowlevel.c
diff options
context:
space:
mode:
authorMichael Riesch <michael.riesch@wolfvision.net>2021-11-10 11:45:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-11-17 08:45:59 +0100
commit8d14f8e898b4cd4d9ff76b6afcbaf25bf37aa1e7 (patch)
tree3105ddec3b876d92b97b59157598581fe581cd63 /arch/arm/boards/pine64-quartz64/lowlevel.c
parent3f2f5980d517b6a71ffe54e615bd3a4b58b1c295 (diff)
downloadbarebox-8d14f8e898b4cd4d9ff76b6afcbaf25bf37aa1e7.tar.gz
barebox-8d14f8e898b4cd4d9ff76b6afcbaf25bf37aa1e7.tar.xz
arm: rockchip: add support for the quartz64 board
The Pine64 Quartz64 board features the Rockchip RK3566, a reduced but largely identical version of the RK3568. Two models (A and B) of the Quartz64 board are envisaged, where this patch targets the already available model A. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/pine64-quartz64/lowlevel.c')
-rw-r--r--arch/arm/boards/pine64-quartz64/lowlevel.c39
1 files changed, 39 insertions, 0 deletions
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);
+}