blob: 1386f5e8b61ed95e0c3ba7fe254d8c8566f6d757 [file] [log] [blame]
David Vincze03368b82020-04-01 12:53:53 +02001# Copyright (c) 2017-2020 Linaro Limited
David Vinczec3084132020-02-18 14:50:47 +01002# Copyright (c) 2020 Arm Limited
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02003#
4# SPDX-License-Identifier: Apache-2.0
5#
6
Marti Bolivar0e091c92018-04-12 11:23:16 -04007mainmenu "MCUboot configuration"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02008
Marti Bolivar0e091c92018-04-12 11:23:16 -04009comment "MCUboot-specific configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +020010
Emanuele Di Santo865777d2018-11-08 11:28:15 +010011# Hidden option to mark a project as MCUboot
12config MCUBOOT
13 default y
14 bool
Rajavardhan Gundi07ba28f2018-12-10 15:44:48 +053015 select MPU_ALLOW_FLASH_WRITE if ARM_MPU
Marcin Niestrojc6be76a2020-03-22 14:39:35 +010016 select USE_DT_CODE_PARTITION if HAS_FLASH_LOAD_OFFSET
Emanuele Di Santo865777d2018-11-08 11:28:15 +010017
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040018config BOOT_USE_MBEDTLS
19 bool
20 # Hidden option
21 default n
22 help
23 Use mbedTLS for crypto primitives.
24
25config BOOT_USE_TINYCRYPT
26 bool
27 # Hidden option
28 default n
Sebastian Bøe913a3852019-01-22 13:53:12 +010029 # 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 Bolivarbc2fa4e2018-04-12 12:18:32 -040033 help
34 Use TinyCrypt for crypto primitives.
35
Sigvart Hovlandebd05032019-03-21 10:47:32 +010036config 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
47config BOOT_USE_NRF_CC310_BL
48 bool
49 default n
50
51config NRFXLIB_CRYPTO
52 bool
53 default n
54
55config NRF_CC310_BL
56 bool
57 default n
58
Andrzej Puzdrowski97543282018-04-12 15:16:56 +020059menu "MCUBoot settings"
60
Andrzej Puzdrowskifdff3e12020-09-15 08:23:25 +020061config SINGLE_APPLICATION_SLOT
62 bool "Single slot bootloader"
Dominik Ermel4dc3f442020-05-26 08:45:14 +000063 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 Bolivarbc2fa4e2018-04-12 12:18:32 -040069choice
70 prompt "Signature type"
71 default BOOT_SIGNATURE_TYPE_RSA
72
Arvin Farahmandfb5ec182020-05-05 11:44:12 -040073config BOOT_SIGNATURE_TYPE_NONE
74 bool "No signature; use only hash check"
75 select BOOT_USE_TINYCRYPT
76
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040077config BOOT_SIGNATURE_TYPE_RSA
78 bool "RSA signatures"
79 select BOOT_USE_MBEDTLS
Marti Bolivara4818a52018-04-12 13:02:38 -040080 select MBEDTLS
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040081
Fabio Utzig105b59a2019-05-13 15:08:12 -070082if BOOT_SIGNATURE_TYPE_RSA
83config BOOT_SIGNATURE_TYPE_RSA_LEN
84 int "RSA signature length"
85 range 2048 3072
86 default 2048
87endif
88
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040089config BOOT_SIGNATURE_TYPE_ECDSA_P256
90 bool "Elliptic curve digital signatures with curve P-256"
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040091
Sigvart Hovlandebd05032019-03-21 10:47:32 +010092if BOOT_SIGNATURE_TYPE_ECDSA_P256
93choice
94 prompt "Ecdsa implementation"
Fabio Utzig34e93a52020-02-03 09:59:53 -030095 default BOOT_ECDSA_TINYCRYPT
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +000096
Fabio Utzig34e93a52020-02-03 09:59:53 -030097config BOOT_ECDSA_TINYCRYPT
Sigvart Hovlandebd05032019-03-21 10:47:32 +010098 bool "Use tinycrypt"
99 select BOOT_USE_TINYCRYPT
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +0000100
101config BOOT_ECDSA_CC310
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100102 bool "Use CC310"
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +0000103 depends on HAS_HW_NRF_CC310
104 select BOOT_USE_NRF_CC310_BL
105 select NRF_CC310_BL
106 select NRFXLIB_CRYPTO
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100107 select BOOT_USE_CC310
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +0000108endchoice # Ecdsa implementation
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100109endif
Fabio Utzig34e93a52020-02-03 09:59:53 -0300110
111config BOOT_SIGNATURE_TYPE_ED25519
112 bool "Edwards curve digital signatures using ed25519"
113
114if BOOT_SIGNATURE_TYPE_ED25519
115choice
116 prompt "Ecdsa implementation"
117 default BOOT_ED25519_TINYCRYPT
118config BOOT_ED25519_TINYCRYPT
119 bool "Use tinycrypt"
120 select BOOT_USE_TINYCRYPT
121config BOOT_ED25519_MBEDTLS
122 bool "Use mbedTLS"
123 select BOOT_USE_MBEDTLS
124 select MBEDTLS
125endchoice
126endif
127
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400128endchoice
129
Fabio Utzigc690c762018-04-26 10:51:09 -0300130config BOOT_SIGNATURE_KEY_FILE
131 string "PEM key file"
Håkon Øye Amundsen705c6c22020-09-28 09:45:40 +0000132 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 Utzigc690c762018-04-26 10:51:09 -0300136 default ""
137 help
Marek Pietabdcfc852020-08-04 02:22:55 -0700138 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 Utzigc690c762018-04-26 10:51:09 -0300143 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 Puzdrowski9a605b62020-03-16 13:34:30 +0100147config MCUBOOT_CLEANUP_ARM_CORE
148 bool "Perform core cleanup before chain-load the application"
149 depends on CPU_CORTEX_M
Ioannis Glaropoulos518d93a2020-10-22 14:22:14 +0200150 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 Puzdrowski9a605b62020-03-16 13:34:30 +0100164
Marti Bolivara4818a52018-04-12 13:02:38 -0400165config MBEDTLS_CFG_FILE
166 default "mcuboot-mbedtls-cfg.h"
167
David Vincze03368b82020-04-01 12:53:53 +0200168config 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 Bolivarbc2fa4e2018-04-12 12:18:32 -0400177config BOOT_VALIDATE_SLOT0
David Vincze2d736ad2019-02-18 11:50:22 +0100178 bool "Validate image in the primary slot on every boot"
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400179 default y
180 help
David Vincze2d736ad2019-02-18 11:50:22 +0100181 If y, the bootloader attempts to validate the signature of the
182 primary slot every boot. This adds the signature check time to
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400183 every boot, but can mitigate against some changes that are
184 able to modify the flash image itself.
185
Andrzej Puzdrowskifdff3e12020-09-15 08:23:25 +0200186if !SINGLE_APPLICATION_SLOT
David Vincze5a6e1812020-06-29 13:34:42 +0200187choice
188 prompt "Image upgrade modes"
189 default BOOT_SWAP_USING_MOVE if SOC_FAMILY_NRF
190 default BOOT_SWAP_USING_SCRATCH
191
192config 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 Bolivarbc2fa4e2018-04-12 12:18:32 -0400198config BOOT_UPGRADE_ONLY
199 bool "Overwrite image updates instead of swapping"
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400200 help
David Vincze2d736ad2019-02-18 11:50:22 +0100201 If y, overwrite the primary slot with the upgrade image instead
202 of swapping them. This prevents the fallback recovery, but
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400203 uses a much simpler code path.
204
Fabio Utzigc58842e2019-11-28 10:30:01 -0300205config BOOT_SWAP_USING_MOVE
Fabio Utzigdd2b6802020-01-06 09:10:45 -0300206 bool "Swap mode that can run without a scratch partition"
Fabio Utzigc58842e2019-11-28 10:30:01 -0300207 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 Vincze5a6e1812020-06-29 13:34:42 +0200216
217config 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
226endchoice
Fabio Utzigc58842e2019-11-28 10:30:01 -0300227
David Vincze505fba22020-10-22 13:53:29 +0200228config BOOT_DIRECT_XIP_REVERT
229 bool "Enable the revert mechanism in direct-xip mode"
230 default n
231 help
232 If y, enables the revert mechanism in direct-xip similar to the one in
233 swap mode. It requires the trailer magic to be added to the signed image.
234 When a reboot happens without the image being confirmed at runtime, the
235 bootloader considers the image faulty and erases it. After this it will
236 attempt to boot the previous image. The images can also be made permanent
237 (marked as confirmed in advance) just like in swap mode.
238
Fabio Utzigd0533ed2018-12-19 07:56:33 -0200239config BOOT_BOOTSTRAP
Sam Bristowd0ca0ff2019-10-30 20:51:35 +1300240 bool "Bootstrap erased the primary slot from the secondary slot"
Fabio Utzigd0533ed2018-12-19 07:56:33 -0200241 default n
242 help
243 If y, enables bootstraping support. Bootstrapping allows an erased
David Vincze2d736ad2019-02-18 11:50:22 +0100244 primary slot to be initialized from a valid image in the secondary slot.
Fabio Utzigd0533ed2018-12-19 07:56:33 -0200245 If unsure, leave at the default value.
246
Fabio Utzigca8ead22019-12-20 07:06:04 -0300247config BOOT_SWAP_SAVE_ENCTLV
248 bool "Save encrypted key TLVs instead of plaintext keys in swap metadata"
249 default n
250 help
251 If y, instead of saving the encrypted image keys in plaintext in the
252 swap resume metadata, save the encrypted image TLVs. This should be used
253 when there is no security mechanism protecting the data in the primary
254 slot from being dumped. If n is selected (default), the keys are written
255 after being decrypted from the image TLVs and could be read by an
256 attacker who has access to the flash contents of the primary slot (eg
257 JTAG/SWD or primary slot in external flash).
258 If unsure, leave at the default value.
259
Fabio Utzig5fe874c2018-08-31 07:41:50 -0300260config BOOT_ENCRYPT_RSA
Fabio Utzig42cc29a2019-11-05 07:54:41 -0300261 bool "Support for encrypted upgrade images using RSA"
Fabio Utzig5fe874c2018-08-31 07:41:50 -0300262 default n
263 help
David Vincze2d736ad2019-02-18 11:50:22 +0100264 If y, images in the secondary slot can be encrypted and are decrypted
265 on the fly when upgrading to the primary slot, as well as encrypted
Fabio Utzig42cc29a2019-11-05 07:54:41 -0300266 back when swapping from the primary slot to the secondary slot. The
267 encryption mechanism used in this case is RSA-OAEP (2048 bits).
268
269config BOOT_ENCRYPT_EC256
270 bool "Support for encrypted upgrade images using ECIES-P256"
271 default n
272 help
273 If y, images in the secondary slot can be encrypted and are decrypted
274 on the fly when upgrading to the primary slot, as well as encrypted
275 back when swapping from the primary slot to the secondary slot. The
276 encryption mechanism used in this case is ECIES using primitives
277 described under "ECIES-P256 encryption" in docs/encrypted_images.md.
Fabio Utzig5fe874c2018-08-31 07:41:50 -0300278
Fabio Utzigb6f014c2020-04-02 13:25:01 -0300279config BOOT_ENCRYPT_X25519
280 bool "Support for encrypted upgrade images using ECIES-X25519"
281 default n
282 help
283 If y, images in the secondary slot can be encrypted and are decrypted
284 on the fly when upgrading to the primary slot, as well as encrypted
285 back when swapping from the primary slot to the secondary slot. The
286 encryption mechanism used in this case is ECIES using primitives
287 described under "ECIES-X25519 encryption" in docs/encrypted_images.md.
David Vincze505fba22020-10-22 13:53:29 +0200288endif # !SINGLE_APPLICATION_SLOT
Fabio Utzigb6f014c2020-04-02 13:25:01 -0300289
Marti Bolivar0e091c92018-04-12 11:23:16 -0400290config BOOT_MAX_IMG_SECTORS
291 int "Maximum number of sectors per image slot"
292 default 128
293 help
294 This option controls the maximum number of sectors that each of
295 the two image areas can contain. Smaller values reduce MCUboot's
296 memory usage; larger values allow it to support larger images.
297 If unsure, leave at the default value.
298
Emanuele Di Santo205c8c62018-07-20 11:42:31 +0200299config BOOT_ERASE_PROGRESSIVELY
300 bool "Erase flash progressively when receiving new firmware"
Bernt Johan Damsloraa2fad122019-09-20 18:25:34 +0200301 default y if SOC_FAMILY_NRF
Emanuele Di Santo205c8c62018-07-20 11:42:31 +0200302 help
303 If enabled, flash is erased as necessary when receiving new firmware,
304 instead of erasing the whole image slot at once. This is necessary
305 on some hardware that has long erase times, to prevent long wait
306 times at the beginning of the DFU process.
307
David Vincze1cf11b52020-03-24 07:51:09 +0100308config MEASURED_BOOT
309 bool "Store the boot state/measurements in shared memory"
310 default n
311 help
312 If enabled, the bootloader will store certain boot measurements such as
313 the hash of the firmware image in a shared memory area. This data can
314 be used later by runtime services (e.g. by a device attestation service).
315
316config BOOT_SHARE_DATA
317 bool "Save application specific data in shared memory area"
318 default n
319
Tamas Banfce87332020-07-10 12:40:11 +0100320choice
321 prompt "Fault injection hardening profile"
322 default BOOT_FIH_PROFILE_OFF
323
324config BOOT_FIH_PROFILE_OFF
325 bool "No hardening against hardware level fault injection"
326 help
327 No hardening in SW against hardware level fault injection: power or
328 clock glitching, etc.
329
330config BOOT_FIH_PROFILE_LOW
331 bool "Moderate level hardening against hardware level fault injection"
332 help
333 Moderate level hardening: Long global fail loop to avoid break out,
334 control flow integrity check to discover discrepancy in expected code
335 flow.
336
337config BOOT_FIH_PROFILE_MEDIUM
338 bool "Medium level hardening against hardware level fault injection"
339 help
340 Medium level hardening: Long global fail loop to avoid break out,
341 control flow integrity check to discover discrepancy in expected code
342 flow, double variables to discover register or memory corruption.
343
344config BOOT_FIH_PROFILE_HIGH
345 bool "Maximum level hardening against hardware level fault injection"
346 select MBEDTLS
347 help
348 Maximum level hardening: Long global fail loop to avoid break out,
349 control flow integrity check to discover discrepancy in expected code
350 flow, double variables to discover register or memory corruption, random
351 delays to make code execution less predictable. Random delays requires an
352 entropy source.
353
354endchoice
355
Rajavardhan Gundi51c9d702019-02-20 14:08:52 +0530356config BOOT_WAIT_FOR_USB_DFU
357 bool "Wait for a prescribed duration to see if USB DFU is invoked"
358 default n
359 select USB
360 select USB_DFU_CLASS
361 select IMG_MANAGER
362 help
363 If y, MCUboot waits for a prescribed duration of time to allow
364 for USB DFU to be invoked. Please note DFU always updates the
365 slot1 image.
366
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400367config ZEPHYR_TRY_MASS_ERASE
368 bool "Try to mass erase flash when flashing MCUboot image"
369 default y
370 help
371 If y, attempt to configure the Zephyr build system's "flash"
372 target to mass-erase the flash device before flashing the
373 MCUboot image. This ensures the scratch and other partitions
374 are in a consistent state.
375
376 This is not available for all targets.
377
David Brownf6d14c22019-12-10 15:36:36 -0700378config BOOT_USE_BENCH
379 bool "Enable benchmark code"
380 default n
381 help
382 If y, adds support for simple benchmarking that can record
383 time intervals between two calls. The time printed depends
384 on the particular Zephyr target, and is generally ticks of a
385 specific board-specific timer.
386
Michael Scott74ceae52019-02-01 14:01:09 -0800387module = MCUBOOT
Piotr Mienkowski15aa6ef2019-04-08 22:48:15 +0200388module-str = MCUBoot bootloader
Michael Scott74ceae52019-02-01 14:01:09 -0800389source "subsys/logging/Kconfig.template.log_config"
Michael Scott74ceae52019-02-01 14:01:09 -0800390
Andrzej Puzdrowskiaf148532020-02-25 12:51:26 +0100391config MCUBOOT_LOG_THREAD_STACK_SIZE
392 int "Stack size for the MCUBoot log processing thread"
393 depends on LOG && !LOG_IMMEDIATE
394 default 2048 if COVERAGE_GCOV
395 default 1024 if NO_OPTIMIZATIONS
396 default 1024 if XTENSA
397 default 4096 if (X86 && X86_64)
398 default 4096 if ARM64
399 default 768
400 help
401 Set the internal stack size for MCUBoot log processing thread.
402
Marti Bolivar0e091c92018-04-12 11:23:16 -0400403menuconfig MCUBOOT_SERIAL
404 bool "MCUboot serial recovery"
405 default n
406 select REBOOT
Emanuele Di Santo30a92652019-01-16 14:01:08 +0100407 select GPIO
Marti Bolivar0e091c92018-04-12 11:23:16 -0400408 select SERIAL
Emanuele Di Santo30a92652019-01-16 14:01:08 +0100409 select UART_INTERRUPT_DRIVEN
Marti Bolivar0e091c92018-04-12 11:23:16 -0400410 select BASE64
411 select TINYCBOR
412 help
413 If y, enables a serial-port based update mode. This allows
414 MCUboot itself to load update images into flash over a UART.
415 If unsure, leave at the default value.
416
417if MCUBOOT_SERIAL
418
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200419choice
420 prompt "Serial device"
Andrzej Puzdrowskif4a9a9d2020-04-24 12:31:51 +0200421 default BOOT_SERIAL_UART if !BOARD_NRF52840DONGLE_NRF52840
422 default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840DONGLE_NRF52840
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200423
424config BOOT_SERIAL_UART
425 bool "UART"
426 # SERIAL and UART_INTERRUPT_DRIVEN already selected
427
428config BOOT_SERIAL_CDC_ACM
429 bool "CDC ACM"
430 select USB
431 select USB_DEVICE_STACK
432 select USB_CDC_ACM
433
434endchoice
435
Marti Bolivar0e091c92018-04-12 11:23:16 -0400436config BOOT_MAX_LINE_INPUT_LEN
437 int "Maximum command line length"
438 default 512
439 help
440 Maximum length of commands transported over the serial port.
441
442config BOOT_SERIAL_DETECT_PORT
443 string "GPIO device to trigger serial recovery mode"
444 default GPIO_0 if SOC_FAMILY_NRF
445 help
446 Zephyr GPIO device which contains the pin used to trigger
447 serial recovery mode.
448
449config BOOT_SERIAL_DETECT_PIN
450 int "Pin to trigger serial recovery mode"
Andrzej Puzdrowskif4a9a9d2020-04-24 12:31:51 +0200451 default 6 if BOARD_NRF9160DK_NRF9160
Andrzej Puzdrowskifefdea22020-03-27 09:41:14 +0100452 default 11 if BOARD_NRF52840DK_NRF52840
Andrzej Puzdrowskif4a9a9d2020-04-24 12:31:51 +0200453 default 13 if BOARD_NRF52DK_NRF52832
Håkon Øye Amundsen25eabb62020-06-03 14:58:08 +0200454 default 23 if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPPNS
Marti Bolivar0e091c92018-04-12 11:23:16 -0400455 help
456 Pin on the serial detect port which triggers serial recovery mode.
457
458config BOOT_SERIAL_DETECT_PIN_VAL
459 int "Serial detect pin trigger value"
460 default 0
461 range 0 1
462 help
463 Logic value of the detect pin which triggers serial recovery
464 mode.
465
Andrzej Puzdrowskif0004802019-10-01 14:13:35 +0200466# Workaround for not being able to have commas in macro arguments
467DT_CHOSEN_Z_CONSOLE := zephyr,console
468
469config RECOVERY_UART_DEV_NAME
470 string "UART Device Name for Recovery UART"
471 default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))" if HAS_DTS
472 default "UART_0"
473 depends on BOOT_SERIAL_UART
474 help
475 This option specifies the name of UART device to be used for
476 serial recovery.
477
Marti Bolivar0e091c92018-04-12 11:23:16 -0400478endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200479
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200480config BOOT_INTR_VEC_RELOC
481 bool "Relocate the interrupt vector to the application"
482 default n
483 depends on SW_VECTOR_RELAY || CPU_CORTEX_M_HAS_VTOR
484 help
485 Relocate the interrupt vector to the application before it is started.
486 Select this option if application requires vector relocation,
487 but it doesn't relocate vector in its reset handler.
488
Andrzej Puzdrowski16b6d152020-06-01 14:16:54 +0200489config UPDATEABLE_IMAGE_NUMBER
490 int "Number of updateable images"
491 default 1
Andrzej Puzdrowskifdff3e12020-09-15 08:23:25 +0200492 range 1 1 if SINGLE_APPLICATION_SLOT
Andrzej Puzdrowski16b6d152020-06-01 14:16:54 +0200493 help
494 Enables support of multi image update.
495
496choice
497 prompt "Downgrade prevention"
498 optional
499
500config MCUBOOT_DOWNGRADE_PREVENTION
501 bool "SW based downgrade prevention"
502 depends on BOOT_UPGRADE_ONLY
503 help
504 Prevent downgrades by enforcing incrementing version numbers.
505 When this option is set, any upgrade must have greater major version
506 or greater minor version with equal major version. This mechanism
507 only protects against some attacks against version downgrades (for
508 example, a JTAG could be used to write an older version).
509
510config MCUBOOT_HW_DOWNGRADE_PREVENTION
511 bool "HW based downgrade prevention"
512 help
513 Prevent undesirable/malicious software downgrades. When this option is
514 set, any upgrade must have greater or equal security counter value.
515 Because of the acceptance of equal values it allows for software
516 downgrade to some extent.
517
518endchoice
519
Andrzej Puzdrowskid21442a2020-10-12 16:47:28 +0200520config BOOT_WATCHDOG_FEED
521 bool "Feed the watchdog while doing swap"
522 default y if SOC_FAMILY_NRF
523 imply NRFX_WDT
524 imply NRFX_WDT0
525 imply NRFX_WDT1
526 help
527 Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
528 used to feed watchdog while doing time consuming operations.
529
Andrzej Puzdrowski97543282018-04-12 15:16:56 +0200530endmenu
531
Carles Cufi84ede582018-01-29 15:12:00 +0100532config MCUBOOT_DEVICE_SETTINGS
533 # Hidden selector for device-specific settings
534 bool
535 default y
536 # CPU options
537 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100538 # Enable flash page layout if available
539 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200540 # Enable flash_map module as flash I/O back-end
541 select FLASH_MAP
Carles Cufi84ede582018-01-29 15:12:00 +0100542
543config MCUBOOT_DEVICE_CPU_CORTEX_M0
544 # Hidden selector for Cortex-M0 settings
545 bool
546 default n
547 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
548
Marti Bolivar0e091c92018-04-12 11:23:16 -0400549comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200550
Marti Bolivarf84cc4b2019-08-20 16:06:56 -0700551# Disabling MULTITHREADING provides a code size advantage, but
552# it requires peripheral drivers (particularly a flash driver)
553# that works properly with the option enabled.
554#
555# If you know for sure that your hardware will work, you can default
556# it to n here. Otherwise, having it on by default makes the most
557# hardware work.
558config MULTITHREADING
Andrzej Puzdrowski9a4946c2020-02-20 12:39:12 +0100559 default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING
Marti Bolivarf84cc4b2019-08-20 16:06:56 -0700560 default n if SOC_FAMILY_NRF
561 default y
562
Andrzej Puzdrowski9a4946c2020-02-20 12:39:12 +0100563config LOG_IMMEDIATE
564 default n if MULTITHREADING
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100565 default y
566
567config LOG_PROCESS_THREAD
568 default n # mcuboot has its own log processing thread
569
570# override USB device name
571config USB_DEVICE_PRODUCT
572 default "MCUBOOT"
Andrzej Puzdrowski9a4946c2020-02-20 12:39:12 +0100573
Robert Lubos1b19d2a2020-01-31 14:05:35 +0100574source "Kconfig.zephyr"