summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-11-12 10:19:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-13 15:20:40 +0100
commita0319d2beef4789c743132fae313718f6e6a4b20 (patch)
treea55fb498726cc0195b59b3505a8e4c9a2e22a074
parent2905fb431af7962c8fe7107326c051df7f4503f3 (diff)
downloadbarebox-a0319d2beef4789c743132fae313718f6e6a4b20.tar.gz
barebox-a0319d2beef4789c743132fae313718f6e6a4b20.tar.xz
ARM: stm32mp: add stm32mp_cpu_lowlevel_init with stack set up
When barebox is invoked out of the TF-A v2.1, it's started with sp, r0, r1, r2 all equal to zero. To use the new RAM size calculating stm32mp1_barebox_entry, we need to have a stack to handle spillage. Add a stm32mp_cpu_lowlevel_init wrapper around arm_cpu_lowlevel_init, which additionally configures a 64 byte stack after the end of the barebox binary. This should be enough to help us through the RAM size calculation. If not, compression will fail because of data corruption and stack size can be increased as necessary. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-stm32mp/include/mach/entry.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arm/mach-stm32mp/include/mach/entry.h b/arch/arm/mach-stm32mp/include/mach/entry.h
index 703712a9ee..92e15b5cf4 100644
--- a/arch/arm/mach-stm32mp/include/mach/entry.h
+++ b/arch/arm/mach-stm32mp/include/mach/entry.h
@@ -1,7 +1,18 @@
#ifndef _STM32MP_MACH_ENTRY_H_
#define _STM32MP_MACH_ENTRY_H_
-#include <linux/compiler.h>
+#include <linux/kernel.h>
+#include <asm/barebox-arm.h>
+
+static __always_inline void stm32mp_cpu_lowlevel_init(void)
+{
+ unsigned long stack_top;
+ arm_cpu_lowlevel_init();
+
+ stack_top = (unsigned long)__image_end + get_runtime_offset() + 64;
+ stack_top = ALIGN(stack_top, 16);
+ arm_setup_stack(stack_top);
+}
void __noreturn stm32mp1_barebox_entry(void *boarddata);