summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorDavid Müller (ELSOFT AG) <d.mueller@elsoft.ch>2016-02-09 16:48:28 +0100
committerTom Rini <trini@konsulko.com>2016-02-15 12:04:45 -0500
commit03a3a8aec85780f034c9c8fca4a12abfeb9b4da7 (patch)
treee630b066143b3ec55ec68b0bc68f8100867aee62 /arch/arm/lib
parent7101c4ce8d063fba676cc3fc3900b0d1734e6cae (diff)
arm: make sure board_init_r() is being called using the right mode (ARM / THUMB)
Signed-off-by: David Müller <d.mueller@elsoft.ch>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/crt0.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 2f4c14e96b..8415f77e1b 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -167,8 +167,12 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */
mov r0, r9 /* gd_t */
ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
/* call board_init_r */
+#if defined(CONFIG_SYS_THUMB_BUILD)
+ ldr lr, =board_init_r /* this is auto-relocated! */
+ bx lr
+#else
ldr pc, =board_init_r /* this is auto-relocated! */
-
+#endif
/* we should not return here. */
#endif