Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 1 | # Copyright (c) 2017 Linaro Limited |
| 2 | # |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | # |
| 5 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 6 | mainmenu "MCUboot configuration" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 7 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 8 | comment "MCUboot-specific configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 9 | |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 10 | # Hidden option to mark a project as MCUboot |
| 11 | config MCUBOOT |
| 12 | default y |
| 13 | bool |
Rajavardhan Gundi | 07ba28f | 2018-12-10 15:44:48 +0530 | [diff] [blame^] | 14 | select MPU_ALLOW_FLASH_WRITE if ARM_MPU |
Emanuele Di Santo | 865777d | 2018-11-08 11:28:15 +0100 | [diff] [blame] | 15 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 16 | config BOOT_USE_MBEDTLS |
| 17 | bool |
| 18 | # Hidden option |
| 19 | default n |
| 20 | help |
| 21 | Use mbedTLS for crypto primitives. |
| 22 | |
| 23 | config BOOT_USE_TINYCRYPT |
| 24 | bool |
| 25 | # Hidden option |
| 26 | default n |
| 27 | help |
| 28 | Use TinyCrypt for crypto primitives. |
| 29 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 30 | menu "MCUBoot settings" |
| 31 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 32 | choice |
| 33 | prompt "Signature type" |
| 34 | default BOOT_SIGNATURE_TYPE_RSA |
| 35 | |
| 36 | config BOOT_SIGNATURE_TYPE_RSA |
| 37 | bool "RSA signatures" |
| 38 | select BOOT_USE_MBEDTLS |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 39 | select MBEDTLS |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 40 | |
| 41 | config BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 42 | bool "Elliptic curve digital signatures with curve P-256" |
| 43 | select BOOT_USE_TINYCRYPT |
| 44 | |
| 45 | endchoice |
| 46 | |
Fabio Utzig | c690c76 | 2018-04-26 10:51:09 -0300 | [diff] [blame] | 47 | config 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 Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 55 | config MBEDTLS_CFG_FILE |
| 56 | default "mcuboot-mbedtls-cfg.h" |
| 57 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 58 | config 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 | |
| 67 | config 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 Utzig | 5fe874c | 2018-08-31 07:41:50 -0300 | [diff] [blame] | 75 | config 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 Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 83 | config 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 Santo | 205c8c6 | 2018-07-20 11:42:31 +0200 | [diff] [blame] | 92 | config 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 Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 101 | config 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 Utzig | 9a4b9ba | 2018-05-07 08:31:27 -0300 | [diff] [blame] | 112 | config 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 Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 121 | menuconfig 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 | |
| 134 | if MCUBOOT_SERIAL |
| 135 | |
Emanuele Di Santo | c4bf780 | 2018-07-20 11:39:57 +0200 | [diff] [blame] | 136 | choice |
| 137 | prompt "Serial device" |
| 138 | default BOOT_SERIAL_UART if !BOARD_NRF52840_PCA10059 |
| 139 | default BOOT_SERIAL_CDC_ACM if BOARD_NRF52840_PCA10059 |
| 140 | |
| 141 | config BOOT_SERIAL_UART |
| 142 | bool "UART" |
| 143 | # SERIAL and UART_INTERRUPT_DRIVEN already selected |
| 144 | |
| 145 | config BOOT_SERIAL_CDC_ACM |
| 146 | bool "CDC ACM" |
| 147 | select USB |
| 148 | select USB_DEVICE_STACK |
| 149 | select USB_CDC_ACM |
| 150 | |
| 151 | endchoice |
| 152 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 153 | config 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 | |
| 159 | config 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 | |
| 166 | config 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 | |
| 173 | config 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 | |
| 181 | endif # MCUBOOT_SERIAL |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 182 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame] | 183 | endmenu |
| 184 | |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 185 | config 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 Cufi | 67c792e | 2018-01-29 15:14:31 +0100 | [diff] [blame] | 191 | # Enable flash page layout if available |
| 192 | select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT |
Andrzej Puzdrowski | b788c71 | 2018-04-12 12:42:49 +0200 | [diff] [blame] | 193 | # Enable flash_map module as flash I/O back-end |
| 194 | select FLASH_MAP |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 195 | |
| 196 | config 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 Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 202 | comment "Zephyr configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 203 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 204 | config ZEPHYR_BASE |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 205 | string |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 206 | option env="ZEPHYR_BASE" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 207 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 208 | source "$ZEPHYR_BASE/Kconfig.zephyr" |