summaryrefslogtreecommitdiff
path: root/arch/m68k/cpu/mcf547x_8x/start.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/cpu/mcf547x_8x/start.S')
-rw-r--r--arch/m68k/cpu/mcf547x_8x/start.S25
1 files changed, 20 insertions, 5 deletions
diff --git a/arch/m68k/cpu/mcf547x_8x/start.S b/arch/m68k/cpu/mcf547x_8x/start.S
index 75de22d..9a87a0d 100644
--- a/arch/m68k/cpu/mcf547x_8x/start.S
+++ b/arch/m68k/cpu/mcf547x_8x/start.S
@@ -141,14 +141,29 @@ _start:
move.l %d0, (%a1)
move.l %d0, (%a2)
- /* set stackpointer to end of internal ram to get some stackspace for the
- first c-code */
- move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET), %sp
- clr.l %sp@-
+ /* put relocation table address to a5 */
+ move.l #__got_start, %a5
- move.l #__got_start, %a5 /* put relocation table address to a5 */
+ /* setup stack initially on top of internal static ram */
+ move.l #(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE), %sp
+
+ /*
+ * if configured, malloc_f arena will be reserved first,
+ * then (and always) gd struct space will be reserved
+ */
+ move.l %sp, -(%sp)
+ bsr board_init_f_alloc_reserve
+
+ /* update stack and frame-pointers */
+ move.l %d0, %sp
+ move.l %sp, %fp
+
+ /* initialize reserved area */
+ move.l %d0, -(%sp)
+ bsr board_init_f_init_reserve
jbsr cpu_init_f /* run low-level CPU init code (from flash) */
+ clr.l %sp@-
jbsr board_init_f /* run low-level board init code (from flash) */
/* board_init_f() does not return */