blob: eafdb94846cf5b3c02b944a37f4be63d5fb14ec8 [file] [log] [blame]
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02001# Copyright (c) 2017 Linaro Limited
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5
Marti Bolivar0e091c92018-04-12 11:23:16 -04006mainmenu "MCUboot configuration"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02007
Marti Bolivar0e091c92018-04-12 11:23:16 -04008comment "MCUboot-specific configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +02009
Emanuele Di Santo865777d2018-11-08 11:28:15 +010010# Hidden option to mark a project as MCUboot
11config MCUBOOT
12 default y
13 bool
Rajavardhan Gundi07ba28f2018-12-10 15:44:48 +053014 select MPU_ALLOW_FLASH_WRITE if ARM_MPU
Emanuele Di Santo865777d2018-11-08 11:28:15 +010015
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040016config BOOT_USE_MBEDTLS
17 bool
18 # Hidden option
19 default n
20 help
21 Use mbedTLS for crypto primitives.
22
23config BOOT_USE_TINYCRYPT
24 bool
25 # Hidden option
26 default n
27 help
28 Use TinyCrypt for crypto primitives.
29
Andrzej Puzdrowski97543282018-04-12 15:16:56 +020030menu "MCUBoot settings"
31
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040032choice
33 prompt "Signature type"
34 default BOOT_SIGNATURE_TYPE_RSA
35
36config BOOT_SIGNATURE_TYPE_RSA
37 bool "RSA signatures"
38 select BOOT_USE_MBEDTLS
Marti Bolivara4818a52018-04-12 13:02:38 -040039 select MBEDTLS
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040040
41config BOOT_SIGNATURE_TYPE_ECDSA_P256
42 bool "Elliptic curve digital signatures with curve P-256"
43 select BOOT_USE_TINYCRYPT
44
45endchoice
46
Fabio Utzigc690c762018-04-26 10:51:09 -030047config BOOT_SIGNATURE_KEY_FILE
48 string "PEM key file"
49 default ""
50 help
51 The key file will be parsed by imgtool's getpub command and a .c source
52 with the public key information will be written in a format expected by
53 MCUboot.
54
Marti Bolivara4818a52018-04-12 13:02:38 -040055config MBEDTLS_CFG_FILE
56 default "mcuboot-mbedtls-cfg.h"
57
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040058config BOOT_VALIDATE_SLOT0
59 bool "Validate image slot 0 on every boot"
60 default y
61 help
62 If y, the bootloader attempts to validate the signature of
63 slot0 every boot. This adds the signature check time to
64 every boot, but can mitigate against some changes that are
65 able to modify the flash image itself.
66
67config BOOT_UPGRADE_ONLY
68 bool "Overwrite image updates instead of swapping"
69 default n
70 help
71 If y, overwrite slot0 with the upgrade image instead of
72 swapping them. This prevents the fallback recovery, but
73 uses a much simpler code path.
74
Fabio Utzig5fe874c2018-08-31 07:41:50 -030075config BOOT_ENCRYPT_RSA
76 bool "Support for encrypted upgrade images"
77 default n
78 help
79 If y, images in slot 1 can be encrypted and are decrypted
80 on the fly when upgrading to slot 0, as well as encrypted
81 back when swapping from slot 0 to slot 1.
82
Marti Bolivar0e091c92018-04-12 11:23:16 -040083config BOOT_MAX_IMG_SECTORS
84 int "Maximum number of sectors per image slot"
85 default 128
86 help
87 This option controls the maximum number of sectors that each of
88 the two image areas can contain. Smaller values reduce MCUboot's
89 memory usage; larger values allow it to support larger images.
90 If unsure, leave at the default value.
91
Emanuele Di Santo205c8c62018-07-20 11:42:31 +020092config BOOT_ERASE_PROGRESSIVELY
93 bool "Erase flash progressively when receiving new firmware"
94 default y if SOC_NRF52840
95 help
96 If enabled, flash is erased as necessary when receiving new firmware,
97 instead of erasing the whole image slot at once. This is necessary
98 on some hardware that has long erase times, to prevent long wait
99 times at the beginning of the DFU process.
100
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -0400101config ZEPHYR_TRY_MASS_ERASE
102 bool "Try to mass erase flash when flashing MCUboot image"
103 default y
104 help
105 If y, attempt to configure the Zephyr build system's "flash"
106 target to mass-erase the flash device before flashing the
107 MCUboot image. This ensures the scratch and other partitions
108 are in a consistent state.
109
110 This is not available for all targets.
111
Fabio Utzig9a4b9ba2018-05-07 08:31:27 -0300112config BOOT_HAVE_LOGGING
113 bool "MCUboot have logging enabled"
114 default y
115 select SYS_LOG
116 help
117 If y, enables logging on the serial port. The log level can
118 be defined by setting `SYS_LOG_DEFAULT_LEVEL`.
119 If unsure, leave at the default value.
120
Marti Bolivar0e091c92018-04-12 11:23:16 -0400121menuconfig MCUBOOT_SERIAL
122 bool "MCUboot serial recovery"
123 default n
124 select REBOOT
125 select UART_INTERRUPT_DRIVEN
126 select SERIAL
127 select BASE64
128 select TINYCBOR
129 help
130 If y, enables a serial-port based update mode. This allows
131 MCUboot itself to load update images into flash over a UART.
132 If unsure, leave at the default value.
133
134if MCUBOOT_SERIAL
135
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200136choice
137 prompt "Serial device"
138 default BOOT_SERIAL_UART if !BOARD_NRF52840_PCA10059
139 default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840_PCA10059
140
141config BOOT_SERIAL_UART
142 bool "UART"
143 # SERIAL and UART_INTERRUPT_DRIVEN already selected
144
145config BOOT_SERIAL_CDC_ACM
146 bool "CDC ACM"
147 select USB
148 select USB_DEVICE_STACK
149 select USB_CDC_ACM
150
151endchoice
152
Marti Bolivar0e091c92018-04-12 11:23:16 -0400153config BOOT_MAX_LINE_INPUT_LEN
154 int "Maximum command line length"
155 default 512
156 help
157 Maximum length of commands transported over the serial port.
158
159config BOOT_SERIAL_DETECT_PORT
160 string "GPIO device to trigger serial recovery mode"
161 default GPIO_0 if SOC_FAMILY_NRF
162 help
163 Zephyr GPIO device which contains the pin used to trigger
164 serial recovery mode.
165
166config BOOT_SERIAL_DETECT_PIN
167 int "Pin to trigger serial recovery mode"
168 default 11 if BOARD_NRF52840_PCA10056
169 default 13 if BOARD_NRF52_PCA10040
170 help
171 Pin on the serial detect port which triggers serial recovery mode.
172
173config BOOT_SERIAL_DETECT_PIN_VAL
174 int "Serial detect pin trigger value"
175 default 0
176 range 0 1
177 help
178 Logic value of the detect pin which triggers serial recovery
179 mode.
180
181endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200182
Andrzej Puzdrowski97543282018-04-12 15:16:56 +0200183endmenu
184
Carles Cufi84ede582018-01-29 15:12:00 +0100185config MCUBOOT_DEVICE_SETTINGS
186 # Hidden selector for device-specific settings
187 bool
188 default y
189 # CPU options
190 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100191 # Enable flash page layout if available
192 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200193 # Enable flash_map module as flash I/O back-end
194 select FLASH_MAP
Carles Cufi84ede582018-01-29 15:12:00 +0100195
196config MCUBOOT_DEVICE_CPU_CORTEX_M0
197 # Hidden selector for Cortex-M0 settings
198 bool
199 default n
200 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
201
Marti Bolivar0e091c92018-04-12 11:23:16 -0400202comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200203
Marti Bolivar0e091c92018-04-12 11:23:16 -0400204config ZEPHYR_BASE
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200205 string
Marti Bolivar0e091c92018-04-12 11:23:16 -0400206 option env="ZEPHYR_BASE"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200207
Marti Bolivar0e091c92018-04-12 11:23:16 -0400208source "$ZEPHYR_BASE/Kconfig.zephyr"