@@ -30,6 +30,87 @@ endchoice
3030
3131if BOOTLOADER_MCUBOOT
3232
33+ choice MCUBOOT_MODE
34+ prompt "Mode of operation"
35+ default MCUBOOT_MODE_SWAP_WITHOUT_SCRATCH
36+ help
37+ The operating mode of MCUboot (which will also be propagated to the application).
38+
39+ config MCUBOOT_MODE_SINGLE_APP
40+ bool "Single slot"
41+ help
42+ MCUboot will only boot slot0_partition placed application and does not care about other
43+ slots. In this mode application is not able to DFU its own update to secondary slot and
44+ all updates need to be performed using MCUboot serial recovery.
45+
46+ config MCUBOOT_MODE_SWAP_WITHOUT_SCRATCH
47+ bool "Swap without scratch (swap using move)"
48+ help
49+ MCUboot expects slot0_partition and slot1_partition to be present in DT and application
50+ will boot from slot0_partition. MCUBOOT_BOOTLOADER_NO_DOWNGRADE should also be selected
51+ in main application if MCUboot has been built with MCUBOOT_DOWNGRADE_PREVENTION.
52+
53+ config MCUBOOT_MODE_SWAP_SCRATCH
54+ bool "Swap using scratch"
55+ help
56+ MCUboot expects slot0_partition, slot1_partition and scratch_partition to be present in
57+ DT, and application will boot from slot0_partition. In this mode scratch_partition is
58+ used as temporary storage when MCUboot swaps application from the secondary slot to the
59+ primary slot.
60+ MCUBOOT_BOOTLOADER_NO_DOWNGRADE should also be selected in main application if MCUboot
61+ has been built with MCUBOOT_DOWNGRADE_PREVENTION.
62+
63+ config MCUBOOT_MODE_OVERWRITE_ONLY
64+ bool "Overwrite"
65+ help
66+ MCUboot will take contents of secondary slot of an image and will overwrite primary slot
67+ with it. In this mode it is not possible to revert back to previous version as it is not
68+ stored in the secondary slot.
69+ This mode supports MCUBOOT_BOOTLOADER_NO_DOWNGRADE which means that the overwrite will
70+ not happen unless the version of secondary slot is higher than the version in primary
71+ slot.
72+
73+ config MCUBOOT_MODE_DIRECT_XIP
74+ bool "DirectXIP"
75+ help
76+ MCUboot expects slot0_partition and slot1_partition to exist in DT. In this mode MCUboot
77+ can boot from either partition and will select one with higher application image version,
78+ which usually means major.minor.patch triple, unless BOOT_VERSION_CMP_USE_BUILD_NUMBER is
79+ also selected in MCUboot that enables comparison of build number.
80+ This option automatically selectes MCUBOOT_BOOTLOADER_NO_DOWNGRADE as it is not possible
81+ to swap back to older version of application.
82+
83+ config MCUBOOT_MODE_DIRECT_XIP_WITH_REVERT
84+ bool "DirectXIP with revert"
85+ help
86+ MCUboot expects slot0_partition and slot1_partition to exist in DT. In this mode MCUboot
87+ will boot the application with the higher version from either slot, as long as it has
88+ been marked to be boot next time for test or permanently. In case when application is
89+ marked for test it needs to confirm itself, on the first boot, or it will be removed and
90+ MCUboot will revert to booting previously approved application.
91+ This mode does not allow freely switching between application versions, as, once higher
92+ version application is approved, it is not possible to select lower version for boot.
93+ This mode selects MCUBOOT_BOOTLOADER_NO_DOWNGRADE as it is not possible to downgrade
94+ running application, but note that MCUboot may do that if application with higher
95+ version will not get confirmed.
96+
97+ config MCUBOOT_MODE_RAM_LOAD
98+ bool "RAM load"
99+ help
100+ MCUboot expects slot0_partition and slot1_partition to exist in DT. In this mode, MCUboot
101+ will select the image with the higher version number, copy it to RAM and begin execution
102+ from there. The image must be linked to execute from RAM, the address that it is copied
103+ to is specified using the load-addr argument when running imgtool.
104+
105+ config MCUBOOT_MODE_FIRMWARE_UPDATER
106+ bool "Firmware updater"
107+ help
108+ MCUboot will only boot slot0_partition for the main application but has an entrance
109+ mechanism defined for entering the slot1_partition which is a dedicated firmware updater
110+ application used to update the slot0_partition application.
111+
112+ endchoice
113+
33114config SIGNATURE_TYPE
34115 string
35116 default NONE if BOOT_SIGNATURE_TYPE_NONE
0 commit comments