From e05e5de7fae5bec79617e113916dac6631251156 Mon Sep 17 00:00:00 2001 From: Albert ARIBAUD Date: Tue, 8 Jan 2013 10:18:02 +0000 Subject: arm: move C runtime setup code in crt0.S Move all the C runtime setup code from every start.S in arch/arm into arch/arm/lib/crt0.S. This covers the code sequence from setting up the initial stack to calling into board_init_r(). Also, rewrite the C runtime setup and make functions board_init_*() and relocate_code() behave according to normal C semantics (no jumping across the C stack any more, etc). Some SPL targets had to be touched because they use start.S explicitly or for some reason; the relevant maintainers and custodians are cc:ed. Signed-off-by: Albert ARIBAUD --- arch/arm/lib/board.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'arch/arm/lib/board.c') diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index e0cb635..0459d0c 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -279,11 +279,6 @@ void board_init_f(ulong bootflag) bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); - /* Pointer is writable since we allocated a register for it */ - gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07); - /* compiler optimization barrier needed for GCC >= 3.4 */ - __asm__ __volatile__("": : :"memory"); - memset((void *)gd, 0, sizeof(gd_t)); gd->mon_len = _bss_end_ofs; @@ -465,10 +460,6 @@ void board_init_f(ulong bootflag) gd->fdt_blob = new_fdt; } memcpy(id, (void *)gd, sizeof(gd_t)); - - relocate_code(addr_sp, id, addr); - - /* NOTREACHED - relocate_code() does not return */ } #if !defined(CONFIG_SYS_NO_FLASH) @@ -493,8 +484,6 @@ void board_init_r(gd_t *id, ulong dest_addr) ulong flash_size; #endif - gd = id; - gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */ bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); -- cgit v1.1