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