Skip to content

Commit e7ce354

Browse files
boot/zephyr: Move RAM load Kconfigs outside !SINGLE_APPLICATION_SLOT
Now that RAM load code is not dependent on bootutil/loader.c, it can be used independently of !SINGLE_APPLICATION_SLOT configurations. Move the related Kconfigs accordingly, so that applications configured to use single loader can do RAM loading. Signed-off-by: Ederson de Souza <[email protected]>
1 parent a53faf1 commit e7ce354

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

boot/zephyr/Kconfig

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,6 @@ config BOOT_DIRECT_XIP
248248
images must be linked to be executed from the given image slot. Using this
249249
mode results in a simpler code path and smaller code size.
250250

251-
config BOOT_RAM_LOAD
252-
bool "RAM load"
253-
help
254-
If y, mcuboot selects the newest valid image based on the image version
255-
numbers, thereafter the selected image is copied to RAM and executed from
256-
there. For this reason, the image has to be linked to be executed from RAM.
257-
The address that the image is copied to is specified using the load-addr
258-
argument to the imgtool.py script which writes it to the image header.
259-
260251
config BOOT_FIRMWARE_LOADER
261252
bool "Firmware loader"
262253
help
@@ -271,19 +262,6 @@ config BOOT_FIRMWARE_LOADER
271262

272263
endchoice
273264

274-
# Workaround for not being able to have commas in macro arguments
275-
DT_CHOSEN_Z_SRAM := zephyr,sram
276-
277-
if BOOT_RAM_LOAD
278-
config BOOT_IMAGE_EXECUTABLE_RAM_START
279-
hex "Boot image executable ram start"
280-
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
281-
282-
config BOOT_IMAGE_EXECUTABLE_RAM_SIZE
283-
int "Boot image executable base size"
284-
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0)
285-
endif
286-
287265
config BOOT_DIRECT_XIP_REVERT
288266
bool "Enable the revert mechanism in direct-xip mode"
289267
depends on BOOT_DIRECT_XIP
@@ -320,6 +298,28 @@ config BOOT_SWAP_SAVE_ENCTLV
320298

321299
endif # !SINGLE_APPLICATION_SLOT
322300

301+
config BOOT_RAM_LOAD
302+
bool "RAM load"
303+
help
304+
If y, mcuboot selects the newest valid image based on the image version
305+
numbers, thereafter the selected image is copied to RAM and executed from
306+
there. For this reason, the image has to be linked to be executed from RAM.
307+
The address that the image is copied to is specified using the load-addr
308+
argument to the imgtool.py script which writes it to the image header.
309+
310+
# Workaround for not being able to have commas in macro arguments
311+
DT_CHOSEN_Z_SRAM := zephyr,sram
312+
313+
if BOOT_RAM_LOAD
314+
config BOOT_IMAGE_EXECUTABLE_RAM_START
315+
hex "Boot image executable ram start"
316+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_SRAM))
317+
318+
config BOOT_IMAGE_EXECUTABLE_RAM_SIZE
319+
int "Boot image executable base size"
320+
default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM),0)
321+
endif
322+
323323
config BOOT_ENCRYPTION_SUPPORT
324324
bool
325325
help

boot/zephyr/include/mcuboot_config/mcuboot_config.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@
8282
#define MCUBOOT_DIRECT_XIP_REVERT
8383
#endif
8484

85-
#ifdef CONFIG_BOOT_RAM_LOAD
86-
#define MCUBOOT_RAM_LOAD 1
87-
#define IMAGE_EXECUTABLE_RAM_START CONFIG_BOOT_IMAGE_EXECUTABLE_RAM_START
88-
#define IMAGE_EXECUTABLE_RAM_SIZE CONFIG_BOOT_IMAGE_EXECUTABLE_RAM_SIZE
89-
#endif
90-
9185
#ifdef CONFIG_BOOT_FIRMWARE_LOADER
9286
#define MCUBOOT_FIRMWARE_LOADER
9387
#endif
@@ -108,6 +102,12 @@
108102

109103
#endif /* CONFIG_SINGLE_APPLICATION_SLOT */
110104

105+
#ifdef CONFIG_BOOT_RAM_LOAD
106+
#define MCUBOOT_RAM_LOAD 1
107+
#define IMAGE_EXECUTABLE_RAM_START CONFIG_BOOT_IMAGE_EXECUTABLE_RAM_START
108+
#define IMAGE_EXECUTABLE_RAM_SIZE CONFIG_BOOT_IMAGE_EXECUTABLE_RAM_SIZE
109+
#endif
110+
111111
#ifdef CONFIG_LOG
112112
#define MCUBOOT_HAVE_LOGGING 1
113113
#endif

0 commit comments

Comments
 (0)