summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
diff options
context:
space:
mode:
authorFrank Wunderlich <frank-w@public-files.de>2022-02-11 10:13:54 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-02-11 11:40:27 +0100
commita7f0bcee97dd14ba522b02578ff08e8cafdca1df (patch)
tree076240c512b46a490ce8a98a711b32e1f78d7f0d /arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
parent149932efdf368adb4abb2594e3d33899315449a1 (diff)
downloadbarebox-a7f0bcee97dd14ba522b02578ff08e8cafdca1df.tar.gz
barebox-a7f0bcee97dd14ba522b02578ff08e8cafdca1df.tar.xz
ARM: Rockchip: Add rk3568 BananaPi R2 Pro board support
This adds support for the BananaPi R2 Pro board. It is basicly a copy of rk3568 evb board but with slightly modified DTS. Added GPIO-Leds to dts and modified the hw-detection a bit. Tested features so far are: - 1st stage booting - Network - SD card and Emmc - usb (1.1 and 3 work, usb2 not working) - power LED (green) Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Link: https://lore.barebox.org/20220211091354.11573-1-linux@fw-web.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c')
-rw-r--r--arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
new file mode 100644
index 0000000000..9f039c6048
--- /dev/null
+++ b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/lowlevel.c
@@ -0,0 +1,49 @@
+// 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_bpi_r2_pro_start[];
+
+static noinline void rk3568_start(void)
+{
+ void *fdt;
+
+ /*
+ * Enable vccio4 1.8V and vccio6 1.8V
+ * Needed for GMAC to work.
+ */
+ writel(RK_SETBITS(0x50), 0xfdc20140);
+
+ fdt = __dtb_rk3568_bpi_r2_pro_start;
+
+ 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_rk3568_bpi_r2pro, r0, r1, r2)
+{
+ /*
+ * 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();
+
+ rk3568_start();
+}