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 |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 17 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 18 | config BOOT_USE_MBEDTLS |
| 19 | bool |
| 20 | # Hidden option |
| 21 | default n |
| 22 | help |
| 23 | Use mbedTLS for crypto primitives. |
| 24 | |
| 25 | config BOOT_USE_TINYCRYPT |
| 26 | bool |
| 27 | # Hidden option |
| 28 | default n |
Sebastian Bøe | 913a385 | 2019-01-22 13:53:12 +0100 | [diff] [blame] | 29 | # When building for ECDSA, we use our own copy of mbedTLS, so the |
| 30 | # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros |
| 31 | # will collide. |
| 32 | depends on ! MBEDTLS |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 33 | help |
| 34 | Use TinyCrypt for crypto primitives. |
| 35 | |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 36 | config BOOT_USE_CC310 |
| 37 | bool |
| 38 | # Hidden option |
| 39 | default n |
| 40 | # When building for ECDSA, we use our own copy of mbedTLS, so the |
| 41 | # Zephyr one must not be enabled or the MBEDTLS_CONFIG_FILE macros |
| 42 | # will collide. |
| 43 | depends on ! MBEDTLS |
| 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 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 69 | choice |
| 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 |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 81 | |
Fabio Utzig | 105b59a | 2019-05-13 15:08:12 -0700 | [diff] [blame] | 82 | if BOOT_SIGNATURE_TYPE_RSA |
| 83 | config BOOT_SIGNATURE_TYPE_RSA_LEN |
| 84 | int "RSA signature length" |
| 85 | range 2048 3072 |
| 86 | default 2048 |
| 87 | endif |
| 88 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 89 | config BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 90 | bool "Elliptic curve digital signatures with curve P-256" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 91 | |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 92 | if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 93 | choice |
| 94 | prompt "Ecdsa implementation" |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 95 | default BOOT_ECDSA_TINYCRYPT |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 96 | |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 97 | config BOOT_ECDSA_TINYCRYPT |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 98 | bool "Use tinycrypt" |
| 99 | select BOOT_USE_TINYCRYPT |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 100 | |
| 101 | config BOOT_ECDSA_CC310 |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 102 | bool "Use CC310" |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 103 | depends on HAS_HW_NRF_CC310 |
| 104 | select BOOT_USE_NRF_CC310_BL |
| 105 | select NRF_CC310_BL |
| 106 | select NRFXLIB_CRYPTO |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 107 | select BOOT_USE_CC310 |
Håkon Øye Amundsen | ee7282d | 2020-09-28 09:48:29 +0000 | [diff] [blame] | 108 | endchoice # Ecdsa implementation |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 109 | endif |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 110 | |
| 111 | config BOOT_SIGNATURE_TYPE_ED25519 |
| 112 | bool "Edwards curve digital signatures using ed25519" |
| 113 | |
| 114 | if BOOT_SIGNATURE_TYPE_ED25519 |
| 115 | choice |
| 116 | prompt "Ecdsa implementation" |
| 117 | default BOOT_ED25519_TINYCRYPT |
| 118 | config BOOT_ED25519_TINYCRYPT |
| 119 | bool "Use tinycrypt" |
| 120 | select BOOT_USE_TINYCRYPT |
| 121 | config BOOT_ED25519_MBEDTLS |
| 122 | bool "Use mbedTLS" |
| 123 | select BOOT_USE_MBEDTLS |
| 124 | select MBEDTLS |
| 125 | endchoice |
| 126 | endif |
| 127 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 128 | endchoice |
| 129 | |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 130 | config BOOT_SIGNATURE_KEY_FILE |
| 131 | string "PEM key file" |
Håkon Øye Amundsen | 705c6c2 | 2020-09-28 09:45:40 +0000 | [diff] [blame] | 132 | default "root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 133 | default "root-ed25519.pem" if BOOT_SIGNATURE_TYPE_ED25519 |
| 134 | default "root-rsa-3072.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=3072 |
| 135 | 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] | 136 | default "" |
| 137 | help |
Marek Pieta | bdcfc85 | 2020-08-04 02:22:55 -0700 | [diff] [blame] | 138 | You can use either absolute or relative path. |
| 139 | In case relative path is used, the build system assumes that it starts |
| 140 | from the directory where the MCUBoot KConfig configuration file is |
| 141 | located. If the key file is not there, the build system uses relative |
| 142 | path that starts from the MCUBoot repository root directory. |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 143 | The key file will be parsed by imgtool's getpub command and a .c source |
| 144 | with the public key information will be written in a format expected by |
| 145 | MCUboot. |
| 146 | |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 147 | config MCUBOOT_CLEANUP_ARM_CORE |
| 148 | bool "Perform core cleanup before chain-load the application" |
| 149 | depends on CPU_CORTEX_M |
Ioannis Glaropoulos | 518d93a | 2020-10-22 14:22:14 +0200 | [diff] [blame] | 150 | default y if !ARCH_SUPPORTS_ARCH_HW_INIT |
| 151 | help |
| 152 | This option instructs MCUboot to perform a clean-up of a set of |
| 153 | architecture core HW registers before junping to the application |
| 154 | firmware. The clean-up sets these registers to their warm-reset |
| 155 | values as specified by the architecture. |
| 156 | |
| 157 | By default, this option is enabled only if the architecture does |
| 158 | not have the functionality to perform such a register clean-up |
| 159 | during application firmware boot. |
| 160 | |
| 161 | Zephyr applications on Cortex-M will perform this register clean-up |
| 162 | by default, if they are chain-loadable by MCUboot, so MCUboot does |
| 163 | not need to perform such a cleanup itself. |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 164 | |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 165 | config MBEDTLS_CFG_FILE |
| 166 | default "mcuboot-mbedtls-cfg.h" |
| 167 | |
David Vincze | 03368b8 | 2020-04-01 12:53:53 +0200 | [diff] [blame] | 168 | config BOOT_HW_KEY |
| 169 | bool "Use HW key for image verification" |
| 170 | default n |
| 171 | help |
| 172 | Use HW key for image verification, otherwise the public key is embedded |
| 173 | in MCUBoot. If enabled the public key is appended to the signed image |
| 174 | and requires the hash of the public key to be provisioned to the device |
| 175 | beforehand. |
| 176 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 177 | config BOOT_VALIDATE_SLOT0 |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 178 | bool "Validate image in the primary slot on every boot" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 179 | default y |
| 180 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 181 | If y, the bootloader attempts to validate the signature of the |
| 182 | primary slot every boot. This adds the signature check time to |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 183 | every boot, but can mitigate against some changes that are |
| 184 | able to modify the flash image itself. |
| 185 | |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 186 | if !SINGLE_APPLICATION_SLOT |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 187 | choice |
| 188 | prompt "Image upgrade modes" |
| 189 | default BOOT_SWAP_USING_MOVE if SOC_FAMILY_NRF |
| 190 | default BOOT_SWAP_USING_SCRATCH |
| 191 | |
| 192 | config BOOT_SWAP_USING_SCRATCH |
| 193 | bool "Swap mode that run with the scratch partition" |
| 194 | help |
| 195 | This is the most conservative swap mode but it can work even on |
| 196 | devices with heterogeneous flash page layout. |
| 197 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 198 | config BOOT_UPGRADE_ONLY |
| 199 | bool "Overwrite image updates instead of swapping" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 200 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 201 | If y, overwrite the primary slot with the upgrade image instead |
| 202 | of swapping them. This prevents the fallback recovery, but |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 203 | uses a much simpler code path. |
| 204 | |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 205 | config BOOT_SWAP_USING_MOVE |
Fabio Utzig | dd2b680 | 2020-01-06 09:10:45 -0300 | [diff] [blame] | 206 | bool "Swap mode that can run without a scratch partition" |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 207 | help |
| 208 | If y, the swap upgrade is done in two steps, where first every |
| 209 | sector of the primary slot is moved up one sector, then for |
| 210 | each sector X in the secondary slot, it is moved to index X in |
| 211 | the primary slot, then the sector at X+1 in the primary is |
| 212 | moved to index X in the secondary. |
| 213 | This allows a swap upgrade without using a scratch partition, |
| 214 | but is currently limited to all sectors in both slots being of |
| 215 | the same size. |
David Vincze | 5a6e181 | 2020-06-29 13:34:42 +0200 | [diff] [blame] | 216 | |
| 217 | config BOOT_DIRECT_XIP |
| 218 | bool "Run the latest image directly from its slot" |
| 219 | help |
| 220 | If y, mcuboot selects the newest valid image based on the image version |
| 221 | numbers, thereafter the selected image can run directly from its slot |
| 222 | without having to move/copy it into the primary slot. For this reason the |
| 223 | images must be linked to be executed from the given image slot. Using this |
| 224 | mode results in a simpler code path and smaller code size. |
| 225 | |
| 226 | endchoice |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 227 | |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 228 | config BOOT_DIRECT_XIP_REVERT |
| 229 | bool "Enable the revert mechanism in direct-xip mode" |
Andrzej Puzdrowski | 32342e7 | 2020-11-18 17:04:44 +0100 | [diff] [blame] | 230 | depends on BOOT_DIRECT_XIP |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 231 | default n |
| 232 | help |
| 233 | If y, enables the revert mechanism in direct-xip similar to the one in |
| 234 | swap mode. It requires the trailer magic to be added to the signed image. |
| 235 | When a reboot happens without the image being confirmed at runtime, the |
| 236 | bootloader considers the image faulty and erases it. After this it will |
| 237 | attempt to boot the previous image. The images can also be made permanent |
| 238 | (marked as confirmed in advance) just like in swap mode. |
| 239 | |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 240 | config BOOT_BOOTSTRAP |
Sam Bristow | d0ca0ff | 2019-10-30 20:51:35 +1300 | [diff] [blame] | 241 | bool "Bootstrap erased the primary slot from the secondary slot" |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 242 | default n |
| 243 | help |
| 244 | If y, enables bootstraping support. Bootstrapping allows an erased |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 245 | 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] | 246 | If unsure, leave at the default value. |
| 247 | |
Fabio Utzig | ca8ead2 | 2019-12-20 07:06:04 -0300 | [diff] [blame] | 248 | config BOOT_SWAP_SAVE_ENCTLV |
| 249 | bool "Save encrypted key TLVs instead of plaintext keys in swap metadata" |
| 250 | default n |
| 251 | help |
| 252 | If y, instead of saving the encrypted image keys in plaintext in the |
| 253 | swap resume metadata, save the encrypted image TLVs. This should be used |
| 254 | when there is no security mechanism protecting the data in the primary |
| 255 | slot from being dumped. If n is selected (default), the keys are written |
| 256 | after being decrypted from the image TLVs and could be read by an |
| 257 | attacker who has access to the flash contents of the primary slot (eg |
| 258 | JTAG/SWD or primary slot in external flash). |
| 259 | If unsure, leave at the default value. |
| 260 | |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 261 | config BOOT_ENCRYPT_RSA |
Fabio Utzig | 42cc29a | 2019-11-05 07:54:41 -0300 | [diff] [blame] | 262 | bool "Support for encrypted upgrade images using RSA" |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 263 | default n |
| 264 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 265 | If y, images in the secondary slot can be encrypted and are decrypted |
| 266 | on the fly when upgrading to the primary slot, as well as encrypted |
Fabio Utzig | 42cc29a | 2019-11-05 07:54:41 -0300 | [diff] [blame] | 267 | back when swapping from the primary slot to the secondary slot. The |
| 268 | encryption mechanism used in this case is RSA-OAEP (2048 bits). |
| 269 | |
| 270 | config BOOT_ENCRYPT_EC256 |
| 271 | bool "Support for encrypted upgrade images using ECIES-P256" |
| 272 | default n |
| 273 | help |
| 274 | If y, images in the secondary slot can be encrypted and are decrypted |
| 275 | on the fly when upgrading to the primary slot, as well as encrypted |
| 276 | back when swapping from the primary slot to the secondary slot. The |
| 277 | encryption mechanism used in this case is ECIES using primitives |
| 278 | described under "ECIES-P256 encryption" in docs/encrypted_images.md. |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 279 | |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 280 | config BOOT_ENCRYPT_X25519 |
| 281 | bool "Support for encrypted upgrade images using ECIES-X25519" |
| 282 | default n |
| 283 | help |
| 284 | If y, images in the secondary slot can be encrypted and are decrypted |
| 285 | on the fly when upgrading to the primary slot, as well as encrypted |
| 286 | back when swapping from the primary slot to the secondary slot. The |
| 287 | encryption mechanism used in this case is ECIES using primitives |
| 288 | described under "ECIES-X25519 encryption" in docs/encrypted_images.md. |
David Vincze | 505fba2 | 2020-10-22 13:53:29 +0200 | [diff] [blame] | 289 | endif # !SINGLE_APPLICATION_SLOT |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 290 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 291 | config BOOT_MAX_IMG_SECTORS |
| 292 | int "Maximum number of sectors per image slot" |
| 293 | default 128 |
| 294 | help |
| 295 | This option controls the maximum number of sectors that each of |
| 296 | the two image areas can contain. Smaller values reduce MCUboot's |
| 297 | memory usage; larger values allow it to support larger images. |
| 298 | If unsure, leave at the default value. |
| 299 | |
Emanuele Di Santo | 205c8c6 | 2018-07-20 11:42:31 +0200 | [diff] [blame] | 300 | config BOOT_ERASE_PROGRESSIVELY |
| 301 | bool "Erase flash progressively when receiving new firmware" |
Bernt Johan Damslora | a2fad12 | 2019-09-20 18:25:34 +0200 | [diff] [blame] | 302 | default y if SOC_FAMILY_NRF |
Emanuele Di Santo | 205c8c6 | 2018-07-20 11:42:31 +0200 | [diff] [blame] | 303 | help |
| 304 | If enabled, flash is erased as necessary when receiving new firmware, |
| 305 | instead of erasing the whole image slot at once. This is necessary |
| 306 | on some hardware that has long erase times, to prevent long wait |
| 307 | times at the beginning of the DFU process. |
| 308 | |
David Vincze | 1cf11b5 | 2020-03-24 07:51:09 +0100 | [diff] [blame] | 309 | config MEASURED_BOOT |
| 310 | bool "Store the boot state/measurements in shared memory" |
| 311 | default n |
| 312 | help |
| 313 | If enabled, the bootloader will store certain boot measurements such as |
| 314 | the hash of the firmware image in a shared memory area. This data can |
| 315 | be used later by runtime services (e.g. by a device attestation service). |
| 316 | |
| 317 | config BOOT_SHARE_DATA |
| 318 | bool "Save application specific data in shared memory area" |
| 319 | default n |
| 320 | |
Tamas Ban | fce8733 | 2020-07-10 12:40:11 +0100 | [diff] [blame] | 321 | choice |
| 322 | prompt "Fault injection hardening profile" |
| 323 | default BOOT_FIH_PROFILE_OFF |
| 324 | |
| 325 | config BOOT_FIH_PROFILE_OFF |
| 326 | bool "No hardening against hardware level fault injection" |
| 327 | help |
| 328 | No hardening in SW against hardware level fault injection: power or |
| 329 | clock glitching, etc. |
| 330 | |
| 331 | config BOOT_FIH_PROFILE_LOW |
| 332 | bool "Moderate level hardening against hardware level fault injection" |
| 333 | help |
| 334 | Moderate level hardening: Long global fail loop to avoid break out, |
| 335 | control flow integrity check to discover discrepancy in expected code |
| 336 | flow. |
| 337 | |
| 338 | config BOOT_FIH_PROFILE_MEDIUM |
| 339 | bool "Medium level hardening against hardware level fault injection" |
| 340 | help |
| 341 | Medium level hardening: Long global fail loop to avoid break out, |
| 342 | control flow integrity check to discover discrepancy in expected code |
| 343 | flow, double variables to discover register or memory corruption. |
| 344 | |
| 345 | config BOOT_FIH_PROFILE_HIGH |
| 346 | bool "Maximum level hardening against hardware level fault injection" |
| 347 | select MBEDTLS |
| 348 | help |
| 349 | Maximum level hardening: Long global fail loop to avoid break out, |
| 350 | control flow integrity check to discover discrepancy in expected code |
| 351 | flow, double variables to discover register or memory corruption, random |
| 352 | delays to make code execution less predictable. Random delays requires an |
| 353 | entropy source. |
| 354 | |
| 355 | endchoice |
| 356 | |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 357 | config BOOT_WAIT_FOR_USB_DFU |
| 358 | bool "Wait for a prescribed duration to see if USB DFU is invoked" |
| 359 | default n |
| 360 | select USB |
| 361 | select USB_DFU_CLASS |
| 362 | select IMG_MANAGER |
| 363 | help |
| 364 | If y, MCUboot waits for a prescribed duration of time to allow |
| 365 | for USB DFU to be invoked. Please note DFU always updates the |
| 366 | slot1 image. |
| 367 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 368 | config ZEPHYR_TRY_MASS_ERASE |
| 369 | bool "Try to mass erase flash when flashing MCUboot image" |
| 370 | default y |
| 371 | help |
| 372 | If y, attempt to configure the Zephyr build system's "flash" |
| 373 | target to mass-erase the flash device before flashing the |
| 374 | MCUboot image. This ensures the scratch and other partitions |
| 375 | are in a consistent state. |
| 376 | |
| 377 | This is not available for all targets. |
| 378 | |
David Brown | f6d14c2 | 2019-12-10 15:36:36 -0700 | [diff] [blame] | 379 | config BOOT_USE_BENCH |
| 380 | bool "Enable benchmark code" |
| 381 | default n |
| 382 | help |
| 383 | If y, adds support for simple benchmarking that can record |
| 384 | time intervals between two calls. The time printed depends |
| 385 | on the particular Zephyr target, and is generally ticks of a |
| 386 | specific board-specific timer. |
| 387 | |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 388 | module = MCUBOOT |
Piotr Mienkowski | 15aa6ef | 2019-04-08 22:48:15 +0200 | [diff] [blame] | 389 | module-str = MCUBoot bootloader |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 390 | source "subsys/logging/Kconfig.template.log_config" |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 391 | |
Andrzej Puzdrowski | af14853 | 2020-02-25 12:51:26 +0100 | [diff] [blame] | 392 | config MCUBOOT_LOG_THREAD_STACK_SIZE |
| 393 | int "Stack size for the MCUBoot log processing thread" |
| 394 | depends on LOG && !LOG_IMMEDIATE |
| 395 | default 2048 if COVERAGE_GCOV |
| 396 | default 1024 if NO_OPTIMIZATIONS |
| 397 | default 1024 if XTENSA |
| 398 | default 4096 if (X86 && X86_64) |
| 399 | default 4096 if ARM64 |
| 400 | default 768 |
| 401 | help |
| 402 | Set the internal stack size for MCUBoot log processing thread. |
| 403 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 404 | menuconfig MCUBOOT_SERIAL |
| 405 | bool "MCUboot serial recovery" |
| 406 | default n |
| 407 | select REBOOT |
Emanuele Di Santo | 30a9265 | 2019-01-16 14:01:08 +0100 | [diff] [blame] | 408 | select GPIO |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 409 | select SERIAL |
Emanuele Di Santo | 30a9265 | 2019-01-16 14:01:08 +0100 | [diff] [blame] | 410 | select UART_INTERRUPT_DRIVEN |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 411 | select BASE64 |
| 412 | select TINYCBOR |
| 413 | help |
| 414 | If y, enables a serial-port based update mode. This allows |
| 415 | MCUboot itself to load update images into flash over a UART. |
| 416 | If unsure, leave at the default value. |
| 417 | |
| 418 | if MCUBOOT_SERIAL |
| 419 | |
Emanuele Di Santo | c4bf780 | 2018-07-20 11:39:57 +0200 | [diff] [blame] | 420 | choice |
| 421 | prompt "Serial device" |
Andrzej Puzdrowski | f4a9a9d | 2020-04-24 12:31:51 +0200 | [diff] [blame] | 422 | default BOOT_SERIAL_UART if !BOARD_NRF52840DONGLE_NRF52840 |
| 423 | default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840DONGLE_NRF52840 |
Emanuele Di Santo | c4bf780 | 2018-07-20 11:39:57 +0200 | [diff] [blame] | 424 | |
| 425 | config BOOT_SERIAL_UART |
| 426 | bool "UART" |
| 427 | # SERIAL and UART_INTERRUPT_DRIVEN already selected |
| 428 | |
| 429 | config BOOT_SERIAL_CDC_ACM |
| 430 | bool "CDC ACM" |
| 431 | select USB |
| 432 | select USB_DEVICE_STACK |
| 433 | select USB_CDC_ACM |
| 434 | |
| 435 | endchoice |
| 436 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 437 | config BOOT_MAX_LINE_INPUT_LEN |
| 438 | int "Maximum command line length" |
| 439 | default 512 |
| 440 | help |
| 441 | Maximum length of commands transported over the serial port. |
| 442 | |
| 443 | config BOOT_SERIAL_DETECT_PORT |
| 444 | string "GPIO device to trigger serial recovery mode" |
| 445 | default GPIO_0 if SOC_FAMILY_NRF |
| 446 | help |
| 447 | Zephyr GPIO device which contains the pin used to trigger |
| 448 | serial recovery mode. |
| 449 | |
| 450 | config BOOT_SERIAL_DETECT_PIN |
| 451 | int "Pin to trigger serial recovery mode" |
Andrzej Puzdrowski | f4a9a9d | 2020-04-24 12:31:51 +0200 | [diff] [blame] | 452 | default 6 if BOARD_NRF9160DK_NRF9160 |
Andrzej Puzdrowski | fefdea2 | 2020-03-27 09:41:14 +0100 | [diff] [blame] | 453 | default 11 if BOARD_NRF52840DK_NRF52840 |
Andrzej Puzdrowski | f4a9a9d | 2020-04-24 12:31:51 +0200 | [diff] [blame] | 454 | default 13 if BOARD_NRF52DK_NRF52832 |
Ole Sæther | 83ec842 | 2020-11-25 13:26:21 +0100 | [diff] [blame^] | 455 | default 23 if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPPNS || \ |
| 456 | BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPPNS |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 457 | help |
| 458 | Pin on the serial detect port which triggers serial recovery mode. |
| 459 | |
| 460 | config BOOT_SERIAL_DETECT_PIN_VAL |
| 461 | int "Serial detect pin trigger value" |
| 462 | default 0 |
| 463 | range 0 1 |
| 464 | help |
| 465 | Logic value of the detect pin which triggers serial recovery |
| 466 | mode. |
| 467 | |
Andrzej Puzdrowski | f000480 | 2019-10-01 14:13:35 +0200 | [diff] [blame] | 468 | # Workaround for not being able to have commas in macro arguments |
| 469 | DT_CHOSEN_Z_CONSOLE := zephyr,console |
| 470 | |
| 471 | config RECOVERY_UART_DEV_NAME |
| 472 | string "UART Device Name for Recovery UART" |
| 473 | default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))" if HAS_DTS |
| 474 | default "UART_0" |
| 475 | depends on BOOT_SERIAL_UART |
| 476 | help |
| 477 | This option specifies the name of UART device to be used for |
| 478 | serial recovery. |
| 479 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 480 | endif # MCUBOOT_SERIAL |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 481 | |
Rafał Kuźnia | d854bb6 | 2020-06-17 15:06:47 +0200 | [diff] [blame] | 482 | config BOOT_INTR_VEC_RELOC |
| 483 | bool "Relocate the interrupt vector to the application" |
| 484 | default n |
| 485 | depends on SW_VECTOR_RELAY || CPU_CORTEX_M_HAS_VTOR |
| 486 | help |
| 487 | Relocate the interrupt vector to the application before it is started. |
| 488 | Select this option if application requires vector relocation, |
| 489 | but it doesn't relocate vector in its reset handler. |
| 490 | |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 491 | config UPDATEABLE_IMAGE_NUMBER |
| 492 | int "Number of updateable images" |
| 493 | default 1 |
Andrzej Puzdrowski | fdff3e1 | 2020-09-15 08:23:25 +0200 | [diff] [blame] | 494 | range 1 1 if SINGLE_APPLICATION_SLOT |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 495 | help |
| 496 | Enables support of multi image update. |
| 497 | |
| 498 | choice |
| 499 | prompt "Downgrade prevention" |
| 500 | optional |
| 501 | |
| 502 | config MCUBOOT_DOWNGRADE_PREVENTION |
| 503 | bool "SW based downgrade prevention" |
| 504 | depends on BOOT_UPGRADE_ONLY |
| 505 | help |
| 506 | Prevent downgrades by enforcing incrementing version numbers. |
| 507 | When this option is set, any upgrade must have greater major version |
| 508 | or greater minor version with equal major version. This mechanism |
| 509 | only protects against some attacks against version downgrades (for |
| 510 | example, a JTAG could be used to write an older version). |
| 511 | |
| 512 | config MCUBOOT_HW_DOWNGRADE_PREVENTION |
| 513 | bool "HW based downgrade prevention" |
| 514 | help |
| 515 | Prevent undesirable/malicious software downgrades. When this option is |
| 516 | set, any upgrade must have greater or equal security counter value. |
| 517 | Because of the acceptance of equal values it allows for software |
| 518 | downgrade to some extent. |
| 519 | |
| 520 | endchoice |
| 521 | |
Andrzej Puzdrowski | d21442a | 2020-10-12 16:47:28 +0200 | [diff] [blame] | 522 | config BOOT_WATCHDOG_FEED |
| 523 | bool "Feed the watchdog while doing swap" |
| 524 | default y if SOC_FAMILY_NRF |
| 525 | imply NRFX_WDT |
| 526 | imply NRFX_WDT0 |
| 527 | imply NRFX_WDT1 |
| 528 | help |
| 529 | Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is |
| 530 | used to feed watchdog while doing time consuming operations. |
| 531 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 532 | endmenu |
| 533 | |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 534 | config MCUBOOT_DEVICE_SETTINGS |
| 535 | # Hidden selector for device-specific settings |
| 536 | bool |
| 537 | default y |
| 538 | # CPU options |
| 539 | select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0 |
Carles Cufi | 67c792e | 2018-01-29 15:14:31 +0100 | [diff] [blame] | 540 | # Enable flash page layout if available |
| 541 | select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT |
Andrzej Puzdrowski | b788c71 | 2018-04-12 12:42:49 +0200 | [diff] [blame] | 542 | # Enable flash_map module as flash I/O back-end |
| 543 | select FLASH_MAP |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 544 | |
| 545 | config MCUBOOT_DEVICE_CPU_CORTEX_M0 |
| 546 | # Hidden selector for Cortex-M0 settings |
| 547 | bool |
| 548 | default n |
| 549 | select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP |
| 550 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 551 | comment "Zephyr configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 552 | |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 553 | # Disabling MULTITHREADING provides a code size advantage, but |
| 554 | # it requires peripheral drivers (particularly a flash driver) |
| 555 | # that works properly with the option enabled. |
| 556 | # |
| 557 | # If you know for sure that your hardware will work, you can default |
| 558 | # it to n here. Otherwise, having it on by default makes the most |
| 559 | # hardware work. |
| 560 | config MULTITHREADING |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 561 | default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 562 | default n if SOC_FAMILY_NRF |
| 563 | default y |
| 564 | |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 565 | config LOG_IMMEDIATE |
| 566 | default n if MULTITHREADING |
Andrzej Puzdrowski | 3f092bd | 2020-02-17 13:25:32 +0100 | [diff] [blame] | 567 | default y |
| 568 | |
| 569 | config LOG_PROCESS_THREAD |
| 570 | default n # mcuboot has its own log processing thread |
| 571 | |
| 572 | # override USB device name |
| 573 | config USB_DEVICE_PRODUCT |
| 574 | default "MCUBOOT" |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 575 | |
Robert Lubos | 1b19d2a | 2020-01-31 14:05:35 +0100 | [diff] [blame] | 576 | source "Kconfig.zephyr" |