Commit 5a6e1814 authored by David Vincze's avatar David Vincze Committed by Dávid Vincze
Browse files

zephyr: Add direct-xip mode to Zephyr configuration



Add direct-xip mode to Zephyr configuration and make
upgrade mode selection always explicit.

Change-Id: Ia8e788f0b7bc801b6d45fd86f56c17ca6839f9c9
Co-authored-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: default avatarDavid Vincze <david.vincze@linaro.org>
parent e574f2d6
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -164,9 +164,19 @@ config BOOT_VALIDATE_SLOT0
	  able to modify the flash image itself.

if !SINGLE_IMAGE_DFU
choice
	prompt "Image upgrade modes"
	default BOOT_SWAP_USING_MOVE if SOC_FAMILY_NRF
	default BOOT_SWAP_USING_SCRATCH

config BOOT_SWAP_USING_SCRATCH
	bool "Swap mode that run with the scratch partition"
	help
	  This is the most conservative swap mode but it can work even on
	  devices with heterogeneous flash page layout.

config BOOT_UPGRADE_ONLY
	bool "Overwrite image updates instead of swapping"
	default n
	help
	  If y, overwrite the primary slot with the upgrade image instead
	  of swapping them. This prevents the fallback recovery, but
@@ -174,8 +184,6 @@ config BOOT_UPGRADE_ONLY

config BOOT_SWAP_USING_MOVE
	bool "Swap mode that can run without a scratch partition"
	default y if SOC_FAMILY_NRF
	default n
	help
	  If y, the swap upgrade is done in two steps, where first every
	  sector of the primary slot is moved up one sector, then for
@@ -185,6 +193,17 @@ config BOOT_SWAP_USING_MOVE
	  This allows a swap upgrade without using a scratch partition,
	  but is currently limited to all sectors in both slots being of
	  the same size.

config BOOT_DIRECT_XIP
	bool "Run the latest image directly from its slot"
	help
	  If y, mcuboot selects the newest valid image based on the image version
	  numbers, thereafter the selected image can run directly from its slot
	  without having to move/copy it into the primary slot. For this reason the
	  images must be linked to be executed from the given image slot. Using this
	  mode results in a simpler code path and smaller code size.

endchoice
endif

if !SINGLE_IMAGE_DFU
+4 −0
Original line number Diff line number Diff line
@@ -66,6 +66,10 @@
#define MCUBOOT_SWAP_USING_MOVE 1
#endif

#ifdef CONFIG_BOOT_DIRECT_XIP
#define MCUBOOT_DIRECT_XIP
#endif

#ifdef CONFIG_UPDATEABLE_IMAGE_NUMBER
#define MCUBOOT_IMAGE_NUMBER    CONFIG_UPDATEABLE_IMAGE_NUMBER
#else