Commit 03a3a8aec85780f034c9c8fca4a12abfeb9b4da7

Authored by David Müller (ELSOFT AG)
Committed by Tom Rini
1 parent 7101c4ce8d

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>

Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff

... ... @@ -167,8 +167,12 @@
167 167 mov r0, r9 /* gd_t */
168 168 ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
169 169 /* call board_init_r */
  170 +#if defined(CONFIG_SYS_THUMB_BUILD)
  171 + ldr lr, =board_init_r /* this is auto-relocated! */
  172 + bx lr
  173 +#else
170 174 ldr pc, =board_init_r /* this is auto-relocated! */
171   -
  175 +#endif
172 176 /* we should not return here. */
173 177 #endif
174 178