X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=arch%2Fm68k%2Fcpu%2Fmcf532x%2Fstart.S;h=f25bc541be7cf6f1110b55d3c5d15669395ce15d;hb=a646f6698173ef4ff34c414f91541b4b8f014de1;hp=322b699465019156727d2c4abb6fa16d86e18bf6;hpb=1a4596601fd395f3afb8f82f3f840c5e00bdd57a;p=oweals%2Fu-boot.git diff --git a/arch/m68k/cpu/mcf532x/start.S b/arch/m68k/cpu/mcf532x/start.S index 322b699465..f25bc541be 100644 --- a/arch/m68k/cpu/mcf532x/start.S +++ b/arch/m68k/cpu/mcf532x/start.S @@ -5,7 +5,7 @@ * (C) Copyright 2004-2008 Freescale Semiconductor, Inc. * TsiChung Liew (Tsi-Chung.Liew@freescale.com) * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -148,15 +148,36 @@ _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 - bsr cpu_init_f /* run low-level CPU init code (from flash) */ - bsr board_init_f /* run low-level board init code (from flash) */ + /* + * if configured, malloc_f arena will be reserved first, + * then (and always) gd struct space will be reserved + */ + move.l %sp, -(%sp) + move.l #board_init_f_alloc_reserve, %a1 + jsr (%a1) + + /* update stack and frame-pointers */ + move.l %d0, %sp + move.l %sp, %fp + + /* initialize reserved area */ + move.l %d0, -(%sp) + move.l #board_init_f_init_reserve, %a1 + jsr (%a1) + + /* run low-level CPU init code (from flash) */ + move.l #cpu_init_f, %a1 + jsr (%a1) + /* run low-level board init code (from flash) */ + clr.l %sp@- + move.l #board_init_f, %a1 + jsr (%a1) /* board_init_f() does not return */