arm: keep all sections in ELF file
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / mxs / start.S
index 3e454ae1bca419c7d3fd1f8517a687a22e1766dd..5de2bad5844018a334e596edbfe681e1eb5408b5 100644 (file)
@@ -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.