1# Copyright (c) 2022 Nordic Semiconductor
2#
3# SPDX-License-Identifier: Apache-2.0
4
5config SUPPORT_BOOTLOADER
6	bool
7	default y
8
9config SUPPORT_BOOTLOADER_MCUBOOT_ZEPHYR
10	bool
11	default y
12
13choice BOOTLOADER
14	prompt "Bootloader support"
15	default BOOTLOADER_NONE
16	depends on SUPPORT_BOOTLOADER
17
18config BOOTLOADER_NONE
19	bool "None"
20	help
21	  Do not Include a bootloader in the build
22
23config BOOTLOADER_MCUBOOT
24	bool "MCUboot"
25	depends on SUPPORT_BOOTLOADER_MCUBOOT_ZEPHYR
26	help
27	  Include MCUboot (Zephyr port) as the bootloader to use
28
29endchoice
30
31if BOOTLOADER_MCUBOOT
32
33config SIGNATURE_TYPE
34	string
35	default NONE if BOOT_SIGNATURE_TYPE_NONE
36	default RSA  if BOOT_SIGNATURE_TYPE_RSA
37	default ECDSA_P256 if BOOT_SIGNATURE_TYPE_ECDSA_P256
38	default ED25519 if BOOT_SIGNATURE_TYPE_ED25519
39
40choice BOOT_SIGNATURE_TYPE
41	prompt "Signature type"
42	default BOOT_SIGNATURE_TYPE_RSA
43
44config BOOT_SIGNATURE_TYPE_NONE
45	bool "No signature; use only hash check"
46
47config BOOT_SIGNATURE_TYPE_RSA
48	bool "RSA signatures"
49
50config BOOT_SIGNATURE_TYPE_ECDSA_P256
51	bool "Elliptic curve digital signatures with curve P-256"
52
53config BOOT_SIGNATURE_TYPE_ED25519
54	bool "Edwards curve digital signatures using ed25519"
55
56endchoice
57
58config BOOT_SIGNATURE_KEY_FILE
59	string "Signing PEM key file" if !BOOT_SIGNATURE_TYPE_NONE
60	default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-ec-p256.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256
61	default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-ed25519.pem" if BOOT_SIGNATURE_TYPE_ED25519
62	default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/root-rsa-2048.pem" if BOOT_SIGNATURE_TYPE_RSA
63	default ""
64	help
65	  Absolute path to signing key file to use with MCUBoot.
66
67config BOOT_ENCRYPTION
68	bool "Encrypted image support"
69	depends on !BOOT_SIGNATURE_TYPE_NONE
70	help
71	  Support encrypted images.
72
73config BOOT_ENCRYPTION_KEY_FILE
74	string "Encryption PEM key file"
75	depends on BOOT_ENCRYPTION
76	default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/enc-ec256-priv.pem" if BOOT_SIGNATURE_TYPE_ECDSA_P256
77	default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/enc-x25519-priv.pem" if BOOT_SIGNATURE_TYPE_ED25519
78	default "$(ZEPHYR_MCUBOOT_MODULE_DIR)/enc-rsa2048-priv.pem" if BOOT_SIGNATURE_TYPE_RSA
79	default ""
80	help
81	  Absolute path to encryption key file to use with MCUBoot.
82
83endif
84