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 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 10 | config BOOT_USE_MBEDTLS |
| 11 | bool |
| 12 | # Hidden option |
| 13 | default n |
| 14 | help |
| 15 | Use mbedTLS for crypto primitives. |
| 16 | |
| 17 | config BOOT_USE_TINYCRYPT |
| 18 | bool |
| 19 | # Hidden option |
| 20 | default n |
| 21 | help |
| 22 | Use TinyCrypt for crypto primitives. |
| 23 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame^] | 24 | menu "MCUBoot settings" |
| 25 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 26 | choice |
| 27 | prompt "Signature type" |
| 28 | default BOOT_SIGNATURE_TYPE_RSA |
| 29 | |
| 30 | config BOOT_SIGNATURE_TYPE_RSA |
| 31 | bool "RSA signatures" |
| 32 | select BOOT_USE_MBEDTLS |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 33 | select MBEDTLS |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 34 | |
| 35 | config BOOT_SIGNATURE_TYPE_ECDSA_P256 |
| 36 | bool "Elliptic curve digital signatures with curve P-256" |
| 37 | select BOOT_USE_TINYCRYPT |
| 38 | |
| 39 | endchoice |
| 40 | |
Marti Bolivar | a4818a5 | 2018-04-12 13:02:38 -0400 | [diff] [blame] | 41 | config MBEDTLS_CFG_FILE |
| 42 | default "mcuboot-mbedtls-cfg.h" |
| 43 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 44 | config BOOT_VALIDATE_SLOT0 |
| 45 | bool "Validate image slot 0 on every boot" |
| 46 | default y |
| 47 | help |
| 48 | If y, the bootloader attempts to validate the signature of |
| 49 | slot0 every boot. This adds the signature check time to |
| 50 | every boot, but can mitigate against some changes that are |
| 51 | able to modify the flash image itself. |
| 52 | |
| 53 | config BOOT_UPGRADE_ONLY |
| 54 | bool "Overwrite image updates instead of swapping" |
| 55 | default n |
| 56 | help |
| 57 | If y, overwrite slot0 with the upgrade image instead of |
| 58 | swapping them. This prevents the fallback recovery, but |
| 59 | uses a much simpler code path. |
| 60 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 61 | config BOOT_MAX_IMG_SECTORS |
| 62 | int "Maximum number of sectors per image slot" |
| 63 | default 128 |
| 64 | help |
| 65 | This option controls the maximum number of sectors that each of |
| 66 | the two image areas can contain. Smaller values reduce MCUboot's |
| 67 | memory usage; larger values allow it to support larger images. |
| 68 | If unsure, leave at the default value. |
| 69 | |
Marti Bolivar | bc2fa4e | 2018-04-12 12:18:32 -0400 | [diff] [blame] | 70 | config ZEPHYR_TRY_MASS_ERASE |
| 71 | bool "Try to mass erase flash when flashing MCUboot image" |
| 72 | default y |
| 73 | help |
| 74 | If y, attempt to configure the Zephyr build system's "flash" |
| 75 | target to mass-erase the flash device before flashing the |
| 76 | MCUboot image. This ensures the scratch and other partitions |
| 77 | are in a consistent state. |
| 78 | |
| 79 | This is not available for all targets. |
| 80 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 81 | menuconfig MCUBOOT_SERIAL |
| 82 | bool "MCUboot serial recovery" |
| 83 | default n |
| 84 | select REBOOT |
| 85 | select UART_INTERRUPT_DRIVEN |
| 86 | select SERIAL |
| 87 | select BASE64 |
| 88 | select TINYCBOR |
| 89 | help |
| 90 | If y, enables a serial-port based update mode. This allows |
| 91 | MCUboot itself to load update images into flash over a UART. |
| 92 | If unsure, leave at the default value. |
| 93 | |
| 94 | if MCUBOOT_SERIAL |
| 95 | |
| 96 | config BOOT_MAX_LINE_INPUT_LEN |
| 97 | int "Maximum command line length" |
| 98 | default 512 |
| 99 | help |
| 100 | Maximum length of commands transported over the serial port. |
| 101 | |
| 102 | config BOOT_SERIAL_DETECT_PORT |
| 103 | string "GPIO device to trigger serial recovery mode" |
| 104 | default GPIO_0 if SOC_FAMILY_NRF |
| 105 | help |
| 106 | Zephyr GPIO device which contains the pin used to trigger |
| 107 | serial recovery mode. |
| 108 | |
| 109 | config BOOT_SERIAL_DETECT_PIN |
| 110 | int "Pin to trigger serial recovery mode" |
| 111 | default 11 if BOARD_NRF52840_PCA10056 |
| 112 | default 13 if BOARD_NRF52_PCA10040 |
| 113 | help |
| 114 | Pin on the serial detect port which triggers serial recovery mode. |
| 115 | |
| 116 | config BOOT_SERIAL_DETECT_PIN_VAL |
| 117 | int "Serial detect pin trigger value" |
| 118 | default 0 |
| 119 | range 0 1 |
| 120 | help |
| 121 | Logic value of the detect pin which triggers serial recovery |
| 122 | mode. |
| 123 | |
| 124 | endif # MCUBOOT_SERIAL |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 125 | |
Andrzej Puzdrowski | 9754328 | 2018-04-12 15:16:56 +0200 | [diff] [blame^] | 126 | endmenu |
| 127 | |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 128 | config MCUBOOT_DEVICE_SETTINGS |
| 129 | # Hidden selector for device-specific settings |
| 130 | bool |
| 131 | default y |
| 132 | # CPU options |
| 133 | select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0 |
Carles Cufi | 67c792e | 2018-01-29 15:14:31 +0100 | [diff] [blame] | 134 | # Enable flash page layout if available |
| 135 | select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT |
Andrzej Puzdrowski | b788c71 | 2018-04-12 12:42:49 +0200 | [diff] [blame] | 136 | # Enable flash_map module as flash I/O back-end |
| 137 | select FLASH_MAP |
Carles Cufi | 84ede58 | 2018-01-29 15:12:00 +0100 | [diff] [blame] | 138 | |
| 139 | config MCUBOOT_DEVICE_CPU_CORTEX_M0 |
| 140 | # Hidden selector for Cortex-M0 settings |
| 141 | bool |
| 142 | default n |
| 143 | select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP |
| 144 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 145 | comment "Zephyr configuration options" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 146 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 147 | config ZEPHYR_BASE |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 148 | string |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 149 | option env="ZEPHYR_BASE" |
Andrzej Puzdrowski | 64ad092 | 2017-09-22 11:33:41 +0200 | [diff] [blame] | 150 | |
Marti Bolivar | 0e091c9 | 2018-04-12 11:23:16 -0400 | [diff] [blame] | 151 | source "$ZEPHYR_BASE/Kconfig.zephyr" |