[U-Boot] [PATCH 05/10] arm: Adjust start-up code to use board_init_f_mem()
Simon Glass
sjg at chromium.org
Thu Apr 16 03:14:04 CEST 2015
We can use this C function to do the early memory layout and init.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
arch/arm/lib/crt0.S | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 92d3732..871e2b0 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -66,23 +66,11 @@ ENTRY(_main)
#else
ldr sp, =(CONFIG_SYS_INIT_SP_ADDR)
#endif
- bic sp, sp, #7 /* 8-byte alignment for ABI compliance */
- 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, sp
+ bl board_init_f_mem
+ mov sp, r0
+
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)
--
2.2.0.rc0.207.ga3a616c
More information about the U-Boot
mailing list