diff options
author | Patrice Chotard <patrice.chotard@st.com> | 2017-04-25 11:07:46 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-04-27 16:49:08 -0400 |
commit | dc89c6fb778ed2d12128e2bb976a45d540afce71 (patch) | |
tree | 6065f1f328cd1d66ce9beb6d94220d54f6025136 | |
parent | a93fbf4a78924741a1fc157fd182de79ea15f327 (diff) | |
download | u-boot-dc89c6fb778ed2d12128e2bb976a45d540afce71.tar.gz |
arm/lib/bootm.c: keep ARM v7M in thumb mode during boot_jump_linux()
On ARM v7M, the processor will return to ARM mode when executing
a blx instruction with bit 0 of the address == 0. Always set it
to 1 to stay in thumb mode.
Tested on STM32f746-disco board
Similar commit:
f99993c10882f7dc8ec35993d5febe59aac01e6a
Author: Matt Porter <mporter@konsulko.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
-rw-r--r-- | arch/arm/lib/bootm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 426bee6da5..4dbe6a5303 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -356,7 +356,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag) int fake = (flag & BOOTM_STATE_OS_FAKE_GO); kernel_entry = (void (*)(int, int, uint))images->ep; - +#ifdef CONFIG_CPU_V7M + ulong addr = (ulong)kernel_entry | 1; + kernel_entry = (void *)addr; +#endif s = getenv("machid"); if (s) { if (strict_strtoul(s, 16, &machid) < 0) { |