blob: 888321b8461708781a5bc8bffead57fbb89a9c90 [file] [log] [blame]
Marti Bolivarf91bca52018-04-12 12:40:46 -04001/*
2 * Copyright (c) 2018 Open Source Foundries Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef __MCUBOOT_CONFIG_H__
8#define __MCUBOOT_CONFIG_H__
9
10/*
11 * Template configuration file for MCUboot.
12 *
13 * When porting MCUboot to a new target, copy it somewhere that your
14 * include path can find it as mcuboot_config/mcuboot_config.h, and
15 * make adjustments to suit your platform.
16 *
17 * For examples, see:
18 *
19 * boot/zephyr/include/mcuboot_config/mcuboot_config.h
20 * boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h
21 */
22
23/*
24 * Signature types
25 *
26 * You must choose exactly one signature type.
27 */
28
29/* Uncomment for RSA signature support */
30/* #define MCUBOOT_SIGN_RSA */
31
32/* Uncomment for ECDSA signatures using curve P-256. */
33/* #define MCUBOOT_SIGN_EC256 */
34
35
36/*
37 * Upgrade mode
38 *
39 * The default is to support A/B image swapping with rollback. A
40 * simpler code path, which only supports overwriting the
41 * existing image with the update image, is also available.
42 */
43
44/* Uncomment to enable the overwrite-only code path. */
45/* #define MCUBOOT_OVERWRITE_ONLY */
46
47#ifdef MCUBOOT_OVERWRITE_ONLY
48/* Uncomment to only erase and overwrite those slot 0 sectors needed
49 * to install the new image, rather than the entire image slot. */
50/* #define MCUBOOT_OVERWRITE_ONLY_FAST */
51#endif
52
53/*
54 * Cryptographic settings
55 *
56 * You must choose between mbedTLS and Tinycrypt as source of
57 * cryptographic primitives. Other cryptographic settings are also
58 * available.
59 */
60
61/* Uncomment to use ARM's mbedTLS cryptographic primitives */
62/* #define MCUBOOT_USE_MBED_TLS */
63/* Uncomment to use Tinycrypt's. */
64/* #define MCUBOOT_USE_TINYCRYPT */
65
66/*
67 * Always check the signature of the image in slot 0 before booting,
68 * even if no upgrade was performed. This is recommended if the boot
69 * time penalty is acceptable.
70 */
71#define MCUBOOT_VALIDATE_SLOT0
72
73/*
74 * Flash abstraction
75 */
76
77/* Uncomment if your flash map API supports flash_area_get_sectors().
78 * See the flash APIs for more details. */
79/* #define MCUBOOT_USE_FLASH_AREA_GET_SECTORS */
80
Marti Bolivarf9bfddd2018-04-24 14:28:33 -040081/* Default maximum number of flash sectors per image slot; change
82 * as desirable. */
83#define MCUBOOT_MAX_IMG_SECTORS 128
84
Marti Bolivar248da082018-04-24 15:11:39 -040085/*
Fabio Utzig7d817862018-05-07 08:09:01 -030086 * Logging
87 */
88
89/*
90 * If logging is enabled the following functions must be defined by the
91 * platform:
92 *
93 * MCUBOOT_LOG_ERR(...)
94 * MCUBOOT_LOG_WRN(...)
95 * MCUBOOT_LOG_INF(...)
96 * MCUBOOT_LOG_DBG(...)
97 *
98 * The following global logging level configuration macros must also be
99 * defined, each with a unique value. Those will be used to define a global
100 * configuration and will allow any source files to override the global
101 * configuration:
102 *
103 * MCUBOOT_LOG_LEVEL_OFF
104 * MCUBOOT_LOG_LEVEL_ERROR
105 * MCUBOOT_LOG_LEVEL_WARNING
106 * MCUBOOT_LOG_LEVEL_INFO
107 * MCUBOOT_LOG_LEVEL_DEBUG
108 *
109 * The global logging level must be defined, with one of the previously defined
110 * logging levels:
111 *
112 * #define MCUBOOT_LOG_LEVEL MCUBOOT_LOG_LEVEL_(OFF|ERROR|WARNING|INFO|DEBUG)
113 *
114 * MCUBOOT_LOG_LEVEL sets the minimum level that will be logged. The function
115 * priority is:
116 *
117 * MCUBOOT_LOG_ERR > MCUBOOT_LOG_WRN > MCUBOOT_LOG_INF > MCUBOOT_LOG_DBG
118 *
119 * NOTE: Each source file is still able to request its own logging level by
120 * defining BOOT_LOG_LEVEL before #including `bootutil_log.h`
121 */
122#define MCUBOOT_HAVE_LOGGING 1
123
124/*
Marti Bolivar248da082018-04-24 15:11:39 -0400125 * Assertions
126 */
127
128/* Uncomment if your platform has its own mcuboot_config/mcuboot_assert.h.
129 * If so, it must provide an ASSERT macro for use by bootutil. Otherwise,
130 * "assert" is used. */
131/* #define MCUBOOT_HAVE_ASSERT_H */
132
Marti Bolivarf91bca52018-04-12 12:40:46 -0400133#endif /* __MCUBOOT_CONFIG_H__ */