From: Siarhei Siamashka Date: Mon, 5 Sep 2016 03:36:10 +0000 (+0300) Subject: ARM: Respect CONFIG_SPL_STACK define in lowlevel_init.S X-Git-Tag: v2016.11-rc2~57 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=22a402f00c9de841026105baa219a03d2273c01c;p=u-boot ARM: Respect CONFIG_SPL_STACK define in lowlevel_init.S The SPL and U-Boot proper may use different initial stack locations, which are configured via CONFIG_SPL_STACK and CONFIG_SYS_INIT_SP_ADDR defines. The lowlevel_init.S code needs to handle this in the same way as crt0.S Without this fix, setting the U-Boot stack location to some place, which is not safely accessible by the SPL (such as the DRAM), causes a very early SPL deadlock. Signed-off-by: Siarhei Siamashka Reviewed-by: Tom Rini Reviewed-by: Simon Glass --- diff --git a/arch/arm/cpu/armv7/lowlevel_init.S b/arch/arm/cpu/armv7/lowlevel_init.S index 1872c57699..658934d664 100644 --- a/arch/arm/cpu/armv7/lowlevel_init.S +++ b/arch/arm/cpu/armv7/lowlevel_init.S @@ -19,7 +19,11 @@ ENTRY(lowlevel_init) /* * Setup a temporary stack. Global data is not available yet. */ +#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK) + ldr sp, =CONFIG_SPL_STACK +#else ldr sp, =CONFIG_SYS_INIT_SP_ADDR +#endif bic sp, sp, #7 /* 8-byte alignment for ABI compliance */ #ifdef CONFIG_SPL_DM mov r9, #0