summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/board.c
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-01-08 10:18:02 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-01-08 22:14:50 +0100
commite05e5de7fae5bec79617e113916dac6631251156 (patch)
treec4d2bedca6e1ec79e30b229d2da6b979276456af /arch/arm/lib/board.c
parent7528cf5f016b5b8b8b12b373f6f31a10bf89233d (diff)
downloadblackbird-obmc-uboot-e05e5de7fae5bec79617e113916dac6631251156.tar.gz
blackbird-obmc-uboot-e05e5de7fae5bec79617e113916dac6631251156.zip
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 <albert.u.boot@aribaud.net>
Diffstat (limited to 'arch/arm/lib/board.c')
-rw-r--r--arch/arm/lib/board.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index e0cb6353a3..0459d0ce9f 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");
OpenPOWER on IntegriCloud