blob: 544224f772f03ace6ae2a59d7cc8486818c3d347 [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"
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +000071 default BOOT_SIGNATURE_TYPE_ECDSA_P256 if HAS_HW_NRF_CC310
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040072 default BOOT_SIGNATURE_TYPE_RSA
73
Arvin Farahmandfb5ec182020-05-05 11:44:12 -040074config BOOT_SIGNATURE_TYPE_NONE
75 bool "No signature; use only hash check"
76 select BOOT_USE_TINYCRYPT
77
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040078config BOOT_SIGNATURE_TYPE_RSA
79 bool "RSA signatures"
80 select BOOT_USE_MBEDTLS
Marti Bolivara4818a52018-04-12 13:02:38 -040081 select MBEDTLS
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040082
Fabio Utzig105b59a2019-05-13 15:08:12 -070083if BOOT_SIGNATURE_TYPE_RSA
84config BOOT_SIGNATURE_TYPE_RSA_LEN
85 int "RSA signature length"
86 range 2048 3072
87 default 2048
88endif
89
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040090config BOOT_SIGNATURE_TYPE_ECDSA_P256
91 bool "Elliptic curve digital signatures with curve P-256"
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040092
Sigvart Hovlandebd05032019-03-21 10:47:32 +010093if BOOT_SIGNATURE_TYPE_ECDSA_P256
94choice
95 prompt "Ecdsa implementation"
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +000096 default BOOT_ECDSA_CC310 if HAS_HW_NRF_CC310
Fabio Utzig34e93a52020-02-03 09:59:53 -030097 default BOOT_ECDSA_TINYCRYPT
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +000098
Fabio Utzig34e93a52020-02-03 09:59:53 -030099config BOOT_ECDSA_TINYCRYPT
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100100 bool "Use tinycrypt"
101 select BOOT_USE_TINYCRYPT
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +0000102
103config BOOT_ECDSA_CC310
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100104 bool "Use CC310"
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +0000105 depends on HAS_HW_NRF_CC310
106 select BOOT_USE_NRF_CC310_BL
107 select NRF_CC310_BL
108 select NRFXLIB_CRYPTO
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100109 select BOOT_USE_CC310
Håkon Øye Amundsenee7282d2020-09-28 09:48:29 +0000110endchoice # Ecdsa implementation
Sigvart Hovlandebd05032019-03-21 10:47:32 +0100111endif
Fabio Utzig34e93a52020-02-03 09:59:53 -0300112
113config BOOT_SIGNATURE_TYPE_ED25519
114 bool "Edwards curve digital signatures using ed25519"
115
116if BOOT_SIGNATURE_TYPE_ED25519
117choice
118 prompt "Ecdsa implementation"
119 default BOOT_ED25519_TINYCRYPT
120config BOOT_ED25519_TINYCRYPT
121 bool "Use tinycrypt"
122 select BOOT_USE_TINYCRYPT
123config BOOT_ED25519_MBEDTLS
124 bool "Use mbedTLS"
125 select BOOT_USE_MBEDTLS
126 select MBEDTLS
127endchoice
128endif
129
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400130endchoice
131
Fabio Utzigc690c762018-04-26 10:51:09 -0300132config BOOT_SIGNATURE_KEY_FILE
133 string "PEM key file"
Håkon Øye Amundsen705c6c22020-09-28 09:45:40 +0000134 default "root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256
135 default "root-ed25519.pem" if BOOT_SIGNATURE_TYPE_ED25519
136 default "root-rsa-3072.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=3072
137 default "root-rsa-2048.pem" if BOOT_SIGNATURE_TYPE_RSA && BOOT_SIGNATURE_TYPE_RSA_LEN=2048
Fabio Utzigc690c762018-04-26 10:51:09 -0300138 default ""
139 help
Marek Pietabdcfc852020-08-04 02:22:55 -0700140 You can use either absolute or relative path.
141 In case relative path is used, the build system assumes that it starts
142 from the directory where the MCUBoot KConfig configuration file is
143 located. If the key file is not there, the build system uses relative
144 path that starts from the MCUBoot repository root directory.
Fabio Utzigc690c762018-04-26 10:51:09 -0300145 The key file will be parsed by imgtool's getpub command and a .c source
146 with the public key information will be written in a format expected by
147 MCUboot.
148
Andrzej Puzdrowski9a605b62020-03-16 13:34:30 +0100149config MCUBOOT_CLEANUP_ARM_CORE
150 bool "Perform core cleanup before chain-load the application"
151 depends on CPU_CORTEX_M
152 default y
153
Marti Bolivara4818a52018-04-12 13:02:38 -0400154config MBEDTLS_CFG_FILE
155 default "mcuboot-mbedtls-cfg.h"
156
David Vincze03368b82020-04-01 12:53:53 +0200157config BOOT_HW_KEY
158 bool "Use HW key for image verification"
159 default n
160 help
161 Use HW key for image verification, otherwise the public key is embedded
162 in MCUBoot. If enabled the public key is appended to the signed image
163 and requires the hash of the public key to be provisioned to the device
164 beforehand.
165
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400166config BOOT_VALIDATE_SLOT0
David Vincze2d736ad2019-02-18 11:50:22 +0100167 bool "Validate image in the primary slot on every boot"
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400168 default y
169 help
David Vincze2d736ad2019-02-18 11:50:22 +0100170 If y, the bootloader attempts to validate the signature of the
171 primary slot every boot. This adds the signature check time to
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400172 every boot, but can mitigate against some changes that are
173 able to modify the flash image itself.
174
Andrzej Puzdrowskifdff3e12020-09-15 08:23:25 +0200175if !SINGLE_APPLICATION_SLOT
David Vincze5a6e1812020-06-29 13:34:42 +0200176choice
177 prompt "Image upgrade modes"
178 default BOOT_SWAP_USING_MOVE if SOC_FAMILY_NRF
179 default BOOT_SWAP_USING_SCRATCH
180
181config BOOT_SWAP_USING_SCRATCH
182 bool "Swap mode that run with the scratch partition"
183 help
184 This is the most conservative swap mode but it can work even on
185 devices with heterogeneous flash page layout.
186
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400187config BOOT_UPGRADE_ONLY
188 bool "Overwrite image updates instead of swapping"
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400189 help
David Vincze2d736ad2019-02-18 11:50:22 +0100190 If y, overwrite the primary slot with the upgrade image instead
191 of swapping them. This prevents the fallback recovery, but
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400192 uses a much simpler code path.
193
Fabio Utzigc58842e2019-11-28 10:30:01 -0300194config BOOT_SWAP_USING_MOVE
Fabio Utzigdd2b6802020-01-06 09:10:45 -0300195 bool "Swap mode that can run without a scratch partition"
Fabio Utzigc58842e2019-11-28 10:30:01 -0300196 help
197 If y, the swap upgrade is done in two steps, where first every
198 sector of the primary slot is moved up one sector, then for
199 each sector X in the secondary slot, it is moved to index X in
200 the primary slot, then the sector at X+1 in the primary is
201 moved to index X in the secondary.
202 This allows a swap upgrade without using a scratch partition,
203 but is currently limited to all sectors in both slots being of
204 the same size.
David Vincze5a6e1812020-06-29 13:34:42 +0200205
206config BOOT_DIRECT_XIP
207 bool "Run the latest image directly from its slot"
208 help
209 If y, mcuboot selects the newest valid image based on the image version
210 numbers, thereafter the selected image can run directly from its slot
211 without having to move/copy it into the primary slot. For this reason the
212 images must be linked to be executed from the given image slot. Using this
213 mode results in a simpler code path and smaller code size.
214
215endchoice
Dominik Ermel4dc3f442020-05-26 08:45:14 +0000216endif
Fabio Utzigc58842e2019-11-28 10:30:01 -0300217
Andrzej Puzdrowskifdff3e12020-09-15 08:23:25 +0200218if !SINGLE_APPLICATION_SLOT
Fabio Utzigd0533ed2018-12-19 07:56:33 -0200219config BOOT_BOOTSTRAP
Sam Bristowd0ca0ff2019-10-30 20:51:35 +1300220 bool "Bootstrap erased the primary slot from the secondary slot"
Fabio Utzigd0533ed2018-12-19 07:56:33 -0200221 default n
222 help
223 If y, enables bootstraping support. Bootstrapping allows an erased
David Vincze2d736ad2019-02-18 11:50:22 +0100224 primary slot to be initialized from a valid image in the secondary slot.
Fabio Utzigd0533ed2018-12-19 07:56:33 -0200225 If unsure, leave at the default value.
226
Fabio Utzigca8ead22019-12-20 07:06:04 -0300227config BOOT_SWAP_SAVE_ENCTLV
228 bool "Save encrypted key TLVs instead of plaintext keys in swap metadata"
229 default n
230 help
231 If y, instead of saving the encrypted image keys in plaintext in the
232 swap resume metadata, save the encrypted image TLVs. This should be used
233 when there is no security mechanism protecting the data in the primary
234 slot from being dumped. If n is selected (default), the keys are written
235 after being decrypted from the image TLVs and could be read by an
236 attacker who has access to the flash contents of the primary slot (eg
237 JTAG/SWD or primary slot in external flash).
238 If unsure, leave at the default value.
239
Fabio Utzig5fe874c2018-08-31 07:41:50 -0300240config BOOT_ENCRYPT_RSA
Fabio Utzig42cc29a2019-11-05 07:54:41 -0300241 bool "Support for encrypted upgrade images using RSA"
Fabio Utzig5fe874c2018-08-31 07:41:50 -0300242 default n
243 help
David Vincze2d736ad2019-02-18 11:50:22 +0100244 If y, images in the secondary slot can be encrypted and are decrypted
245 on the fly when upgrading to the primary slot, as well as encrypted
Fabio Utzig42cc29a2019-11-05 07:54:41 -0300246 back when swapping from the primary slot to the secondary slot. The
247 encryption mechanism used in this case is RSA-OAEP (2048 bits).
248
249config BOOT_ENCRYPT_EC256
250 bool "Support for encrypted upgrade images using ECIES-P256"
251 default n
252 help
253 If y, images in the secondary slot can be encrypted and are decrypted
254 on the fly when upgrading to the primary slot, as well as encrypted
255 back when swapping from the primary slot to the secondary slot. The
256 encryption mechanism used in this case is ECIES using primitives
257 described under "ECIES-P256 encryption" in docs/encrypted_images.md.
Fabio Utzig5fe874c2018-08-31 07:41:50 -0300258
Fabio Utzigb6f014c2020-04-02 13:25:01 -0300259config BOOT_ENCRYPT_X25519
260 bool "Support for encrypted upgrade images using ECIES-X25519"
261 default n
262 help
263 If y, images in the secondary slot can be encrypted and are decrypted
264 on the fly when upgrading to the primary slot, as well as encrypted
265 back when swapping from the primary slot to the secondary slot. The
266 encryption mechanism used in this case is ECIES using primitives
267 described under "ECIES-X25519 encryption" in docs/encrypted_images.md.
Dominik Ermel4dc3f442020-05-26 08:45:14 +0000268endif
Fabio Utzigb6f014c2020-04-02 13:25:01 -0300269
Marti Bolivar0e091c92018-04-12 11:23:16 -0400270config BOOT_MAX_IMG_SECTORS
271 int "Maximum number of sectors per image slot"
272 default 128
273 help
274 This option controls the maximum number of sectors that each of
275 the two image areas can contain. Smaller values reduce MCUboot's
276 memory usage; larger values allow it to support larger images.
277 If unsure, leave at the default value.
278
Emanuele Di Santo205c8c62018-07-20 11:42:31 +0200279config BOOT_ERASE_PROGRESSIVELY
280 bool "Erase flash progressively when receiving new firmware"
281 default y if SOC_NRF52840
282 help
283 If enabled, flash is erased as necessary when receiving new firmware,
284 instead of erasing the whole image slot at once. This is necessary
285 on some hardware that has long erase times, to prevent long wait
286 times at the beginning of the DFU process.
287
David Vincze1cf11b52020-03-24 07:51:09 +0100288config MEASURED_BOOT
289 bool "Store the boot state/measurements in shared memory"
290 default n
291 help
292 If enabled, the bootloader will store certain boot measurements such as
293 the hash of the firmware image in a shared memory area. This data can
294 be used later by runtime services (e.g. by a device attestation service).
295
296config BOOT_SHARE_DATA
297 bool "Save application specific data in shared memory area"
298 default n
299
Rajavardhan Gundi51c9d702019-02-20 14:08:52 +0530300config BOOT_WAIT_FOR_USB_DFU
301 bool "Wait for a prescribed duration to see if USB DFU is invoked"
302 default n
303 select USB
304 select USB_DFU_CLASS
305 select IMG_MANAGER
306 help
307 If y, MCUboot waits for a prescribed duration of time to allow
308 for USB DFU to be invoked. Please note DFU always updates the
309 slot1 image.
310
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400311config ZEPHYR_TRY_MASS_ERASE
312 bool "Try to mass erase flash when flashing MCUboot image"
313 default y
314 help
315 If y, attempt to configure the Zephyr build system's "flash"
316 target to mass-erase the flash device before flashing the
317 MCUboot image. This ensures the scratch and other partitions
318 are in a consistent state.
319
320 This is not available for all targets.
321
David Brownf6d14c22019-12-10 15:36:36 -0700322config BOOT_USE_BENCH
323 bool "Enable benchmark code"
324 default n
325 help
326 If y, adds support for simple benchmarking that can record
327 time intervals between two calls. The time printed depends
328 on the particular Zephyr target, and is generally ticks of a
329 specific board-specific timer.
330
Michael Scott74ceae52019-02-01 14:01:09 -0800331module = MCUBOOT
Piotr Mienkowski15aa6ef2019-04-08 22:48:15 +0200332module-str = MCUBoot bootloader
Michael Scott74ceae52019-02-01 14:01:09 -0800333source "subsys/logging/Kconfig.template.log_config"
Michael Scott74ceae52019-02-01 14:01:09 -0800334
Andrzej Puzdrowskiaf148532020-02-25 12:51:26 +0100335config MCUBOOT_LOG_THREAD_STACK_SIZE
336 int "Stack size for the MCUBoot log processing thread"
337 depends on LOG && !LOG_IMMEDIATE
338 default 2048 if COVERAGE_GCOV
339 default 1024 if NO_OPTIMIZATIONS
340 default 1024 if XTENSA
341 default 4096 if (X86 && X86_64)
342 default 4096 if ARM64
343 default 768
344 help
345 Set the internal stack size for MCUBoot log processing thread.
346
Marti Bolivar0e091c92018-04-12 11:23:16 -0400347menuconfig MCUBOOT_SERIAL
348 bool "MCUboot serial recovery"
349 default n
350 select REBOOT
Emanuele Di Santo30a92652019-01-16 14:01:08 +0100351 select GPIO
Marti Bolivar0e091c92018-04-12 11:23:16 -0400352 select SERIAL
Emanuele Di Santo30a92652019-01-16 14:01:08 +0100353 select UART_INTERRUPT_DRIVEN
Marti Bolivar0e091c92018-04-12 11:23:16 -0400354 select BASE64
355 select TINYCBOR
356 help
357 If y, enables a serial-port based update mode. This allows
358 MCUboot itself to load update images into flash over a UART.
359 If unsure, leave at the default value.
360
361if MCUBOOT_SERIAL
362
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200363choice
364 prompt "Serial device"
Andrzej Puzdrowskif4a9a9d2020-04-24 12:31:51 +0200365 default BOOT_SERIAL_UART if !BOARD_NRF52840DONGLE_NRF52840
366 default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840DONGLE_NRF52840
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200367
368config BOOT_SERIAL_UART
369 bool "UART"
370 # SERIAL and UART_INTERRUPT_DRIVEN already selected
371
372config BOOT_SERIAL_CDC_ACM
373 bool "CDC ACM"
374 select USB
375 select USB_DEVICE_STACK
376 select USB_CDC_ACM
377
378endchoice
379
Marti Bolivar0e091c92018-04-12 11:23:16 -0400380config BOOT_MAX_LINE_INPUT_LEN
381 int "Maximum command line length"
382 default 512
383 help
384 Maximum length of commands transported over the serial port.
385
386config BOOT_SERIAL_DETECT_PORT
387 string "GPIO device to trigger serial recovery mode"
388 default GPIO_0 if SOC_FAMILY_NRF
389 help
390 Zephyr GPIO device which contains the pin used to trigger
391 serial recovery mode.
392
393config BOOT_SERIAL_DETECT_PIN
394 int "Pin to trigger serial recovery mode"
Andrzej Puzdrowskif4a9a9d2020-04-24 12:31:51 +0200395 default 6 if BOARD_NRF9160DK_NRF9160
Andrzej Puzdrowskifefdea22020-03-27 09:41:14 +0100396 default 11 if BOARD_NRF52840DK_NRF52840
Andrzej Puzdrowskif4a9a9d2020-04-24 12:31:51 +0200397 default 13 if BOARD_NRF52DK_NRF52832
Håkon Øye Amundsen6fc25952020-01-02 15:15:42 +0000398 default 23 if BOARD_NRF5340_DK_NRF5340_CPUAPP || BOARD_NRF5340_DK_NRF5340_CPUAPPNS
Marti Bolivar0e091c92018-04-12 11:23:16 -0400399 help
400 Pin on the serial detect port which triggers serial recovery mode.
401
402config BOOT_SERIAL_DETECT_PIN_VAL
403 int "Serial detect pin trigger value"
404 default 0
405 range 0 1
406 help
407 Logic value of the detect pin which triggers serial recovery
408 mode.
409
Andrzej Puzdrowskif0004802019-10-01 14:13:35 +0200410# Workaround for not being able to have commas in macro arguments
411DT_CHOSEN_Z_CONSOLE := zephyr,console
412
413config RECOVERY_UART_DEV_NAME
414 string "UART Device Name for Recovery UART"
415 default "$(dt_chosen_label,$(DT_CHOSEN_Z_CONSOLE))" if HAS_DTS
416 default "UART_0"
417 depends on BOOT_SERIAL_UART
418 help
419 This option specifies the name of UART device to be used for
420 serial recovery.
421
Marti Bolivar0e091c92018-04-12 11:23:16 -0400422endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200423
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200424config BOOT_INTR_VEC_RELOC
425 bool "Relocate the interrupt vector to the application"
426 default n
427 depends on SW_VECTOR_RELAY || CPU_CORTEX_M_HAS_VTOR
428 help
429 Relocate the interrupt vector to the application before it is started.
430 Select this option if application requires vector relocation,
431 but it doesn't relocate vector in its reset handler.
432
Andrzej Puzdrowski16b6d152020-06-01 14:16:54 +0200433config UPDATEABLE_IMAGE_NUMBER
434 int "Number of updateable images"
435 default 1
Andrzej Puzdrowskifdff3e12020-09-15 08:23:25 +0200436 range 1 1 if SINGLE_APPLICATION_SLOT
Andrzej Puzdrowski16b6d152020-06-01 14:16:54 +0200437 help
438 Enables support of multi image update.
439
440choice
441 prompt "Downgrade prevention"
442 optional
443
444config MCUBOOT_DOWNGRADE_PREVENTION
445 bool "SW based downgrade prevention"
446 depends on BOOT_UPGRADE_ONLY
447 help
448 Prevent downgrades by enforcing incrementing version numbers.
449 When this option is set, any upgrade must have greater major version
450 or greater minor version with equal major version. This mechanism
451 only protects against some attacks against version downgrades (for
452 example, a JTAG could be used to write an older version).
453
454config MCUBOOT_HW_DOWNGRADE_PREVENTION
455 bool "HW based downgrade prevention"
456 help
457 Prevent undesirable/malicious software downgrades. When this option is
458 set, any upgrade must have greater or equal security counter value.
459 Because of the acceptance of equal values it allows for software
460 downgrade to some extent.
461
462endchoice
463
Andrzej Puzdrowski97543282018-04-12 15:16:56 +0200464endmenu
465
Carles Cufi84ede582018-01-29 15:12:00 +0100466config MCUBOOT_DEVICE_SETTINGS
467 # Hidden selector for device-specific settings
468 bool
469 default y
470 # CPU options
471 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100472 # Enable flash page layout if available
473 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200474 # Enable flash_map module as flash I/O back-end
475 select FLASH_MAP
Carles Cufi84ede582018-01-29 15:12:00 +0100476
477config MCUBOOT_DEVICE_CPU_CORTEX_M0
478 # Hidden selector for Cortex-M0 settings
479 bool
480 default n
481 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
482
Marti Bolivar0e091c92018-04-12 11:23:16 -0400483comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200484
Marti Bolivarf84cc4b2019-08-20 16:06:56 -0700485# Disabling MULTITHREADING provides a code size advantage, but
486# it requires peripheral drivers (particularly a flash driver)
487# that works properly with the option enabled.
488#
489# If you know for sure that your hardware will work, you can default
490# it to n here. Otherwise, having it on by default makes the most
491# hardware work.
492config MULTITHREADING
Andrzej Puzdrowski9a4946c2020-02-20 12:39:12 +0100493 default y if BOOT_SERIAL_CDC_ACM #usb driver requires MULTITHREADING
Marti Bolivarf84cc4b2019-08-20 16:06:56 -0700494 default n if SOC_FAMILY_NRF
495 default y
496
Andrzej Puzdrowski9a4946c2020-02-20 12:39:12 +0100497config LOG_IMMEDIATE
498 default n if MULTITHREADING
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100499 default y
500
501config LOG_PROCESS_THREAD
502 default n # mcuboot has its own log processing thread
503
504# override USB device name
505config USB_DEVICE_PRODUCT
506 default "MCUBOOT"
Andrzej Puzdrowski9a4946c2020-02-20 12:39:12 +0100507
Robert Lubos1b19d2a2020-01-31 14:05:35 +0100508source "Kconfig.zephyr"