diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-02-20 13:47:19 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-02-23 11:15:43 +0100 |
commit | b07c1c88edd3753b8c10ef13b3c6daf78ab88b3f (patch) | |
tree | bcdbe9d409d51ea276c1040dd4e56461dbe4aff5 /arch/arm | |
parent | eff5c04efa94e581f45f9d5811f3184ddab6ba9c (diff) | |
download | barebox-b07c1c88edd3753b8c10ef13b3c6daf78ab88b3f.tar.gz barebox-b07c1c88edd3753b8c10ef13b3c6daf78ab88b3f.tar.xz |
ARM: stm32mp: build extra barebox-stm32mp-generic-bl33.img
barebox-dt-2nd.img expects being loaded at an offset, so the stack can
grow down from entry point. The STM32MP TF-A default is to not have an
offset. Avoid this issue by having a stm32mp specific entry point that
sets up a 64 byte stack after end of barebox. As it's stm32mp-specific
anyway, we can skip the early FDT parsing and ask the SDRAM controller
about RAM size.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220220124736.3052502-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-stm32mp/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-stm32mp/bl33-generic.c | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/Makefile b/arch/arm/mach-stm32mp/Makefile index 4163bd176b..86c13b8fca 100644 --- a/arch/arm/mach-stm32mp/Makefile +++ b/arch/arm/mach-stm32mp/Makefile @@ -2,4 +2,5 @@ obj-y := init.o obj-pbl-y := ddrctrl.o +pbl-y := bl33-generic.o obj-$(CONFIG_BOOTM) += stm32image.o diff --git a/arch/arm/mach-stm32mp/bl33-generic.c b/arch/arm/mach-stm32mp/bl33-generic.c new file mode 100644 index 0000000000..6f779b19cf --- /dev/null +++ b/arch/arm/mach-stm32mp/bl33-generic.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <mach/entry.h> +#include <debug_ll.h> + +/* + * barebox-dt-2nd.img expects being loaded at an offset, so the + * stack can grow down from entry point. The STM32MP TF-A default + * is to not have an offset. This stm32mp specific entry points + * avoids this issue by setting up a 64 byte stack after end of + * barebox and by asking the memory controller about RAM size + * instead of parsing it out of the DT. + * + * When using OP-TEE, ensure CONFIG_OPTEE_SIZE is appopriately set. + */ + +ENTRY_FUNCTION(start_stm32mp_bl33, r0, r1, r2) +{ + stm32mp_cpu_lowlevel_init(); + + putc_ll('>'); + + stm32mp1_barebox_entry((void *)r2); +} |