summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-10 22:23:26 -0600
committerSimon Glass <sjg@chromium.org>2014-08-04 05:23:59 -0600
commitaae2aef9c807a13ec9074efe48fae5bb5e3c6039 (patch)
tree3b537768461423e5eccec8cc43aa5a47d423189b /arch/arm/lib
parent25b4adbba018633b943a99322bfb2fb819c0bafb (diff)
downloadblackbird-obmc-uboot-aae2aef9c807a13ec9074efe48fae5bb5e3c6039.tar.gz
blackbird-obmc-uboot-aae2aef9c807a13ec9074efe48fae5bb5e3c6039.zip
arm: Set up global data before board_init_f()
At present arm defines CONFIG_SYS_GENERIC_GLOBAL_DATA, meaning that the global_data pointer is set up in board_init_f(). However it is actually set up before this, it just isn't zeroed. If we zero the global data before calling board_init_f() then we don't need to define CONFIG_SYS_GENERIC_GLOBAL_DATA. Make this change (on arm32 only) to simplify the init process. I don't have the ability to test aarch64 yet. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/crt0.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index dfc2de9a61..43aa2123be 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -67,10 +67,19 @@ ENTRY(_main)
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, #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
+
+ /* mov r0, #0 not needed due to above code */
bl board_init_f
#if ! defined(CONFIG_SPL_BUILD)
OpenPOWER on IntegriCloud