X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=arch%2Farm%2Fcpu%2Farm926ejs%2Fmxs%2Fstart.S;h=5de2bad5844018a334e596edbfe681e1eb5408b5;hb=47ed5dd031d7d2c587e6afd386e79ccec1a1b7f7;hp=3e454ae1bca419c7d3fd1f8517a687a22e1766dd;hpb=6297872cd5de4705b6318778261b1f3f64a34c11;p=oweals%2Fu-boot.git diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S index 3e454ae1bc..5de2bad584 100644 --- a/arch/arm/cpu/arm926ejs/mxs/start.S +++ b/arch/arm/cpu/arm926ejs/mxs/start.S @@ -149,6 +149,15 @@ IRQ_STACK_START_IN: */ _reset: + /* + * If the CPU is configured in "Wait JTAG connection mode", the stack + * pointer is not configured and is zero. This will cause crash when + * trying to push data onto stack right below here. Load the SP and make + * it point to the end of OCRAM if the SP is zero. + */ + cmp sp, #0x00000000 + ldreq sp, =CONFIG_SYS_INIT_SP_ADDR + /* * Store all registers on old stack pointer, this will allow us later to * return to the BootROM and let the BootROM load U-Boot into RAM.