Skip to content

Commit 08a30a4

Browse files
d3zd3znvlsianpu
authored andcommitted
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: David Brown <[email protected]>
1 parent 6f28677 commit 08a30a4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

boot/zephyr/Kconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,21 @@ config BOOT_VALIDATE_SLOT0_ONCE
194194
low end devices with as a compromise lowering the security level.
195195
If unsure, leave at the default value.
196196

197+
config BOOT_PREFER_SWAP_MOVE
198+
bool "Prefer the newer swap move algorithm"
199+
default y if SOC_FAMILY_NRF
200+
default n
201+
help
202+
If y, the BOOT_IMAGE_UPGRADE_MODE will default to using
203+
"move" instead of "scratch". This is a separate bool config
204+
option, because Kconfig doesn't allow defaults to be
205+
overridden in choice options. Most devices should be using
206+
swap move.
207+
197208
if !SINGLE_APPLICATION_SLOT
198209
choice BOOT_IMAGE_UPGRADE_MODE
199210
prompt "Image upgrade modes"
200-
default BOOT_SWAP_USING_MOVE if SOC_FAMILY_NRF
211+
default BOOT_SWAP_USING_MOVE if BOOT_PREFER_SWAP_MOVE
201212
default BOOT_SWAP_USING_SCRATCH
202213

203214
config BOOT_SWAP_USING_SCRATCH

0 commit comments

Comments
 (0)