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