David Vincze | 03368b8 | 2020-04-01 12:53:53 +0200 | [diff] [blame] | 1 | # Copyright (c) 2017-2020 Linaro Limited |
David Vincze | c308413 | 2020-02-18 14:50:47 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020 Arm Limited |
Mateusz Michalek | c3a72e9 | 2024-01-09 08:30:58 +0100 | [diff] [blame] | 3 | # Copyright (c) 2023 Nordic Semiconductor ASA |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 4 | # |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | # |
| 7 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 8 | mainmenu "MCUboot configuration" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 9 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 10 | comment "MCUboot-specific configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 11 | |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 12 | # Hidden option to mark a project as MCUboot |
| 13 | config MCUBOOT |
| 14 | default y |
| 15 | bool |
Rajavardhan Gundi | 07ba28f | 2018-12-10 15:44:48 +0530 | [diff] [blame] | 16 | select MPU_ALLOW_FLASH_WRITE if ARM_MPU |
Marcin Niestroj | c6be76a | 2020-03-22 14:39:35 +0100 | [diff] [blame] | 17 | select USE_DT_CODE_PARTITION if HAS_FLASH_LOAD_OFFSET |
Andrzej Puzdrowski | f573b39 | 2020-11-10 14:35:15 +0100 | [diff] [blame] | 18 | select MCUBOOT_BOOTUTIL_LIB |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 19 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 20 | config BOOT_USE_MBEDTLS |
| 21 | bool |
| 22 | # Hidden option |
| 23 | default n |
| 24 | help |
| 25 | Use mbedTLS for crypto primitives. |
| 26 | |
| 27 | config BOOT_USE_TINYCRYPT |
| 28 | bool |
| 29 | # Hidden option |
| 30 | default n |
Sebastian Bøe | 913a385 | 2019-01-22 13:53:12 +0100 | [diff] [blame] | 31 | # When building for ECDSA, we use our own copy of mbedTLS, so the |
| 32 | # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros |
| 33 | # will collide. |
Xudong Zheng | 8cee355 | 2023-12-26 21:28:38 -0500 | [diff] [blame] | 34 | select MBEDTLS_PROMPTLESS if ZEPHYR_MBEDTLS_MODULE |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 35 | help |
| 36 | Use TinyCrypt for crypto primitives. |
| 37 | |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 38 | config BOOT_USE_CC310 |
| 39 | bool |
| 40 | # Hidden option |
| 41 | default n |
| 42 | # When building for ECDSA, we use our own copy of mbedTLS, so the |
| 43 | # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros |
| 44 | # will collide. |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 45 | help |
| 46 | Use cc310 for crypto primitives. |
| 47 | |
| 48 | config BOOT_USE_NRF_CC310_BL |
| 49 | bool |
| 50 | default n |
| 51 | |
| 52 | config NRFXLIB_CRYPTO |
| 53 | bool |
| 54 | default n |
| 55 | |
| 56 | config NRF_CC310_BL |
| 57 | bool |
| 58 | default n |
| 59 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 60 | menu "MCUBoot settings" |
| 61 | |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 62 | config SINGLE_APPLICATION_SLOT |
| 63 | bool "Single slot bootloader" |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 64 | default n |
| 65 | help |
| 66 | Single image area is used for application which means that |
| 67 | uploading a new application overwrites the one that previously |
| 68 | occupied the area. |
| 69 | |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 70 | choice BOOT_SIGNATURE_TYPE |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 71 | prompt "Signature type" |
| 72 | default BOOT_SIGNATURE_TYPE_RSA |
| 73 | |
Arvin Farahmand | fb5ec18 | 2020-05-05 11:44:12 -0400 | [diff] [blame] | 74 | config BOOT_SIGNATURE_TYPE_NONE |
| 75 | bool "No signature; use only hash check" |
| 76 | select BOOT_USE_TINYCRYPT |
| 77 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 78 | config BOOT_SIGNATURE_TYPE_RSA |
| 79 | bool "RSA signatures" |
| 80 | select BOOT_USE_MBEDTLS |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 81 | select MBEDTLS |
Jamie McCrae | 25d2f2c | 2023-07-17 14:17:53 +0100 | [diff] [blame] | 82 | select BOOT_ENCRYPTION_SUPPORT |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 83 | |
Fabio Utzig | 105b59a | 2019-05-13 15:08:12 -0700 | [diff] [blame] | 84 | if BOOT_SIGNATURE_TYPE_RSA |
| 85 | config BOOT_SIGNATURE_TYPE_RSA_LEN |
| 86 | int "RSA signature length" |
| 87 | range 2048 3072 |
| 88 | default 2048 |
| 89 | endif |
| 90 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 91 | config BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 92 | bool "Elliptic curve digital signatures with curve P-256" |
Jamie McCrae | 25d2f2c | 2023-07-17 14:17:53 +0100 | [diff] [blame] | 93 | select BOOT_ENCRYPTION_SUPPORT |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 94 | |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 95 | if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 96 | choice BOOT_ECDSA_IMPLEMENTATION |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 97 | prompt "Ecdsa implementation" |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 98 | default BOOT_ECDSA_TINYCRYPT |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 99 | |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 100 | config BOOT_ECDSA_TINYCRYPT |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 101 | bool "Use tinycrypt" |
| 102 | select BOOT_USE_TINYCRYPT |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 103 | |
| 104 | config BOOT_ECDSA_CC310 |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 105 | bool "Use CC310" |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 106 | depends on HAS_HW_NRF_CC310 |
| 107 | select BOOT_USE_NRF_CC310_BL |
| 108 | select NRF_CC310_BL |
| 109 | select NRFXLIB_CRYPTO |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 110 | select BOOT_USE_CC310 |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 111 | endchoice # Ecdsa implementation |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 112 | endif |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 113 | |
| 114 | config BOOT_SIGNATURE_TYPE_ED25519 |
| 115 | bool "Edwards curve digital signatures using ed25519" |
Jamie McCrae | 25d2f2c | 2023-07-17 14:17:53 +0100 | [diff] [blame] | 116 | select BOOT_ENCRYPTION_SUPPORT |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 117 | |
| 118 | if BOOT_SIGNATURE_TYPE_ED25519 |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 119 | choice BOOT_ED25519_IMPLEMENTATION |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 120 | prompt "Ecdsa implementation" |
| 121 | default BOOT_ED25519_TINYCRYPT |
| 122 | config BOOT_ED25519_TINYCRYPT |
| 123 | bool "Use tinycrypt" |
| 124 | select BOOT_USE_TINYCRYPT |
| 125 | config BOOT_ED25519_MBEDTLS |
| 126 | bool "Use mbedTLS" |
| 127 | select BOOT_USE_MBEDTLS |
| 128 | select MBEDTLS |
| 129 | endchoice |
| 130 | endif |
| 131 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 132 | endchoice |
| 133 | |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 134 | config BOOT_SIGNATURE_KEY_FILE |
| 135 | string "PEM key file" |
Håkon Øye Amundsen | 705c6c2 | 2020-09-28 09:45:40 +0000 | [diff] [blame] | 136 | default "root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 137 | default "root-ed25519.pem" if BOOT_SIGNATURE_TYPE_ED25519 |
| 138 | default "root-rsa-3072.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=3072 |
| 139 | default "root-rsa-2048.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=2048 |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 140 | default "" |
| 141 | help |
Marek Pieta | bdcfc85 | 2020-08-04 02:22:55 -0700 | [diff] [blame] | 142 | You can use either absolute or relative path. |
| 143 | In case relative path is used, the build system assumes that it starts |
| 144 | from the directory where the MCUBoot KConfig configuration file is |
| 145 | located. If the key file is not there, the build system uses relative |
| 146 | path that starts from the MCUBoot repository root directory. |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 147 | The key file will be parsed by imgtool's getpub command and a .c source |
| 148 | with the public key information will be written in a format expected by |
| 149 | MCUboot. |
| 150 | |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 151 | config MCUBOOT_CLEANUP_ARM_CORE |
| 152 | bool "Perform core cleanup before chain-load the application" |
| 153 | depends on CPU_CORTEX_M |
Jamie McCrae | 9e8eddc | 2023-02-27 12:51:09 +0000 | [diff] [blame] | 154 | default y |
Ioannis Glaropoulos | 518d93a | 2020-10-22 14:22:14 +0200 | [diff] [blame] | 155 | help |
| 156 | This option instructs MCUboot to perform a clean-up of a set of |
Marcin Niestroj | 9ced459 | 2023-05-17 14:50:57 +0200 | [diff] [blame] | 157 | architecture core HW registers before jumping to the application |
Ioannis Glaropoulos | 518d93a | 2020-10-22 14:22:14 +0200 | [diff] [blame] | 158 | firmware. The clean-up sets these registers to their warm-reset |
| 159 | values as specified by the architecture. |
| 160 | |
Jamie McCrae | 9e8eddc | 2023-02-27 12:51:09 +0000 | [diff] [blame] | 161 | This option is enabled by default to prevent possible problems when |
| 162 | booting zephyr (or other) applications whereby e.g. a MPU stack guard |
| 163 | may be initialised in RAM which is then used by the application |
| 164 | start-up code which can cause a module fault and potentially make the |
| 165 | module irrecoverable. |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 166 | |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 167 | config MBEDTLS_CFG_FILE |
| 168 | default "mcuboot-mbedtls-cfg.h" |
| 169 | |
David Vincze | 03368b8 | 2020-04-01 12:53:53 +0200 | [diff] [blame] | 170 | config BOOT_HW_KEY |
| 171 | bool "Use HW key for image verification" |
| 172 | default n |
| 173 | help |
| 174 | Use HW key for image verification, otherwise the public key is embedded |
| 175 | in MCUBoot. If enabled the public key is appended to the signed image |
| 176 | and requires the hash of the public key to be provisioned to the device |
| 177 | beforehand. |
| 178 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 179 | config BOOT_VALIDATE_SLOT0 |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 180 | bool "Validate image in the primary slot on every boot" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 181 | default y |
| 182 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 183 | If y, the bootloader attempts to validate the signature of the |
| 184 | primary slot every boot. This adds the signature check time to |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 185 | every boot, but can mitigate against some changes that are |
| 186 | able to modify the flash image itself. |
| 187 | |
Wouter Cappelle | bb7a39d | 2021-05-03 16:44:44 +0200 | [diff] [blame] | 188 | config BOOT_VALIDATE_SLOT0_ONCE |
| 189 | bool "Validate image in the primary slot just once after after upgrade" |
| 190 | depends on !BOOT_VALIDATE_SLOT0 && SINGLE_APPLICATION_SLOT |
| 191 | default n |
| 192 | help |
| 193 | If y, the bootloader attempts to validate the signature of the |
| 194 | primary slot only once after an upgrade of the main slot. |
| 195 | It caches the result in the magic area, which makes it an unsecure |
| 196 | method. This option is usefull for lowering the boot up time for |
| 197 | low end devices with as a compromise lowering the security level. |
| 198 | If unsure, leave at the default value. |
| 199 | |
David Brown | 08a30a4 | 2022-04-26 14:49:51 -0600 | [diff] [blame] | 200 | config BOOT_PREFER_SWAP_MOVE |
| 201 | bool "Prefer the newer swap move algorithm" |
Jamie McCrae | 8b4c70a | 2024-03-07 07:51:55 +0000 | [diff] [blame] | 202 | default y if SOC_FAMILY_NORDIC_NRF |
Thomas Stranger | aa217e2 | 2022-10-28 21:17:55 +0200 | [diff] [blame] | 203 | default y if !$(dt_nodelabel_enabled,scratch_partition) |
David Brown | 08a30a4 | 2022-04-26 14:49:51 -0600 | [diff] [blame] | 204 | help |
| 205 | If y, the BOOT_IMAGE_UPGRADE_MODE will default to using |
| 206 | "move" instead of "scratch". This is a separate bool config |
| 207 | option, because Kconfig doesn't allow defaults to be |
| 208 | overridden in choice options. Most devices should be using |
| 209 | swap move. |
| 210 | |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 211 | if !SINGLE_APPLICATION_SLOT |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 212 | choice BOOT_IMAGE_UPGRADE_MODE |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 213 | prompt "Image upgrade modes" |
David Brown | 08a30a4 | 2022-04-26 14:49:51 -0600 | [diff] [blame] | 214 | default BOOT_SWAP_USING_MOVE if BOOT_PREFER_SWAP_MOVE |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 215 | default BOOT_SWAP_USING_SCRATCH |
| 216 | |
| 217 | config BOOT_SWAP_USING_SCRATCH |
| 218 | bool "Swap mode that run with the scratch partition" |
| 219 | help |
| 220 | This is the most conservative swap mode but it can work even on |
| 221 | devices with heterogeneous flash page layout. |
| 222 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 223 | config BOOT_UPGRADE_ONLY |
| 224 | bool "Overwrite image updates instead of swapping" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 225 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 226 | If y, overwrite the primary slot with the upgrade image instead |
| 227 | of swapping them. This prevents the fallback recovery, but |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 228 | uses a much simpler code path. |
| 229 | |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 230 | config BOOT_SWAP_USING_MOVE |
Fabio Utzig | dd2b680 | 2020-01-06 09:10:45 -0300 | [diff] [blame] | 231 | bool "Swap mode that can run without a scratch partition" |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 232 | help |
| 233 | If y, the swap upgrade is done in two steps, where first every |
| 234 | sector of the primary slot is moved up one sector, then for |
| 235 | each sector X in the secondary slot, it is moved to index X in |
| 236 | the primary slot, then the sector at X+1 in the primary is |
| 237 | moved to index X in the secondary. |
| 238 | This allows a swap upgrade without using a scratch partition, |
| 239 | but is currently limited to all sectors in both slots being of |
| 240 | the same size. |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 241 | |
| 242 | config BOOT_DIRECT_XIP |
| 243 | bool "Run the latest image directly from its slot" |
| 244 | help |
| 245 | If y, mcuboot selects the newest valid image based on the image version |
| 246 | numbers, thereafter the selected image can run directly from its slot |
| 247 | without having to move/copy it into the primary slot. For this reason the |
| 248 | images must be linked to be executed from the given image slot. Using this |
| 249 | mode results in a simpler code path and smaller code size. |
| 250 | |
Johan Öhman | b588907 | 2022-04-01 09:10:28 +0200 | [diff] [blame] | 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 | |
Jamie McCrae | 215345f | 2023-08-16 07:37:18 +0100 | [diff] [blame] | 260 | config BOOT_FIRMWARE_LOADER |
| 261 | bool "Firmware loader" |
| 262 | help |
| 263 | If y, mcuboot will have a single application slot, and the secondary |
| 264 | slot will be for a non-upgradeable firmware loaded image (e.g. for |
| 265 | loading firmware via Bluetooth). The main application will boot by |
| 266 | default unless there is an error with it or the boot mode has been |
| 267 | forced to the firmware loader. |
| 268 | |
| 269 | Note: The firmware loader image must be signed with the same signing |
| 270 | key as the primary image. |
| 271 | |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 272 | endchoice |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 273 | |
Johan Öhman | b588907 | 2022-04-01 09:10:28 +0200 | [diff] [blame] | 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 | |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 287 | config BOOT_DIRECT_XIP_REVERT |
| 288 | bool "Enable the revert mechanism in direct-xip mode" |
Andrzej Puzdrowski | 32342e7 | 2020-11-18 17:04:44 +0100 | [diff] [blame] | 289 | depends on BOOT_DIRECT_XIP |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 290 | default n |
| 291 | help |
| 292 | If y, enables the revert mechanism in direct-xip similar to the one in |
| 293 | swap mode. It requires the trailer magic to be added to the signed image. |
| 294 | When a reboot happens without the image being confirmed at runtime, the |
| 295 | bootloader considers the image faulty and erases it. After this it will |
| 296 | attempt to boot the previous image. The images can also be made permanent |
| 297 | (marked as confirmed in advance) just like in swap mode. |
| 298 | |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 299 | config BOOT_BOOTSTRAP |
Sam Bristow | d0ca0ff | 2019-10-30 20:51:35 +1300 | [diff] [blame] | 300 | bool "Bootstrap erased the primary slot from the secondary slot" |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 301 | default n |
| 302 | help |
| 303 | If y, enables bootstraping support. Bootstrapping allows an erased |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 304 | primary slot to be initialized from a valid image in the secondary slot. |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 305 | If unsure, leave at the default value. |
| 306 | |
Fabio Utzig | ca8ead2 | 2019-12-20 07:06:04 -0300 | [diff] [blame] | 307 | config BOOT_SWAP_SAVE_ENCTLV |
| 308 | bool "Save encrypted key TLVs instead of plaintext keys in swap metadata" |
| 309 | default n |
Jamie McCrae | e9131ee | 2023-10-31 09:54:35 +0000 | [diff] [blame] | 310 | depends on BOOT_ENCRYPT_IMAGE |
Fabio Utzig | ca8ead2 | 2019-12-20 07:06:04 -0300 | [diff] [blame] | 311 | help |
| 312 | If y, instead of saving the encrypted image keys in plaintext in the |
| 313 | swap resume metadata, save the encrypted image TLVs. This should be used |
| 314 | when there is no security mechanism protecting the data in the primary |
| 315 | slot from being dumped. If n is selected (default), the keys are written |
| 316 | after being decrypted from the image TLVs and could be read by an |
| 317 | attacker who has access to the flash contents of the primary slot (eg |
| 318 | JTAG/SWD or primary slot in external flash). |
| 319 | If unsure, leave at the default value. |
| 320 | |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 321 | endif # !SINGLE_APPLICATION_SLOT |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 322 | |
Jamie McCrae | 25d2f2c | 2023-07-17 14:17:53 +0100 | [diff] [blame] | 323 | config BOOT_ENCRYPTION_SUPPORT |
| 324 | bool |
| 325 | help |
| 326 | Hidden option used to check if image encryption is supported. |
| 327 | |
| 328 | config BOOT_ENCRYPT_IMAGE |
| 329 | bool "Support for encrypted image updates" |
| 330 | depends on BOOT_ENCRYPTION_SUPPORT |
| 331 | select BOOT_ENCRYPT_RSA if BOOT_SIGNATURE_TYPE_RSA |
| 332 | select BOOT_ENCRYPT_EC256 if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 333 | select BOOT_ENCRYPT_X25519 if BOOT_SIGNATURE_TYPE_ED25519 |
| 334 | depends on !SINGLE_APPLICATION_SLOT || MCUBOOT_SERIAL |
| 335 | help |
| 336 | If y, images in the secondary slot can be encrypted and are decrypted |
| 337 | on the fly when upgrading to the primary slot, as well as encrypted |
| 338 | back when swapping from the primary slot to the secondary slot. The |
| 339 | encryption mechanism must match the same type as the signature type, |
| 340 | supported types include: |
| 341 | - RSA-OAEP (2048 bits). |
| 342 | - ECIES using primitives described under "ECIES-P256 encryption" in |
| 343 | docs/encrypted_images.md. |
| 344 | - ECIES using primitives described under "ECIES-X25519 encryption" |
| 345 | in docs/encrypted_images.md. |
| 346 | |
| 347 | Note that for single slot operation, this can still be used to allow |
| 348 | loading encrypted images via serial recovery which are then |
| 349 | decrypted on-the-fly without needing a second slot. |
| 350 | |
| 351 | config BOOT_ENCRYPT_RSA |
| 352 | bool |
| 353 | help |
| 354 | Hidden option selecting RSA encryption. |
| 355 | |
| 356 | config BOOT_ENCRYPT_EC256 |
| 357 | bool |
| 358 | help |
| 359 | Hidden option selecting EC256 encryption. |
| 360 | |
| 361 | config BOOT_ENCRYPT_X25519 |
| 362 | bool |
| 363 | help |
| 364 | Hidden option selecting x25519 encryption. |
| 365 | |
Wouter Cappelle | 953a761 | 2021-05-03 16:53:05 +0200 | [diff] [blame] | 366 | config BOOT_ENCRYPTION_KEY_FILE |
Jamie McCrae | 25d2f2c | 2023-07-17 14:17:53 +0100 | [diff] [blame] | 367 | string "Encryption key file" |
| 368 | depends on BOOT_ENCRYPT_IMAGE |
| 369 | default "enc-rsa2048-priv.pem" if BOOT_ENCRYPT_RSA |
| 370 | default "enc-ec256-priv.pem" if BOOT_ENCRYPT_EC256 |
| 371 | default "enc-x25519-priv.pem" if BOOT_ENCRYPT_X25519 |
Wouter Cappelle | 953a761 | 2021-05-03 16:53:05 +0200 | [diff] [blame] | 372 | default "" |
| 373 | help |
| 374 | You can use either absolute or relative path. |
| 375 | In case relative path is used, the build system assumes that it starts |
| 376 | from the directory where the MCUBoot KConfig configuration file is |
| 377 | located. If the key file is not there, the build system uses relative |
| 378 | path that starts from the MCUBoot repository root directory. |
| 379 | The key file will be parsed by imgtool's getpriv command and a .c source |
| 380 | with the public key information will be written in a format expected by |
| 381 | MCUboot. |
| 382 | |
Jamie McCrae | eaae650 | 2024-07-25 14:36:46 +0100 | [diff] [blame] | 383 | config BOOT_MAX_IMG_SECTORS_AUTO |
| 384 | bool "Calculate maximum sectors automatically" |
| 385 | default y |
| 386 | help |
| 387 | If this option is enabled then the maximum number of supported sectors per image will |
| 388 | be calculated automatically from the flash erase sizes and size of each partition for |
| 389 | the first image. |
| 390 | |
| 391 | If this information is not available, or multiple images are used, then this option |
| 392 | should be disabled and BOOT_MAX_IMG_SECTORS should be set instead |
| 393 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 394 | config BOOT_MAX_IMG_SECTORS |
| 395 | int "Maximum number of sectors per image slot" |
| 396 | default 128 |
Jamie McCrae | eaae650 | 2024-07-25 14:36:46 +0100 | [diff] [blame] | 397 | depends on !BOOT_MAX_IMG_SECTORS_AUTO |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 398 | help |
| 399 | This option controls the maximum number of sectors that each of |
| 400 | the two image areas can contain. Smaller values reduce MCUboot's |
| 401 | memory usage; larger values allow it to support larger images. |
| 402 | If unsure, leave at the default value. |
| 403 | |
Jamie McCrae | 4da5101 | 2023-08-03 16:23:02 +0100 | [diff] [blame] | 404 | config BOOT_SHARE_BACKEND_AVAILABLE |
| 405 | bool |
David Vincze | 1cf11b5 | 2020-03-24 07:51:09 +0100 | [diff] [blame] | 406 | default n |
| 407 | help |
Jamie McCrae | 4da5101 | 2023-08-03 16:23:02 +0100 | [diff] [blame] | 408 | Hidden open which indicates if there is a sharing backend available. |
| 409 | |
| 410 | # Workaround for not being able to have commas in macro arguments |
| 411 | DT_CHOSEN_BOOTLOADER_INFO := zephyr,bootloader-info |
| 412 | |
| 413 | config BOOT_SHARE_BACKEND_AVAILABLE |
| 414 | bool |
| 415 | default n |
| 416 | help |
| 417 | Hidden open which indicates if there is a sharing backend available. |
| 418 | |
| 419 | choice BOOT_SHARE_BACKEND |
| 420 | prompt "Shared data backend" |
| 421 | default BOOT_SHARE_BACKEND_DISABLED |
| 422 | |
| 423 | config BOOT_SHARE_BACKEND_DISABLED |
| 424 | bool "Disabled" |
| 425 | help |
| 426 | No data sharing support. |
| 427 | |
| 428 | config BOOT_SHARE_BACKEND_RETENTION |
| 429 | bool "Retention" |
| 430 | depends on RETENTION |
| 431 | depends on $(dt_chosen_enabled,$(DT_CHOSEN_BOOTLOADER_INFO)) |
| 432 | select BOOT_SHARE_BACKEND_AVAILABLE |
| 433 | help |
| 434 | Use retention to share data with application. Requires: |
| 435 | - Retained memory area |
| 436 | - Retention partition of retained memory area |
| 437 | - Chosen node "zephyr,bootloader-info" to be set to the retention |
| 438 | partition |
| 439 | |
| 440 | config BOOT_SHARE_BACKEND_EXTERNAL |
| 441 | bool "External (user-provided code)" |
| 442 | select BOOT_SHARE_BACKEND_AVAILABLE |
| 443 | help |
| 444 | Use a custom user-specified storage. |
| 445 | |
| 446 | endchoice |
| 447 | |
| 448 | menuconfig BOOT_SHARE_DATA |
| 449 | bool "Save application specific data" |
| 450 | default n |
| 451 | depends on BOOT_SHARE_BACKEND_AVAILABLE |
| 452 | help |
| 453 | This will allow data to be shared between MCUboot and an application, |
| 454 | it does not include any informatiom by default. |
| 455 | |
| 456 | Note: This requires a backend to function, see |
| 457 | BOOT_SHARE_BACKEND_RETENTION for details on using the retention |
| 458 | subsystem as a backend. |
| 459 | |
| 460 | config BOOT_SHARE_DATA_BOOTINFO |
| 461 | bool "Save boot information data" |
| 462 | default n |
| 463 | depends on BOOT_SHARE_DATA |
| 464 | help |
| 465 | This will place information about the MCUboot configuration and |
| 466 | running application into a shared memory area. |
| 467 | |
| 468 | menuconfig MEASURED_BOOT |
| 469 | bool "Store the boot state/measurements in shared memory area" |
| 470 | default n |
| 471 | depends on BOOT_SHARE_BACKEND_AVAILABLE |
| 472 | help |
David Vincze | 1cf11b5 | 2020-03-24 07:51:09 +0100 | [diff] [blame] | 473 | If enabled, the bootloader will store certain boot measurements such as |
| 474 | the hash of the firmware image in a shared memory area. This data can |
| 475 | be used later by runtime services (e.g. by a device attestation service). |
| 476 | |
Jamie McCrae | 4da5101 | 2023-08-03 16:23:02 +0100 | [diff] [blame] | 477 | Note: This requires a backend to function, see |
| 478 | BOOT_SHARE_BACKEND_RETENTION for details on using the retention |
| 479 | subsystem as a backend. |
| 480 | |
| 481 | config MEASURED_BOOT_MAX_CBOR_SIZE |
| 482 | int "Maximum CBOR size of boot state/measurements" |
| 483 | default 64 |
| 484 | range 0 256 |
| 485 | depends on MEASURED_BOOT |
| 486 | help |
| 487 | The maximum size of the CBOR message which stores boot |
| 488 | state/measurements. |
David Vincze | 1cf11b5 | 2020-03-24 07:51:09 +0100 | [diff] [blame] | 489 | |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 490 | choice BOOT_FAULT_INJECTION_HARDENING_PROFILE |
Tamas Ban | fce8733 | 2020-07-10 12:40:11 +0100 | [diff] [blame] | 491 | prompt "Fault injection hardening profile" |
| 492 | default BOOT_FIH_PROFILE_OFF |
| 493 | |
| 494 | config BOOT_FIH_PROFILE_OFF |
| 495 | bool "No hardening against hardware level fault injection" |
| 496 | help |
| 497 | No hardening in SW against hardware level fault injection: power or |
| 498 | clock glitching, etc. |
| 499 | |
| 500 | config BOOT_FIH_PROFILE_LOW |
| 501 | bool "Moderate level hardening against hardware level fault injection" |
| 502 | help |
| 503 | Moderate level hardening: Long global fail loop to avoid break out, |
| 504 | control flow integrity check to discover discrepancy in expected code |
| 505 | flow. |
| 506 | |
| 507 | config BOOT_FIH_PROFILE_MEDIUM |
| 508 | bool "Medium level hardening against hardware level fault injection" |
| 509 | help |
| 510 | Medium level hardening: Long global fail loop to avoid break out, |
| 511 | control flow integrity check to discover discrepancy in expected code |
| 512 | flow, double variables to discover register or memory corruption. |
| 513 | |
| 514 | config BOOT_FIH_PROFILE_HIGH |
| 515 | bool "Maximum level hardening against hardware level fault injection" |
| 516 | select MBEDTLS |
| 517 | help |
| 518 | Maximum level hardening: Long global fail loop to avoid break out, |
| 519 | control flow integrity check to discover discrepancy in expected code |
| 520 | flow, double variables to discover register or memory corruption, random |
| 521 | delays to make code execution less predictable. Random delays requires an |
| 522 | entropy source. |
| 523 | |
| 524 | endchoice |
| 525 | |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 526 | choice BOOT_USB_DFU |
| 527 | prompt "USB DFU" |
| 528 | default BOOT_USB_DFU_NO |
| 529 | |
| 530 | config BOOT_USB_DFU_NO |
| 531 | prompt "Disabled" |
| 532 | |
| 533 | config BOOT_USB_DFU_WAIT |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 534 | bool "Wait for a prescribed duration to see if USB DFU is invoked" |
Johann Fischer | 2585297 | 2021-08-02 13:20:09 +0200 | [diff] [blame] | 535 | select USB_DEVICE_STACK |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 536 | select USB_DFU_CLASS |
| 537 | select IMG_MANAGER |
Dominik Ermel | 143485e | 2023-03-17 11:33:42 +0000 | [diff] [blame] | 538 | select STREAM_FLASH |
| 539 | select MULTITHREADING |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 540 | help |
| 541 | If y, MCUboot waits for a prescribed duration of time to allow |
| 542 | for USB DFU to be invoked. Please note DFU always updates the |
| 543 | slot1 image. |
| 544 | |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 545 | config BOOT_USB_DFU_GPIO |
| 546 | bool "Use GPIO to detect whether to trigger DFU mode" |
Johann Fischer | 2585297 | 2021-08-02 13:20:09 +0200 | [diff] [blame] | 547 | select USB_DEVICE_STACK |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 548 | select USB_DFU_CLASS |
| 549 | select IMG_MANAGER |
Dominik Ermel | 143485e | 2023-03-17 11:33:42 +0000 | [diff] [blame] | 550 | select STREAM_FLASH |
| 551 | select MULTITHREADING |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 552 | help |
| 553 | If y, MCUboot uses GPIO to detect whether to invoke USB DFU. |
| 554 | |
| 555 | endchoice |
| 556 | |
| 557 | config BOOT_USB_DFU_WAIT_DELAY_MS |
| 558 | int "USB DFU wait duration" |
| 559 | depends on BOOT_USB_DFU_WAIT |
| 560 | default 12000 |
| 561 | help |
| 562 | Milliseconds to wait for USB DFU to be invoked. |
| 563 | |
| 564 | if BOOT_USB_DFU_GPIO |
| 565 | |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 566 | config BOOT_USB_DFU_DETECT_DELAY |
| 567 | int "Serial detect pin detection delay time [ms]" |
| 568 | default 0 |
| 569 | help |
| 570 | Used to prevent the bootloader from loading on button press. |
| 571 | Useful for powering on when using the same button as |
| 572 | the one used to place the device in bootloader mode. |
| 573 | |
| 574 | endif # BOOT_USB_DFU_GPIO |
| 575 | |
Fabian Pflug | ca06b9f | 2024-08-24 11:15:39 +0200 | [diff] [blame] | 576 | config BOOT_USB_DFU_NO_APPLICATION |
| 577 | bool "Stay in bootloader if no application" |
| 578 | help |
| 579 | Allows for entering USB DFU recovery mode if there is no bootable |
| 580 | application that the bootloader can jump to. |
| 581 | |
David Brown | f6d14c2 | 2019-12-10 15:36:36 -0700 | [diff] [blame] | 582 | config BOOT_USE_BENCH |
| 583 | bool "Enable benchmark code" |
| 584 | default n |
| 585 | help |
| 586 | If y, adds support for simple benchmarking that can record |
| 587 | time intervals between two calls. The time printed depends |
| 588 | on the particular Zephyr target, and is generally ticks of a |
| 589 | specific board-specific timer. |
| 590 | |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 591 | module = MCUBOOT |
Piotr Mienkowski | 15aa6ef | 2019-04-08 22:48:15 +0200 | [diff] [blame] | 592 | module-str = MCUBoot bootloader |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 593 | source "subsys/logging/Kconfig.template.log_config" |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 594 | |
Andrzej Puzdrowski | af14853 | 2020-02-25 12:51:26 +0100 | [diff] [blame] | 595 | config MCUBOOT_LOG_THREAD_STACK_SIZE |
| 596 | int "Stack size for the MCUBoot log processing thread" |
| 597 | depends on LOG && !LOG_IMMEDIATE |
| 598 | default 2048 if COVERAGE_GCOV |
| 599 | default 1024 if NO_OPTIMIZATIONS |
| 600 | default 1024 if XTENSA |
| 601 | default 4096 if (X86 && X86_64) |
| 602 | default 4096 if ARM64 |
| 603 | default 768 |
| 604 | help |
| 605 | Set the internal stack size for MCUBoot log processing thread. |
| 606 | |
Andrzej Puzdrowski | 6c00b5e | 2022-04-01 16:51:27 +0200 | [diff] [blame] | 607 | config MCUBOOT_INDICATION_LED |
| 608 | bool "Turns on LED indication when device is in DFU" |
Jamie McCrae | 2c86755 | 2023-07-27 14:18:47 +0100 | [diff] [blame] | 609 | select GPIO |
Andrzej Puzdrowski | 6c00b5e | 2022-04-01 16:51:27 +0200 | [diff] [blame] | 610 | help |
| 611 | Device device activates the LED while in bootloader mode. |
Jeppe Odgaard | 1dbe0cf | 2023-05-17 11:09:10 +0200 | [diff] [blame] | 612 | mcuboot-led0 alias must be set in the device's .dts |
Andrzej Puzdrowski | 6c00b5e | 2022-04-01 16:51:27 +0200 | [diff] [blame] | 613 | definitions for this to work. |
| 614 | |
Andrzej Puzdrowski | 35f61d3 | 2022-04-01 17:00:08 +0200 | [diff] [blame] | 615 | rsource "Kconfig.serial_recovery" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 616 | |
Jamie McCrae | 215345f | 2023-08-16 07:37:18 +0100 | [diff] [blame] | 617 | rsource "Kconfig.firmware_loader" |
| 618 | |
Rafał Kuźnia | d854bb6 | 2020-06-17 15:06:47 +0200 | [diff] [blame] | 619 | config BOOT_INTR_VEC_RELOC |
| 620 | bool "Relocate the interrupt vector to the application" |
| 621 | default n |
| 622 | depends on SW_VECTOR_RELAY || CPU_CORTEX_M_HAS_VTOR |
| 623 | help |
| 624 | Relocate the interrupt vector to the application before it is started. |
| 625 | Select this option if application requires vector relocation, |
| 626 | but it doesn't relocate vector in its reset handler. |
| 627 | |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 628 | config UPDATEABLE_IMAGE_NUMBER |
| 629 | int "Number of updateable images" |
| 630 | default 1 |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 631 | range 1 1 if SINGLE_APPLICATION_SLOT |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 632 | help |
| 633 | Enables support of multi image update. |
| 634 | |
Marek Pieta | a95a41b | 2023-04-21 14:03:19 +0200 | [diff] [blame] | 635 | config BOOT_VERSION_CMP_USE_BUILD_NUMBER |
| 636 | bool "Use build number while comparing image version" |
| 637 | depends on (UPDATEABLE_IMAGE_NUMBER > 1) || BOOT_DIRECT_XIP || \ |
| 638 | BOOT_RAM_LOAD || MCUBOOT_DOWNGRADE_PREVENTION |
| 639 | help |
| 640 | By default, the image version comparison relies only on version major, |
| 641 | minor and revision. Enable this option to take into account the build |
| 642 | number as well. |
| 643 | |
Håkon Øye Amundsen | 21f0376 | 2021-11-12 08:21:31 +0000 | [diff] [blame] | 644 | choice BOOT_DOWNGRADE_PREVENTION_CHOICE |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 645 | prompt "Downgrade prevention" |
| 646 | optional |
| 647 | |
| 648 | config MCUBOOT_DOWNGRADE_PREVENTION |
| 649 | bool "SW based downgrade prevention" |
Jerzy Kasenberg | b8801fc | 2022-06-29 15:54:37 +0200 | [diff] [blame] | 650 | depends on !BOOT_DIRECT_XIP |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 651 | help |
| 652 | Prevent downgrades by enforcing incrementing version numbers. |
| 653 | When this option is set, any upgrade must have greater major version |
| 654 | or greater minor version with equal major version. This mechanism |
| 655 | only protects against some attacks against version downgrades (for |
| 656 | example, a JTAG could be used to write an older version). |
| 657 | |
Jerzy Kasenberg | b8801fc | 2022-06-29 15:54:37 +0200 | [diff] [blame] | 658 | config MCUBOOT_DOWNGRADE_PREVENTION_SECURITY_COUNTER |
| 659 | bool "Use image security counter instead of version number" |
| 660 | depends on MCUBOOT_DOWNGRADE_PREVENTION |
| 661 | depends on (BOOT_SWAP_USING_MOVE || BOOT_SWAP_USING_SCRATCH) |
| 662 | help |
| 663 | Security counter is used for version eligibility check instead of pure |
| 664 | version. When this option is set, any upgrade must have greater or |
| 665 | equal security counter value. |
| 666 | Because of the acceptance of equal values it allows for software |
| 667 | downgrades to some extent. |
| 668 | |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 669 | config MCUBOOT_HW_DOWNGRADE_PREVENTION |
| 670 | bool "HW based downgrade prevention" |
| 671 | help |
| 672 | Prevent undesirable/malicious software downgrades. When this option is |
| 673 | set, any upgrade must have greater or equal security counter value. |
| 674 | Because of the acceptance of equal values it allows for software |
| 675 | downgrade to some extent. |
| 676 | |
| 677 | endchoice |
| 678 | |
Andrzej Puzdrowski | d21442a | 2020-10-12 16:47:28 +0200 | [diff] [blame] | 679 | config BOOT_WATCHDOG_FEED |
| 680 | bool "Feed the watchdog while doing swap" |
Andrzej Puzdrowski | b25ba4b | 2022-09-28 15:58:19 +0200 | [diff] [blame] | 681 | default y if WATCHDOG |
Jamie McCrae | 8b4c70a | 2024-03-07 07:51:55 +0000 | [diff] [blame] | 682 | default y if SOC_FAMILY_NORDIC_NRF |
Andrzej Puzdrowski | b25ba4b | 2022-09-28 15:58:19 +0200 | [diff] [blame] | 683 | # for nRF nrfx based implementation is available |
Jamie McCrae | 8b4c70a | 2024-03-07 07:51:55 +0000 | [diff] [blame] | 684 | imply NRFX_WDT if SOC_FAMILY_NORDIC_NRF |
| 685 | imply NRFX_WDT0 if SOC_FAMILY_NORDIC_NRF |
| 686 | imply NRFX_WDT1 if SOC_FAMILY_NORDIC_NRF |
| 687 | imply NRFX_WDT30 if SOC_FAMILY_NORDIC_NRF |
| 688 | imply NRFX_WDT31 if SOC_FAMILY_NORDIC_NRF |
Andrzej Puzdrowski | d21442a | 2020-10-12 16:47:28 +0200 | [diff] [blame] | 689 | help |
| 690 | Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is |
| 691 | used to feed watchdog while doing time consuming operations. |
| 692 | |
Andrzej Puzdrowski | 914204d | 2021-07-09 19:20:46 +0200 | [diff] [blame] | 693 | config BOOT_IMAGE_ACCESS_HOOKS |
| 694 | bool "Enable hooks for overriding MCUboot's native routines" |
| 695 | help |
| 696 | Allow to provide procedures for override or extend native |
| 697 | MCUboot's routines required for access the image data and the image |
Andrzej Puzdrowski | 1c150c6 | 2022-07-07 14:55:22 +0200 | [diff] [blame] | 698 | update. It is up to the project customization to add required source |
| 699 | files to the build. |
Andrzej Puzdrowski | 914204d | 2021-07-09 19:20:46 +0200 | [diff] [blame] | 700 | |
Jamie McCrae | 56cb610 | 2022-03-23 11:57:03 +0000 | [diff] [blame] | 701 | config MCUBOOT_ACTION_HOOKS |
| 702 | bool "Enable hooks for responding to MCUboot status changes" |
| 703 | help |
| 704 | This will call a handler when the MCUboot status changes which allows |
| 705 | for some level of user feedback, for instance to change LED status to |
| 706 | indicate a failure, using the callback: |
| 707 | 'void mcuboot_status_change(mcuboot_status_type_t status)' where |
| 708 | 'mcuboot_status_type_t' is listed in |
| 709 | boot/bootutil/include/bootutil/mcuboot_status.h |
| 710 | |
Jamie McCrae | 24ac8cc | 2024-03-19 08:18:44 +0000 | [diff] [blame] | 711 | config BOOT_DISABLE_CACHES |
| 712 | bool "Disable I/D caches before chain-loading application" |
| 713 | depends on CPU_HAS_ICACHE || CPU_HAS_DCACHE |
| 714 | default y |
| 715 | help |
| 716 | Will flush and disable the instruction and data caches on the CPU prior to |
| 717 | booting an application, this is required on some ARM Cortex devices and |
| 718 | increases protection against data leakage from MCUboot to applications via |
| 719 | these caches. |
| 720 | |
Jamie McCrae | 1496129 | 2024-04-18 09:12:09 +0100 | [diff] [blame] | 721 | config MCUBOOT_BOOT_BANNER |
| 722 | bool "Use MCUboot boot banner" |
| 723 | depends on BOOT_BANNER |
| 724 | depends on "$(APP_VERSION_EXTENDED_STRING)" != "" |
| 725 | default y |
| 726 | help |
| 727 | Uses a MCUboot boot banner instead of the default zephyr one, which will output the |
| 728 | MCUboot name and version, followed by the zephyr name and version. |
| 729 | |
| 730 | For example: |
| 731 | |
| 732 | *** Booting MCUboot v2.0.0-72-g8c0e36c88663 *** |
| 733 | *** Using Zephyr OS build v3.6.0-2607-gd0be2010c31f *** |
| 734 | |
| 735 | config BOOT_BANNER_STRING |
| 736 | default "Using Zephyr OS build" if MCUBOOT_BOOT_BANNER |
| 737 | |
Jamie McCrae | 0c1ddf7 | 2024-08-23 08:13:00 +0100 | [diff] [blame] | 738 | config BOOT_DECOMPRESSION_SUPPORT |
| 739 | bool |
| 740 | help |
| 741 | Hidden symbol which should be selected if a system provided decompression support. |
| 742 | |
| 743 | if BOOT_DECOMPRESSION_SUPPORT |
| 744 | |
| 745 | menuconfig BOOT_DECOMPRESSION |
| 746 | bool "Decompression" |
| 747 | help |
| 748 | If enabled, will include support for compressed images being loaded to the secondary slot |
| 749 | which then get decompressed into the primary slot. This mode allows the secondary slot to |
| 750 | be smaller than primary slot which otherwise would not be allowed. |
| 751 | |
| 752 | if BOOT_DECOMPRESSION |
| 753 | |
| 754 | config BOOT_DECOMPRESSION_BUFFER_SIZE |
| 755 | int "Write buffer size" |
| 756 | range 16 16384 |
| 757 | default 4096 |
| 758 | help |
| 759 | The size of a secondary buffer used for writing decompressed data to the storage device. |
| 760 | |
| 761 | endif # BOOT_DECOMPRESSION |
| 762 | |
| 763 | endif # BOOT_DECOMPRESSION_SUPPORT |
| 764 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 765 | endmenu |
| 766 | |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 767 | config MCUBOOT_DEVICE_SETTINGS |
| 768 | # Hidden selector for device-specific settings |
| 769 | bool |
| 770 | default y |
| 771 | # CPU options |
| 772 | select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0 |
Carles Cufi | 67c792e | 2018-01-29 15:14:31 +0100 | [diff] [blame] | 773 | # Enable flash page layout if available |
| 774 | select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT |
Andrzej Puzdrowski | b788c71 | 2018-04-12 12:42:49 +0200 | [diff] [blame] | 775 | # Enable flash_map module as flash I/O back-end |
| 776 | select FLASH_MAP |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 777 | |
| 778 | config MCUBOOT_DEVICE_CPU_CORTEX_M0 |
| 779 | # Hidden selector for Cortex-M0 settings |
| 780 | bool |
| 781 | default n |
| 782 | select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP |
| 783 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 784 | comment "Zephyr configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 785 | |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 786 | # Disabling MULTITHREADING provides a code size advantage, but |
| 787 | # it requires peripheral drivers (particularly a flash driver) |
| 788 | # that works properly with the option enabled. |
| 789 | # |
| 790 | # If you know for sure that your hardware will work, you can default |
| 791 | # it to n here. Otherwise, having it on by default makes the most |
| 792 | # hardware work. |
| 793 | config MULTITHREADING |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 794 | default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING |
Josh Gao | 837cf88 | 2020-11-13 18:51:27 -0800 | [diff] [blame] | 795 | default y if BOOT_USB_DFU_GPIO || BOOT_USB_DFU_WAIT |
Jamie McCrae | 8b4c70a | 2024-03-07 07:51:55 +0000 | [diff] [blame] | 796 | default n if SOC_FAMILY_NORDIC_NRF |
Sylvio Alves | b794d33 | 2024-03-04 10:08:30 -0300 | [diff] [blame] | 797 | default n if SOC_FAMILY_ESPRESSIF_ESP32 && MCUBOOT |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 798 | default y |
| 799 | |
Andrzej Puzdrowski | 3f092bd | 2020-02-17 13:25:32 +0100 | [diff] [blame] | 800 | config LOG_PROCESS_THREAD |
| 801 | default n # mcuboot has its own log processing thread |
| 802 | |
| 803 | # override USB device name |
| 804 | config USB_DEVICE_PRODUCT |
| 805 | default "MCUBOOT" |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 806 | |
Andrzej Puzdrowski | f573b39 | 2020-11-10 14:35:15 +0100 | [diff] [blame] | 807 | # use MCUboot's own log configuration |
| 808 | config MCUBOOT_BOOTUTIL_LIB_OWN_LOG |
| 809 | bool |
| 810 | default n |
| 811 | |
Håkon Øye Amundsen | e829e9d | 2021-11-12 14:01:01 +0000 | [diff] [blame] | 812 | config MCUBOOT_VERIFY_IMG_ADDRESS |
| 813 | bool "Verify reset address of image in secondary slot" |
| 814 | depends on UPDATEABLE_IMAGE_NUMBER > 1 |
| 815 | depends on !BOOT_ENCRYPT_IMAGE |
| 816 | depends on ARM |
| 817 | default y if BOOT_UPGRADE_ONLY |
| 818 | help |
| 819 | Verify that the reset address in the image located in the secondary slot |
| 820 | is contained within the corresponding primary slot. This is recommended |
| 821 | if swapping is not used (that is, BOOT_UPGRADE_ONLY is set). If a user |
| 822 | incorrectly uploads an update for image 1 to image 0's secondary slot |
| 823 | MCUboot will overwrite image 0's primary slot with this image even |
| 824 | though it will not boot. If swapping is enabled this will be handled |
| 825 | since the image will not confirm itself. If, however, swapping is not |
| 826 | enabled then the only mitigation is serial recovery. This feature can |
| 827 | also be useful when BOOT_DIRECT_XIP is enabled, to ensure that the image |
| 828 | linked at the correct address is loaded. |
| 829 | |
Robert Lubos | 1b19d2a | 2020-01-31 14:05:35 +0100 | [diff] [blame] | 830 | source "Kconfig.zephyr" |