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 | |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 61 | config SINGLE_IMAGE_DFU |
| 62 | bool "Single image application" |
| 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 |
| 96 | config BOOT_ECDSA_TINYCRYPT |
Sigvart Hovland | ebd0503 | 2019-03-21 10:47:32 +0100 | [diff] [blame] | 97 | bool "Use tinycrypt" |
| 98 | select BOOT_USE_TINYCRYPT |
| 99 | config BOOT_CC310 |
| 100 | bool "Use CC310" |
| 101 | select BOOT_USE_NRF_CC310_BL if HAS_HW_NRF_CC310 |
| 102 | select NRF_CC310_BL if HAS_HW_NRF_CC310 |
| 103 | select NRFXLIB_CRYPTO if SOC_FAMILY_NRF |
| 104 | select BOOT_USE_CC310 |
| 105 | endchoice |
| 106 | endif |
Fabio Utzig | 34e93a5 | 2020-02-03 09:59:53 -0300 | [diff] [blame] | 107 | |
| 108 | config BOOT_SIGNATURE_TYPE_ED25519 |
| 109 | bool "Edwards curve digital signatures using ed25519" |
| 110 | |
| 111 | if BOOT_SIGNATURE_TYPE_ED25519 |
| 112 | choice |
| 113 | prompt "Ecdsa implementation" |
| 114 | default BOOT_ED25519_TINYCRYPT |
| 115 | config BOOT_ED25519_TINYCRYPT |
| 116 | bool "Use tinycrypt" |
| 117 | select BOOT_USE_TINYCRYPT |
| 118 | config BOOT_ED25519_MBEDTLS |
| 119 | bool "Use mbedTLS" |
| 120 | select BOOT_USE_MBEDTLS |
| 121 | select MBEDTLS |
| 122 | endchoice |
| 123 | endif |
| 124 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 125 | endchoice |
| 126 | |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 127 | config BOOT_SIGNATURE_KEY_FILE |
| 128 | string "PEM key file" |
| 129 | default "" |
| 130 | help |
Marek Pieta | bdcfc85 | 2020-08-04 02:22:55 -0700 | [diff] [blame^] | 131 | You can use either absolute or relative path. |
| 132 | In case relative path is used, the build system assumes that it starts |
| 133 | from the directory where the MCUBoot KConfig configuration file is |
| 134 | located. If the key file is not there, the build system uses relative |
| 135 | path that starts from the MCUBoot repository root directory. |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 136 | The key file will be parsed by imgtool's getpub command and a .c source |
| 137 | with the public key information will be written in a format expected by |
| 138 | MCUboot. |
| 139 | |
Andrzej Puzdrowski | 9a605b6 | 2020-03-16 13:34:30 +0100 | [diff] [blame] | 140 | config MCUBOOT_CLEANUP_ARM_CORE |
| 141 | bool "Perform core cleanup before chain-load the application" |
| 142 | depends on CPU_CORTEX_M |
| 143 | default y |
| 144 | |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 145 | config MBEDTLS_CFG_FILE |
| 146 | default "mcuboot-mbedtls-cfg.h" |
| 147 | |
David Vincze | 03368b8 | 2020-04-01 12:53:53 +0200 | [diff] [blame] | 148 | config BOOT_HW_KEY |
| 149 | bool "Use HW key for image verification" |
| 150 | default n |
| 151 | help |
| 152 | Use HW key for image verification, otherwise the public key is embedded |
| 153 | in MCUBoot. If enabled the public key is appended to the signed image |
| 154 | and requires the hash of the public key to be provisioned to the device |
| 155 | beforehand. |
| 156 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 157 | config BOOT_VALIDATE_SLOT0 |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 158 | bool "Validate image in the primary slot on every boot" |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 159 | default y |
| 160 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 161 | If y, the bootloader attempts to validate the signature of the |
| 162 | primary slot every boot. This adds the signature check time to |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 163 | every boot, but can mitigate against some changes that are |
| 164 | able to modify the flash image itself. |
| 165 | |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 166 | if !SINGLE_IMAGE_DFU |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 167 | config BOOT_UPGRADE_ONLY |
| 168 | bool "Overwrite image updates instead of swapping" |
| 169 | default n |
| 170 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 171 | If y, overwrite the primary slot with the upgrade image instead |
| 172 | of swapping them. This prevents the fallback recovery, but |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 173 | uses a much simpler code path. |
| 174 | |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 175 | config BOOT_SWAP_USING_MOVE |
Fabio Utzig | dd2b680 | 2020-01-06 09:10:45 -0300 | [diff] [blame] | 176 | bool "Swap mode that can run without a scratch partition" |
Håkon Øye Amundsen | 09be783 | 2020-01-24 14:34:49 +0000 | [diff] [blame] | 177 | default y if SOC_FAMILY_NRF |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 178 | default n |
| 179 | help |
| 180 | If y, the swap upgrade is done in two steps, where first every |
| 181 | sector of the primary slot is moved up one sector, then for |
| 182 | each sector X in the secondary slot, it is moved to index X in |
| 183 | the primary slot, then the sector at X+1 in the primary is |
| 184 | moved to index X in the secondary. |
| 185 | This allows a swap upgrade without using a scratch partition, |
| 186 | but is currently limited to all sectors in both slots being of |
| 187 | the same size. |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 188 | endif |
Fabio Utzig | c58842e | 2019-11-28 10:30:01 -0300 | [diff] [blame] | 189 | |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 190 | if !SINGLE_IMAGE_DFU |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 191 | config BOOT_BOOTSTRAP |
Sam Bristow | d0ca0ff | 2019-10-30 20:51:35 +1300 | [diff] [blame] | 192 | bool "Bootstrap erased the primary slot from the secondary slot" |
Fabio Utzig | d0533ed | 2018-12-19 07:56:33 -0200 | [diff] [blame] | 193 | default n |
| 194 | help |
| 195 | If y, enables bootstraping support. Bootstrapping allows an erased |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 196 | 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] | 197 | If unsure, leave at the default value. |
| 198 | |
Fabio Utzig | ca8ead2 | 2019-12-20 07:06:04 -0300 | [diff] [blame] | 199 | config BOOT_SWAP_SAVE_ENCTLV |
| 200 | bool "Save encrypted key TLVs instead of plaintext keys in swap metadata" |
| 201 | default n |
| 202 | help |
| 203 | If y, instead of saving the encrypted image keys in plaintext in the |
| 204 | swap resume metadata, save the encrypted image TLVs. This should be used |
| 205 | when there is no security mechanism protecting the data in the primary |
| 206 | slot from being dumped. If n is selected (default), the keys are written |
| 207 | after being decrypted from the image TLVs and could be read by an |
| 208 | attacker who has access to the flash contents of the primary slot (eg |
| 209 | JTAG/SWD or primary slot in external flash). |
| 210 | If unsure, leave at the default value. |
| 211 | |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 212 | config BOOT_ENCRYPT_RSA |
Fabio Utzig | 42cc29a | 2019-11-05 07:54:41 -0300 | [diff] [blame] | 213 | bool "Support for encrypted upgrade images using RSA" |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 214 | default n |
| 215 | help |
David Vincze | 2d736ad | 2019-02-18 11:50:22 +0100 | [diff] [blame] | 216 | If y, images in the secondary slot can be encrypted and are decrypted |
| 217 | 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] | 218 | back when swapping from the primary slot to the secondary slot. The |
| 219 | encryption mechanism used in this case is RSA-OAEP (2048 bits). |
| 220 | |
| 221 | config BOOT_ENCRYPT_EC256 |
| 222 | bool "Support for encrypted upgrade images using ECIES-P256" |
| 223 | default n |
| 224 | help |
| 225 | If y, images in the secondary slot can be encrypted and are decrypted |
| 226 | on the fly when upgrading to the primary slot, as well as encrypted |
| 227 | back when swapping from the primary slot to the secondary slot. The |
| 228 | encryption mechanism used in this case is ECIES using primitives |
| 229 | described under "ECIES-P256 encryption" in docs/encrypted_images.md. |
Fabio Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 230 | |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 231 | config BOOT_ENCRYPT_X25519 |
| 232 | bool "Support for encrypted upgrade images using ECIES-X25519" |
| 233 | default n |
| 234 | help |
| 235 | If y, images in the secondary slot can be encrypted and are decrypted |
| 236 | on the fly when upgrading to the primary slot, as well as encrypted |
| 237 | back when swapping from the primary slot to the secondary slot. The |
| 238 | encryption mechanism used in this case is ECIES using primitives |
| 239 | described under "ECIES-X25519 encryption" in docs/encrypted_images.md. |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 240 | endif |
Fabio Utzig | b6f014c | 2020-04-02 13:25:01 -0300 | [diff] [blame] | 241 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 242 | config BOOT_MAX_IMG_SECTORS |
| 243 | int "Maximum number of sectors per image slot" |
| 244 | default 128 |
| 245 | help |
| 246 | This option controls the maximum number of sectors that each of |
| 247 | the two image areas can contain. Smaller values reduce MCUboot's |
| 248 | memory usage; larger values allow it to support larger images. |
| 249 | If unsure, leave at the default value. |
| 250 | |
Emanuele Di Santo | 205c8c6 | 2018-07-20 11:42:31 +0200 | [diff] [blame] | 251 | config BOOT_ERASE_PROGRESSIVELY |
| 252 | bool "Erase flash progressively when receiving new firmware" |
| 253 | default y if SOC_NRF52840 |
| 254 | help |
| 255 | If enabled, flash is erased as necessary when receiving new firmware, |
| 256 | instead of erasing the whole image slot at once. This is necessary |
| 257 | on some hardware that has long erase times, to prevent long wait |
| 258 | times at the beginning of the DFU process. |
| 259 | |
David Vincze | 1cf11b5 | 2020-03-24 07:51:09 +0100 | [diff] [blame] | 260 | config MEASURED_BOOT |
| 261 | bool "Store the boot state/measurements in shared memory" |
| 262 | default n |
| 263 | help |
| 264 | If enabled, the bootloader will store certain boot measurements such as |
| 265 | the hash of the firmware image in a shared memory area. This data can |
| 266 | be used later by runtime services (e.g. by a device attestation service). |
| 267 | |
| 268 | config BOOT_SHARE_DATA |
| 269 | bool "Save application specific data in shared memory area" |
| 270 | default n |
| 271 | |
Rajavardhan Gundi | 51c9d70 | 2019-02-20 14:08:52 +0530 | [diff] [blame] | 272 | config BOOT_WAIT_FOR_USB_DFU |
| 273 | bool "Wait for a prescribed duration to see if USB DFU is invoked" |
| 274 | default n |
| 275 | select USB |
| 276 | select USB_DFU_CLASS |
| 277 | select IMG_MANAGER |
| 278 | help |
| 279 | If y, MCUboot waits for a prescribed duration of time to allow |
| 280 | for USB DFU to be invoked. Please note DFU always updates the |
| 281 | slot1 image. |
| 282 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 283 | config ZEPHYR_TRY_MASS_ERASE |
| 284 | bool "Try to mass erase flash when flashing MCUboot image" |
| 285 | default y |
| 286 | help |
| 287 | If y, attempt to configure the Zephyr build system's "flash" |
| 288 | target to mass-erase the flash device before flashing the |
| 289 | MCUboot image. This ensures the scratch and other partitions |
| 290 | are in a consistent state. |
| 291 | |
| 292 | This is not available for all targets. |
| 293 | |
David Brown | f6d14c2 | 2019-12-10 15:36:36 -0700 | [diff] [blame] | 294 | config BOOT_USE_BENCH |
| 295 | bool "Enable benchmark code" |
| 296 | default n |
| 297 | help |
| 298 | If y, adds support for simple benchmarking that can record |
| 299 | time intervals between two calls. The time printed depends |
| 300 | on the particular Zephyr target, and is generally ticks of a |
| 301 | specific board-specific timer. |
| 302 | |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 303 | module = MCUBOOT |
Piotr Mienkowski | 15aa6ef | 2019-04-08 22:48:15 +0200 | [diff] [blame] | 304 | module-str = MCUBoot bootloader |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 305 | source "subsys/logging/Kconfig.template.log_config" |
Michael Scott | 74ceae5 | 2019-02-01 14:01:09 -0800 | [diff] [blame] | 306 | |
Andrzej Puzdrowski | af14853 | 2020-02-25 12:51:26 +0100 | [diff] [blame] | 307 | config MCUBOOT_LOG_THREAD_STACK_SIZE |
| 308 | int "Stack size for the MCUBoot log processing thread" |
| 309 | depends on LOG && !LOG_IMMEDIATE |
| 310 | default 2048 if COVERAGE_GCOV |
| 311 | default 1024 if NO_OPTIMIZATIONS |
| 312 | default 1024 if XTENSA |
| 313 | default 4096 if (X86 && X86_64) |
| 314 | default 4096 if ARM64 |
| 315 | default 768 |
| 316 | help |
| 317 | Set the internal stack size for MCUBoot log processing thread. |
| 318 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 319 | menuconfig MCUBOOT_SERIAL |
| 320 | bool "MCUboot serial recovery" |
| 321 | default n |
| 322 | select REBOOT |
Emanuele Di Santo | 30a9265 | 2019-01-16 14:01:08 +0100 | [diff] [blame] | 323 | select GPIO |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 324 | select SERIAL |
Emanuele Di Santo | 30a9265 | 2019-01-16 14:01:08 +0100 | [diff] [blame] | 325 | select UART_INTERRUPT_DRIVEN |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 326 | select BASE64 |
| 327 | select TINYCBOR |
| 328 | help |
| 329 | If y, enables a serial-port based update mode. This allows |
| 330 | MCUboot itself to load update images into flash over a UART. |
| 331 | If unsure, leave at the default value. |
| 332 | |
| 333 | if MCUBOOT_SERIAL |
| 334 | |
Emanuele Di Santo | c4bf780 | 2018-07-20 11:39:57 +0200 | [diff] [blame] | 335 | choice |
| 336 | prompt "Serial device" |
Andrzej Puzdrowski | f4a9a9d | 2020-04-24 12:31:51 +0200 | [diff] [blame] | 337 | default BOOT_SERIAL_UART if !BOARD_NRF52840DONGLE_NRF52840 |
| 338 | default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840DONGLE_NRF52840 |
Emanuele Di Santo | c4bf780 | 2018-07-20 11:39:57 +0200 | [diff] [blame] | 339 | |
| 340 | config BOOT_SERIAL_UART |
| 341 | bool "UART" |
| 342 | # SERIAL and UART_INTERRUPT_DRIVEN already selected |
| 343 | |
| 344 | config BOOT_SERIAL_CDC_ACM |
| 345 | bool "CDC ACM" |
| 346 | select USB |
| 347 | select USB_DEVICE_STACK |
| 348 | select USB_CDC_ACM |
| 349 | |
| 350 | endchoice |
| 351 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 352 | config BOOT_MAX_LINE_INPUT_LEN |
| 353 | int "Maximum command line length" |
| 354 | default 512 |
| 355 | help |
| 356 | Maximum length of commands transported over the serial port. |
| 357 | |
| 358 | config BOOT_SERIAL_DETECT_PORT |
| 359 | string "GPIO device to trigger serial recovery mode" |
| 360 | default GPIO_0 if SOC_FAMILY_NRF |
| 361 | help |
| 362 | Zephyr GPIO device which contains the pin used to trigger |
| 363 | serial recovery mode. |
| 364 | |
| 365 | config BOOT_SERIAL_DETECT_PIN |
| 366 | int "Pin to trigger serial recovery mode" |
Andrzej Puzdrowski | f4a9a9d | 2020-04-24 12:31:51 +0200 | [diff] [blame] | 367 | default 6 if BOARD_NRF9160DK_NRF9160 |
Andrzej Puzdrowski | fefdea2 | 2020-03-27 09:41:14 +0100 | [diff] [blame] | 368 | default 11 if BOARD_NRF52840DK_NRF52840 |
Andrzej Puzdrowski | f4a9a9d | 2020-04-24 12:31:51 +0200 | [diff] [blame] | 369 | default 13 if BOARD_NRF52DK_NRF52832 |
Håkon Øye Amundsen | 6fc2595 | 2020-01-02 15:15:42 +0000 | [diff] [blame] | 370 | default 23 if BOARD_NRF5340_DK_NRF5340_CPUAPP || BOARD_NRF5340_DK_NRF5340_CPUAPPNS |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 371 | help |
| 372 | Pin on the serial detect port which triggers serial recovery mode. |
| 373 | |
| 374 | config BOOT_SERIAL_DETECT_PIN_VAL |
| 375 | int "Serial detect pin trigger value" |
| 376 | default 0 |
| 377 | range 0 1 |
| 378 | help |
| 379 | Logic value of the detect pin which triggers serial recovery |
| 380 | mode. |
| 381 | |
Andrzej Puzdrowski | f000480 | 2019-10-01 14:13:35 +0200 | [diff] [blame] | 382 | # Workaround for not being able to have commas in macro arguments |
| 383 | DT_CHOSEN_Z_CONSOLE := zephyr,console |
| 384 | |
| 385 | config RECOVERY_UART_DEV_NAME |
| 386 | string "UART Device Name for Recovery UART" |
| 387 | default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))" if HAS_DTS |
| 388 | default "UART_0" |
| 389 | depends on BOOT_SERIAL_UART |
| 390 | help |
| 391 | This option specifies the name of UART device to be used for |
| 392 | serial recovery. |
| 393 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 394 | endif # MCUBOOT_SERIAL |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 395 | |
Rafał Kuźnia | d854bb6 | 2020-06-17 15:06:47 +0200 | [diff] [blame] | 396 | config BOOT_INTR_VEC_RELOC |
| 397 | bool "Relocate the interrupt vector to the application" |
| 398 | default n |
| 399 | depends on SW_VECTOR_RELAY || CPU_CORTEX_M_HAS_VTOR |
| 400 | help |
| 401 | Relocate the interrupt vector to the application before it is started. |
| 402 | Select this option if application requires vector relocation, |
| 403 | but it doesn't relocate vector in its reset handler. |
| 404 | |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 405 | config UPDATEABLE_IMAGE_NUMBER |
| 406 | int "Number of updateable images" |
| 407 | default 1 |
Dominik Ermel | 4dc3f44 | 2020-05-26 08:45:14 +0000 | [diff] [blame] | 408 | range 1 1 if SINGLE_IMAGE_DFU |
Andrzej Puzdrowski | 16b6d15 | 2020-06-01 14:16:54 +0200 | [diff] [blame] | 409 | help |
| 410 | Enables support of multi image update. |
| 411 | |
| 412 | choice |
| 413 | prompt "Downgrade prevention" |
| 414 | optional |
| 415 | |
| 416 | config MCUBOOT_DOWNGRADE_PREVENTION |
| 417 | bool "SW based downgrade prevention" |
| 418 | depends on BOOT_UPGRADE_ONLY |
| 419 | help |
| 420 | Prevent downgrades by enforcing incrementing version numbers. |
| 421 | When this option is set, any upgrade must have greater major version |
| 422 | or greater minor version with equal major version. This mechanism |
| 423 | only protects against some attacks against version downgrades (for |
| 424 | example, a JTAG could be used to write an older version). |
| 425 | |
| 426 | config MCUBOOT_HW_DOWNGRADE_PREVENTION |
| 427 | bool "HW based downgrade prevention" |
| 428 | help |
| 429 | Prevent undesirable/malicious software downgrades. When this option is |
| 430 | set, any upgrade must have greater or equal security counter value. |
| 431 | Because of the acceptance of equal values it allows for software |
| 432 | downgrade to some extent. |
| 433 | |
| 434 | endchoice |
| 435 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 436 | endmenu |
| 437 | |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 438 | config MCUBOOT_DEVICE_SETTINGS |
| 439 | # Hidden selector for device-specific settings |
| 440 | bool |
| 441 | default y |
| 442 | # CPU options |
| 443 | select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0 |
Carles Cufi | 67c792e | 2018-01-29 15:14:31 +0100 | [diff] [blame] | 444 | # Enable flash page layout if available |
| 445 | select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT |
Andrzej Puzdrowski | b788c71 | 2018-04-12 12:42:49 +0200 | [diff] [blame] | 446 | # Enable flash_map module as flash I/O back-end |
| 447 | select FLASH_MAP |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 448 | |
| 449 | config MCUBOOT_DEVICE_CPU_CORTEX_M0 |
| 450 | # Hidden selector for Cortex-M0 settings |
| 451 | bool |
| 452 | default n |
| 453 | select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP |
| 454 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 455 | comment "Zephyr configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 456 | |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 457 | # Disabling MULTITHREADING provides a code size advantage, but |
| 458 | # it requires peripheral drivers (particularly a flash driver) |
| 459 | # that works properly with the option enabled. |
| 460 | # |
| 461 | # If you know for sure that your hardware will work, you can default |
| 462 | # it to n here. Otherwise, having it on by default makes the most |
| 463 | # hardware work. |
| 464 | config MULTITHREADING |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 465 | default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING |
Marti Bolivar | f84cc4b | 2019-08-20 16:06:56 -0700 | [diff] [blame] | 466 | default n if SOC_FAMILY_NRF |
| 467 | default y |
| 468 | |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 469 | config LOG_IMMEDIATE |
| 470 | default n if MULTITHREADING |
Andrzej Puzdrowski | 3f092bd | 2020-02-17 13:25:32 +0100 | [diff] [blame] | 471 | default y |
| 472 | |
| 473 | config LOG_PROCESS_THREAD |
| 474 | default n # mcuboot has its own log processing thread |
| 475 | |
| 476 | # override USB device name |
| 477 | config USB_DEVICE_PRODUCT |
| 478 | default "MCUBOOT" |
Andrzej Puzdrowski | 9a4946c | 2020-02-20 12:39:12 +0100 | [diff] [blame] | 479 | |
Robert Lubos | 1b19d2a | 2020-01-31 14:05:35 +0100 | [diff] [blame] | 480 | source "Kconfig.zephyr" |