blob: 31c78a1eaf9a6f12164797c45b47a2d64c8c2ec3 [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
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040010config BOOT_USE_MBEDTLS
11 bool
12 # Hidden option
13 default n
14 help
15 Use mbedTLS for crypto primitives.
16
17config BOOT_USE_TINYCRYPT
18 bool
19 # Hidden option
20 default n
21 help
22 Use TinyCrypt for crypto primitives.
23
Andrzej Puzdrowski97543282018-04-12 15:16:56 +020024menu "MCUBoot settings"
25
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040026choice
27 prompt "Signature type"
28 default BOOT_SIGNATURE_TYPE_RSA
29
30config BOOT_SIGNATURE_TYPE_RSA
31 bool "RSA signatures"
32 select BOOT_USE_MBEDTLS
Marti Bolivara4818a52018-04-12 13:02:38 -040033 select MBEDTLS
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040034
35config BOOT_SIGNATURE_TYPE_ECDSA_P256
36 bool "Elliptic curve digital signatures with curve P-256"
37 select BOOT_USE_TINYCRYPT
38
39endchoice
40
Fabio Utzigc690c762018-04-26 10:51:09 -030041config BOOT_SIGNATURE_KEY_FILE
42 string "PEM key file"
43 default ""
44 help
45 The key file will be parsed by imgtool's getpub command and a .c source
46 with the public key information will be written in a format expected by
47 MCUboot.
48
Marti Bolivara4818a52018-04-12 13:02:38 -040049config MBEDTLS_CFG_FILE
50 default "mcuboot-mbedtls-cfg.h"
51
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040052config BOOT_VALIDATE_SLOT0
53 bool "Validate image slot 0 on every boot"
54 default y
55 help
56 If y, the bootloader attempts to validate the signature of
57 slot0 every boot. This adds the signature check time to
58 every boot, but can mitigate against some changes that are
59 able to modify the flash image itself.
60
61config BOOT_UPGRADE_ONLY
62 bool "Overwrite image updates instead of swapping"
63 default n
64 help
65 If y, overwrite slot0 with the upgrade image instead of
66 swapping them. This prevents the fallback recovery, but
67 uses a much simpler code path.
68
Marti Bolivar0e091c92018-04-12 11:23:16 -040069config BOOT_MAX_IMG_SECTORS
70 int "Maximum number of sectors per image slot"
71 default 128
72 help
73 This option controls the maximum number of sectors that each of
74 the two image areas can contain. Smaller values reduce MCUboot's
75 memory usage; larger values allow it to support larger images.
76 If unsure, leave at the default value.
77
Emanuele Di Santo205c8c62018-07-20 11:42:31 +020078config BOOT_ERASE_PROGRESSIVELY
79 bool "Erase flash progressively when receiving new firmware"
80 default y if SOC_NRF52840
81 help
82 If enabled, flash is erased as necessary when receiving new firmware,
83 instead of erasing the whole image slot at once. This is necessary
84 on some hardware that has long erase times, to prevent long wait
85 times at the beginning of the DFU process.
86
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040087config ZEPHYR_TRY_MASS_ERASE
88 bool "Try to mass erase flash when flashing MCUboot image"
89 default y
90 help
91 If y, attempt to configure the Zephyr build system's "flash"
92 target to mass-erase the flash device before flashing the
93 MCUboot image. This ensures the scratch and other partitions
94 are in a consistent state.
95
96 This is not available for all targets.
97
Fabio Utzig9a4b9ba2018-05-07 08:31:27 -030098config BOOT_HAVE_LOGGING
99 bool "MCUboot have logging enabled"
100 default y
101 select SYS_LOG
102 help
103 If y, enables logging on the serial port. The log level can
104 be defined by setting `SYS_LOG_DEFAULT_LEVEL`.
105 If unsure, leave at the default value.
106
Marti Bolivar0e091c92018-04-12 11:23:16 -0400107menuconfig MCUBOOT_SERIAL
108 bool "MCUboot serial recovery"
109 default n
110 select REBOOT
111 select UART_INTERRUPT_DRIVEN
112 select SERIAL
113 select BASE64
114 select TINYCBOR
115 help
116 If y, enables a serial-port based update mode. This allows
117 MCUboot itself to load update images into flash over a UART.
118 If unsure, leave at the default value.
119
120if MCUBOOT_SERIAL
121
122config BOOT_MAX_LINE_INPUT_LEN
123 int "Maximum command line length"
124 default 512
125 help
126 Maximum length of commands transported over the serial port.
127
128config BOOT_SERIAL_DETECT_PORT
129 string "GPIO device to trigger serial recovery mode"
130 default GPIO_0 if SOC_FAMILY_NRF
131 help
132 Zephyr GPIO device which contains the pin used to trigger
133 serial recovery mode.
134
135config BOOT_SERIAL_DETECT_PIN
136 int "Pin to trigger serial recovery mode"
137 default 11 if BOARD_NRF52840_PCA10056
138 default 13 if BOARD_NRF52_PCA10040
139 help
140 Pin on the serial detect port which triggers serial recovery mode.
141
142config BOOT_SERIAL_DETECT_PIN_VAL
143 int "Serial detect pin trigger value"
144 default 0
145 range 0 1
146 help
147 Logic value of the detect pin which triggers serial recovery
148 mode.
149
150endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200151
Andrzej Puzdrowski97543282018-04-12 15:16:56 +0200152endmenu
153
Carles Cufi84ede582018-01-29 15:12:00 +0100154config MCUBOOT_DEVICE_SETTINGS
155 # Hidden selector for device-specific settings
156 bool
157 default y
158 # CPU options
159 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100160 # Enable flash page layout if available
161 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200162 # Enable flash_map module as flash I/O back-end
163 select FLASH_MAP
Carles Cufi84ede582018-01-29 15:12:00 +0100164
165config MCUBOOT_DEVICE_CPU_CORTEX_M0
166 # Hidden selector for Cortex-M0 settings
167 bool
168 default n
169 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
170
Marti Bolivar0e091c92018-04-12 11:23:16 -0400171comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200172
Marti Bolivar0e091c92018-04-12 11:23:16 -0400173config ZEPHYR_BASE
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200174 string
Marti Bolivar0e091c92018-04-12 11:23:16 -0400175 option env="ZEPHYR_BASE"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200176
Marti Bolivar0e091c92018-04-12 11:23:16 -0400177source "$ZEPHYR_BASE/Kconfig.zephyr"