]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/arm/lib/crt0.S
karo: merge with Ka-Ro specific tree for secure boot support
[karo-tx-uboot.git] / arch / arm / lib / crt0.S
index ac54b9359aea3b4954004e1b7805445ff0508b41..8a774512b6d8a9429a8b60b53fd3911fc3811bb0 100644 (file)
@@ -62,15 +62,27 @@ ENTRY(_main)
  */
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_STACK)
-       ldr     sp, =(CONFIG_SPL_STACK)
+       ldr     sp, =CONFIG_SPL_STACK
 #else
-       ldr     sp, =(CONFIG_SYS_INIT_SP_ADDR)
+       ldr     sp, =CONFIG_SYS_INIT_SP_ADDR
 #endif
        bic     sp, sp, #7      /* 8-byte alignment for ABI compliance */
-       sub     sp, #GD_SIZE    /* allocate one GD above SP */
+       mov     r2, sp
+       sub     sp, sp, #GD_SIZE        /* allocate one GD above SP */
        bic     sp, sp, #7      /* 8-byte alignment for ABI compliance */
        mov     r9, sp          /* GD is above SP */
+       mov     r1, sp
        mov     r0, #0
+clr_gd:
+       cmp     r1, r2                  /* while not at end of GD */
+       strlo   r0, [r1]                /* clear 32-bit GD word */
+       addlo   r1, r1, #4              /* move to next */
+       blo     clr_gd
+#if defined(CONFIG_SYS_MALLOC_F_LEN)
+       sub     sp, sp, #CONFIG_SYS_MALLOC_F_LEN
+       str     sp, [r9, #GD_MALLOC_BASE]
+#endif
+       /* mov r0, #0 not needed due to above code */
        bl      board_init_f
 
 #if ! defined(CONFIG_SPL_BUILD)
@@ -92,6 +104,11 @@ ENTRY(_main)
        ldr     r0, [r9, #GD_RELOCADDR]         /* r0 = gd->relocaddr */
        b       relocate_code
 here:
+/*
+ * now relocate vectors
+ */
+
+       bl      relocate_vectors
 
 /* Set up final (full) environment */