Commit 08a30a41 authored by David Brown's avatar David Brown Committed by Andrzej Puzdrowski
Browse files

zephyr: Add a bool Kconfig option for swap move



The Kconfig system used by Zephyr does not allow the defaults for choice
options to be overridden.  To compensate for this, create a new boolean
config option that will determine what the default is for the boot mode.

This allows the kconfig override file for various Zephyr boards to
change the default to swap move.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 6f286779
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -194,10 +194,21 @@ config BOOT_VALIDATE_SLOT0_ONCE
	  low end devices with as a compromise lowering the security level.
	  If unsure, leave at the default value.

config BOOT_PREFER_SWAP_MOVE
	bool "Prefer the newer swap move algorithm"
	default y if SOC_FAMILY_NRF
	default n
	help
	  If y, the BOOT_IMAGE_UPGRADE_MODE will default to using
	  "move" instead of "scratch".  This is a separate bool config
	  option, because Kconfig doesn't allow defaults to be
	  overridden in choice options.  Most devices should be using
	  swap move.

if !SINGLE_APPLICATION_SLOT
choice BOOT_IMAGE_UPGRADE_MODE
	prompt "Image upgrade modes"
	default BOOT_SWAP_USING_MOVE if SOC_FAMILY_NRF
	default BOOT_SWAP_USING_MOVE if BOOT_PREFER_SWAP_MOVE
	default BOOT_SWAP_USING_SCRATCH

config BOOT_SWAP_USING_SCRATCH