Skip to content

Commit 6d35cc5

Browse files
nordicjmkartben
authored andcommitted
kconfig: Add new Kconfig for MCUboot swap using move
Adds a new Kconfig for selecting swap using move in MCUboot which aligns with the proper MCUboot symbol and allows for adding additional mode Kconfigs Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
1 parent 38f98f0 commit 6d35cc5

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

modules/Kconfig.mcuboot

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ menu "On board MCUboot operation mode"
134134

135135
choice MCUBOOT_BOOTLOADER_MODE
136136
prompt "Application assumed MCUboot mode of operation"
137-
default MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH # MCUBOOT_BOOTLOADER_MODE
137+
default MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE
138138
help
139139
Informs application build on assumed MCUboot mode of operation.
140140
This is important for validataing application against DT configuration,
@@ -149,15 +149,22 @@ config MCUBOOT_BOOTLOADER_MODE_SINGLE_APP
149149
to DFU its own update to secondary slot and all updates need to
150150
be performed using MCUboot serial recovery.
151151

152-
config MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH
153-
bool "MCUboot has been configured for swap without scratch operation"
152+
config MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE
153+
bool "MCUboot has been configured for swap using move operation"
154154
select MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE
155155
help
156156
MCUboot expects slot0_partition and slot1_partition to be present
157157
in DT and application will boot from slot0_partition.
158158
MCUBOOT_BOOTLOADER_NO_DOWNGRADE should also be selected
159159
if MCUboot has been built with MCUBOOT_DOWNGRADE_PREVENTION.
160160

161+
config MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH
162+
bool "MCUboot has been configured for swap without scratch operation [DEPRECATED]"
163+
select DEPRECATED
164+
select MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE
165+
help
166+
This Kconfig is deprecated, use MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE instead.
167+
161168
config MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH
162169
bool "MCUboot has been configured for swap using scratch operation"
163170
select MCUBOOT_BOOTLOADER_MODE_HAS_NO_DOWNGRADE

subsys/mgmt/mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ int img_mgmt_upload_inspect(const struct img_mgmt_upload_req *req,
568568
const struct flash_area *fa;
569569
#if defined(CONFIG_MCUMGR_GRP_IMG_TOO_LARGE_SYSBUILD) && \
570570
(defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH) || \
571+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE) || \
571572
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH) || \
572573
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY) || \
573574
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \
@@ -644,6 +645,7 @@ int img_mgmt_upload_inspect(const struct img_mgmt_upload_req *req,
644645

645646
#if defined(CONFIG_MCUMGR_GRP_IMG_TOO_LARGE_SYSBUILD) && \
646647
(defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH) || \
648+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE) || \
647649
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_SCRATCH) || \
648650
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY) || \
649651
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD) || \

subsys/mgmt/mcumgr/grp/os_mgmt/src/os_mgmt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ os_mgmt_mcumgr_params(struct smp_streamer *ctxt)
430430
#define BOOTLOADER_MODE MCUBOOT_MODE_SWAP_USING_SCRATCH
431431
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY)
432432
#define BOOTLOADER_MODE MCUBOOT_MODE_UPGRADE_ONLY
433-
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH)
433+
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_USING_MOVE) || \
434+
defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_SWAP_WITHOUT_SCRATCH)
434435
#define BOOTLOADER_MODE MCUBOOT_MODE_SWAP_USING_MOVE
435436
#elif defined(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP)
436437
#define BOOTLOADER_MODE MCUBOOT_MODE_DIRECT_XIP

0 commit comments

Comments
 (0)