summaryrefslogtreecommitdiff
path: root/arch/arm/lib/crt0.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/lib/crt0.S')
-rw-r--r--arch/arm/lib/crt0.S23
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 22df3e5..92d3732 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -113,20 +113,36 @@ here:
/* Set up final (full) environment */
bl c_runtime_cpu_setup /* we still call old routine here */
-
+#endif
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_FRAMEWORK)
+# ifdef CONFIG_SPL_BUILD
+ /* Use a DRAM stack for the rest of SPL, if requested */
+ bl spl_relocate_stack_gd
+ cmp r0, #0
+ movne sp, r0
+# endif
ldr r0, =__bss_start /* this is auto-relocated! */
- ldr r1, =__bss_end /* this is auto-relocated! */
+#ifdef CONFIG_USE_ARCH_MEMSET
+ ldr r3, =__bss_end /* this is auto-relocated! */
+ mov r1, #0x00000000 /* prepare zero to clear BSS */
+
+ subs r2, r3, r0 /* r2 = memset len */
+ bl memset
+#else
+ ldr r1, =__bss_end /* this is auto-relocated! */
mov r2, #0x00000000 /* prepare zero to clear BSS */
clbss_l:cmp r0, r1 /* while not at end of BSS */
strlo r2, [r0] /* clear 32-bit BSS word */
addlo r0, r0, #4 /* move to next */
blo clbss_l
+#endif
+#if ! defined(CONFIG_SPL_BUILD)
bl coloured_LED_init
bl red_led_on
-
+#endif
/* call board_init_r(gd_t *id, ulong dest_addr) */
mov r0, r9 /* gd_t */
ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
@@ -134,7 +150,6 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */
ldr pc, =board_init_r /* this is auto-relocated! */
/* we should not return here. */
-
#endif
ENDPROC(_main)