diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-19 08:59:13 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-19 08:59:13 +0200 |
commit | d5a06d4800305af6740cde3894d8f4b65b26b392 (patch) | |
tree | 2e70629b56a411184faf62496410f87f48b47642 /arch/arm/mach-rockchip/atf.c | |
parent | 8dd99807baf0b15b74e68e4e66d93bb0fe597621 (diff) | |
parent | 7bf493b1a646e1ee2e88cc7d41b462a6714eafee (diff) | |
download | barebox-d5a06d4800305af6740cde3894d8f4b65b26b392.tar.gz |
Merge branch 'for-next/rockchip'
Diffstat (limited to 'arch/arm/mach-rockchip/atf.c')
-rw-r--r-- | arch/arm/mach-rockchip/atf.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c index 93025faf68..d1431cc526 100644 --- a/arch/arm/mach-rockchip/atf.c +++ b/arch/arm/mach-rockchip/atf.c @@ -5,6 +5,11 @@ #include <mach/rockchip/atf.h> #include <elf.h> #include <asm/atf_common.h> +#include <asm/barebox-arm.h> +#include <mach/rockchip/dmc.h> +#include <mach/rockchip/rockchip.h> +#include <mach/rockchip/bootrom.h> +#include <mach/rockchip/rk3568-regs.h> static unsigned long load_elf64_image_phdr(const void *elf) { @@ -69,3 +74,32 @@ void rk3568_atf_load_bl31(void *fdt) { rockchip_atf_load_bl31(RK3568, rk3568_bl31_bin, rk3568_op_tee_bin, fdt); } + +void __noreturn rk3568_barebox_entry(void *fdt) +{ + unsigned long membase, memsize; + + membase = RK3568_DRAM_BOTTOM; + memsize = rk3568_ram0_size() - RK3568_DRAM_BOTTOM; + + if (current_el() == 3) { + rk3568_lowlevel_init(); + rockchip_store_bootrom_iram(membase, memsize, IOMEM(RK3568_IRAM_BASE)); + + /* + * The downstream TF-A doesn't cope with our device tree when + * CONFIG_OF_OVERLAY_LIVE is enabled, supposedly because it is + * too big for some reason. Otherwise it doesn't have any visible + * effect if we pass a device tree or not, except that the TF-A + * fills in the ethernet MAC address into the device tree. + * The upstream TF-A doesn't use the device tree at all. + * + * Pass NULL for now until we have a good reason to pass a real + * device tree. + */ + rk3568_atf_load_bl31(NULL); + /* not reached when CONFIG_ARCH_ROCKCHIP_ATF */ + } + + barebox_arm_entry(membase, memsize, fdt); +} |