zephyr: add cleanup ARM core before boot
This patch is needed as MCUBoot should be able to chain-load any
application, not only these built using zephyr.
Introduced cleanup on ARM core control register.
Might be required as for instance the application assumes
that it starts with thread mode configured as by default, not
according to zephyr-rtos configuration.
MCUBoot disables interrupt before application chain-load used
basepr register. This Patch introduce additional celenup on
NVIC register.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig
index 70ef76d..252093a 100644
--- a/boot/zephyr/Kconfig
+++ b/boot/zephyr/Kconfig
@@ -120,6 +120,11 @@
with the public key information will be written in a format expected by
MCUboot.
+config MCUBOOT_CLEANUP_ARM_CORE
+ bool "Perform core cleanup before chain-load the application"
+ depends on CPU_CORTEX_M
+ default y
+
config MBEDTLS_CFG_FILE
default "mcuboot-mbedtls-cfg.h"