summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/radxa-rock3/lowlevel.c
diff options
context:
space:
mode:
authorMichael Riesch <michael.riesch@wolfvision.net>2022-05-31 18:26:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-08 15:50:15 +0200
commit439d2028a0e3f095e85d779892876efff5c7c9f1 (patch)
tree741b4b0510c8f85077cdc57f8a79e8a98633cdf9 /arch/arm/boards/radxa-rock3/lowlevel.c
parente54923b76e345080b73f3ae7f508657e5c63a9eb (diff)
downloadbarebox-439d2028a0e3f095e85d779892876efff5c7c9f1.tar.gz
barebox-439d2028a0e3f095e85d779892876efff5c7c9f1.tar.xz
arm: rockchip: add support for the radxa rock3 board
Add basic support for the Radxa ROCK3 Model A board (featuring the Rockchip RK3568 SoC). Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Link: https://lore.barebox.org/20220531162624.245664-4-michael.riesch@wolfvision.net Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/radxa-rock3/lowlevel.c')
-rw-r--r--arch/arm/boards/radxa-rock3/lowlevel.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/boards/radxa-rock3/lowlevel.c b/arch/arm/boards/radxa-rock3/lowlevel.c
new file mode 100644
index 0000000000..00a68889cd
--- /dev/null
+++ b/arch/arm/boards/radxa-rock3/lowlevel.c
@@ -0,0 +1,44 @@
+// 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_rk3568_rock_3a_start[];
+
+static noinline void rk3568_start(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();
+
+ /*
+ * Enable vccio4 1.8V and vccio6 1.8V
+ * Needed for GMAC to work.
+ */
+ writel(RK_SETBITS(0x50), 0xfdc20140);
+
+ 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_rock3a, r0, r1, r2)
+{
+ rk3568_start(__dtb_rk3568_rock_3a_start);
+}