path: root/lib
diff options
authorAlbert ARIBAUD <>2013-01-08 10:18:02 +0000
committerAlbert ARIBAUD <>2013-01-08 22:14:50 +0100
commite05e5de7fae5bec79617e113916dac6631251156 (patch)
treec4d2bedca6e1ec79e30b229d2da6b979276456af /lib
parent7528cf5f016b5b8b8b12b373f6f31a10bf89233d (diff)
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 <>
Diffstat (limited to 'lib')
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/asm-offsets.c b/lib/asm-offsets.c
index c88f5d4451..8546a52f45 100644
--- a/lib/asm-offsets.c
+++ b/lib/asm-offsets.c
@@ -28,5 +28,19 @@ int main(void)
(sizeof(struct bd_info) + 15) & ~15);
+ DEFINE(GD_SIZE, sizeof(struct global_data));
+ DEFINE(GD_BD, offsetof(struct global_data, bd));
+#if defined(CONFIG_ARM)
+ DEFINE(GD_RELOCADDR, offsetof(struct global_data, relocaddr));
+ DEFINE(GD_RELOC_OFF, offsetof(struct global_data, reloc_off));
+ DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
return 0;
OpenPOWER on IntegriCloud