]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/lib/crt0_64.S
Merge branch 'master' of git://git.denx.de/u-boot-imx
[u-boot] / arch / arm / lib / crt0_64.S
index 19c6a985cdf43f228e71a54a316f0d2ffd8915e1..57e728f9f2a36be2781442b4a9f4da3204fad1c1 100644 (file)
@@ -109,8 +109,18 @@ relocation_return:
  */
        bl      c_runtime_cpu_setup             /* still call old routine */
 #endif /* !CONFIG_SPL_BUILD */
-
-/* TODO: For SPL, call spl_relocate_stack_gd() to alloc stack relocation */
+#if defined(CONFIG_SPL_BUILD)
+       bl      spl_relocate_stack_gd           /* may return NULL */
+       /*
+        * Perform 'sp = (x0 != NULL) ? x0 : sp' while working
+        * around the constraint that conditional moves can not
+        * have 'sp' as an operand
+        */
+       mov     x1, sp
+       cmp     x0, #0
+       csel    x0, x0, x1, ne
+       mov     sp, x0
+#endif
 
 /*
  * Clear BSS section