blob: e5f7358c61c1706115cd427209d5fa1f386b59a8 [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
31
32config BOOT_SIGNATURE_TYPE_ECDSA_P256
33 bool "Elliptic curve digital signatures with curve P-256"
34 select BOOT_USE_TINYCRYPT
35
36endchoice
37
38config BOOT_VALIDATE_SLOT0
39 bool "Validate image slot 0 on every boot"
40 default y
41 help
42 If y, the bootloader attempts to validate the signature of
43 slot0 every boot. This adds the signature check time to
44 every boot, but can mitigate against some changes that are
45 able to modify the flash image itself.
46
47config BOOT_UPGRADE_ONLY
48 bool "Overwrite image updates instead of swapping"
49 default n
50 help
51 If y, overwrite slot0 with the upgrade image instead of
52 swapping them. This prevents the fallback recovery, but
53 uses a much simpler code path.
54
Marti Bolivar0e091c92018-04-12 11:23:16 -040055config BOOT_MAX_IMG_SECTORS
56 int "Maximum number of sectors per image slot"
57 default 128
58 help
59 This option controls the maximum number of sectors that each of
60 the two image areas can contain. Smaller values reduce MCUboot's
61 memory usage; larger values allow it to support larger images.
62 If unsure, leave at the default value.
63
Marti Bolivarbc2fa4e2018-04-12 12:18:32 -040064config ZEPHYR_TRY_MASS_ERASE
65 bool "Try to mass erase flash when flashing MCUboot image"
66 default y
67 help
68 If y, attempt to configure the Zephyr build system's "flash"
69 target to mass-erase the flash device before flashing the
70 MCUboot image. This ensures the scratch and other partitions
71 are in a consistent state.
72
73 This is not available for all targets.
74
Marti Bolivar0e091c92018-04-12 11:23:16 -040075menuconfig MCUBOOT_SERIAL
76 bool "MCUboot serial recovery"
77 default n
78 select REBOOT
79 select UART_INTERRUPT_DRIVEN
80 select SERIAL
81 select BASE64
82 select TINYCBOR
83 help
84 If y, enables a serial-port based update mode. This allows
85 MCUboot itself to load update images into flash over a UART.
86 If unsure, leave at the default value.
87
88if MCUBOOT_SERIAL
89
90config BOOT_MAX_LINE_INPUT_LEN
91 int "Maximum command line length"
92 default 512
93 help
94 Maximum length of commands transported over the serial port.
95
96config BOOT_SERIAL_DETECT_PORT
97 string "GPIO device to trigger serial recovery mode"
98 default GPIO_0 if SOC_FAMILY_NRF
99 help
100 Zephyr GPIO device which contains the pin used to trigger
101 serial recovery mode.
102
103config BOOT_SERIAL_DETECT_PIN
104 int "Pin to trigger serial recovery mode"
105 default 11 if BOARD_NRF52840_PCA10056
106 default 13 if BOARD_NRF52_PCA10040
107 help
108 Pin on the serial detect port which triggers serial recovery mode.
109
110config BOOT_SERIAL_DETECT_PIN_VAL
111 int "Serial detect pin trigger value"
112 default 0
113 range 0 1
114 help
115 Logic value of the detect pin which triggers serial recovery
116 mode.
117
118endif # MCUBOOT_SERIAL
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200119
Carles Cufi84ede582018-01-29 15:12:00 +0100120config MCUBOOT_DEVICE_SETTINGS
121 # Hidden selector for device-specific settings
122 bool
123 default y
124 # CPU options
125 select MCUBOOT_DEVICE_CPU_CORTEX_M0 if CPU_CORTEX_M0
Carles Cufi67c792e2018-01-29 15:14:31 +0100126 # Enable flash page layout if available
127 select FLASH_PAGE_LAYOUT if FLASH_HAS_PAGE_LAYOUT
Carles Cufi84ede582018-01-29 15:12:00 +0100128
129config MCUBOOT_DEVICE_CPU_CORTEX_M0
130 # Hidden selector for Cortex-M0 settings
131 bool
132 default n
133 select SW_VECTOR_RELAY if !CPU_CORTEX_M0_HAS_VECTOR_TABLE_REMAP
134
Marti Bolivar0e091c92018-04-12 11:23:16 -0400135comment "Zephyr configuration options"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200136
Marti Bolivar0e091c92018-04-12 11:23:16 -0400137config ZEPHYR_BASE
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200138 string
Marti Bolivar0e091c92018-04-12 11:23:16 -0400139 option env="ZEPHYR_BASE"
Andrzej Puzdrowski64ad0922017-09-22 11:33:41 +0200140
Marti Bolivar0e091c92018-04-12 11:23:16 -0400141source "$ZEPHYR_BASE/Kconfig.zephyr"