diff options
author | David Hu <david.hu@arm.com> | 2019-06-14 13:10:40 +0800 |
---|---|---|
committer | Tamas Ban <tamas.ban@arm.com> | 2019-06-17 05:57:48 +0000 |
commit | 5cc9a3f33934e6b9236d5a11d695b61def909aaa (patch) | |
tree | 2fafbe60f2df32ed843bac2b5057ccf0f15c2124 | |
parent | 4e2051bfb95aa12aa9b0ccc276d46dd4cc91ed22 (diff) | |
download | trusted-firmware-m-5cc9a3f33934e6b9236d5a11d695b61def909aaa.tar.gz |
Boot: Skip MSPLIM setting when current architecture is not Armv8-M
Add directives around MSPLIM setting to execute MSPLIM setting
only on Armv8-M.
It can enable the booting on Armv6-M and Armv7-M.
Change-Id: I70c0546f3c1ec48ae80e7a5727c61a397846f43f
Signed-off-by: David Hu <david.hu@arm.com>
-rw-r--r-- | bl2/ext/mcuboot/bl2_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bl2/ext/mcuboot/bl2_main.c b/bl2/ext/mcuboot/bl2_main.c index a7bf3dc549..7a8a451b2a 100644 --- a/bl2/ext/mcuboot/bl2_main.c +++ b/bl2/ext/mcuboot/bl2_main.c @@ -35,12 +35,14 @@ __asm(" .global __ARM_use_no_argv\n"); #endif +#if defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8M_BASE__) /* Macros to pick linker symbols */ #define REGION(a, b, c) a##b##c #define REGION_NAME(a, b, c) REGION(a, b, c) #define REGION_DECLARE(a, b, c) extern uint32_t REGION_NAME(a, b, c) REGION_DECLARE(Image$$, ARM_LIB_STACK, $$ZI$$Base); +#endif /* Flash device name must be specified by target */ extern ARM_DRIVER_FLASH FLASH_DEV_NAME; @@ -93,11 +95,13 @@ static void do_boot(struct boot_rsp *rsp) stdio_uninit(); +#if defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8M_BASE__) /* Restore the Main Stack Pointer Limit register's reset value * before passing execution to runtime firmware to make the * bootloader transparent to it. */ __set_MSPLIM(0); +#endif __set_MSP(vt->msp); __DSB(); @@ -108,12 +112,16 @@ static void do_boot(struct boot_rsp *rsp) int main(void) { +#if defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8M_BASE__) uint32_t msp_stack_bottom = (uint32_t)®ION_NAME(Image$$, ARM_LIB_STACK, $$ZI$$Base); +#endif struct boot_rsp rsp; int rc; +#if defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8M_BASE__) __set_MSPLIM(msp_stack_bottom); +#endif stdio_init(); |