/* * Copyright (c) 2018 Open Source Foundries Limited * Copyright (c) 2019-2024 Arm Limited * * SPDX-License-Identifier: Apache-2.0 */ /* * Original code taken from mcuboot project at: * https://github.com/mcu-tools/mcuboot * Git SHA of the original version: ac55554059147fff718015be9f4bd3108123f50a */ #ifndef __MCUBOOT_CONFIG_H__ #define __MCUBOOT_CONFIG_H__ #ifdef __cplusplus extern "C" { #endif /* * This file is also included by the simulator, but we don't want to * define anything here in simulator builds. * * Instead of using mcuboot_config.h, the simulator adds MCUBOOT_xxx * configuration flags to the compiler command lines based on the * values of environment variables. However, the file still must * exist, or bootutil won't build. */ #ifndef __BOOTSIM__ #define MCUBOOT_VALIDATE_PRIMARY_SLOT #define MCUBOOT_USE_FLASH_AREA_GET_SECTORS #define MCUBOOT_TARGET_CONFIG "flash_layout.h" #cmakedefine MCUBOOT_HW_ROLLBACK_PROT #cmakedefine MCUBOOT_MEASURED_BOOT #cmakedefine MCUBOOT_DATA_SHARING #cmakedefine MCUBOOT_BOOTSTRAP /* * Maximum size of the measured boot record. * * Its size can be calculated based on the following aspects: * - There are 5 allowed software component claims * (SW type, version, signer ID, measurement description and value), * - SHA256/SHA384 is used as the measurement method meaning that the * measurement value and signer ID are 32/48 bytes long, * Considering these aspects and the fact that the string-like claim values * vary in length but have a maximum value, the maximum size of a boot record * can be calculated. */ #ifdef MCUBOOT_SIGN_EC384 #define MAX_BOOT_RECORD_SZ (164u) #else #define MAX_BOOT_RECORD_SZ (132u) #endif /* MCUBOOT_SIGN_EC384 */ #cmakedefine MCUBOOT_ENC_IMAGES #cmakedefine MCUBOOT_ENCRYPT_RSA #ifdef MCUBOOT_ENC_IMAGES #define MCUBOOT_AES_@MCUBOOT_ENC_KEY_LEN@ #endif /* MCUBOOT_ENC_IMAGES */ #define MCUBOOT_BOOT_MAX_ALIGN @MCUBOOT_BOOT_MAX_ALIGN@ /* * Cryptographic settings */ /* MCUboot and TF-M also supports the usage of PSA Crypto API along with * Mbed TLS as the source of cryptographic primitives. However, the support for * MCUBOOT_USE_PSA_CRYPTO is still limited and it doesn't cover all the * crypto abstractions of MCUboot. For this reason it's allowed to have both * of them defined, in which case MCUBOOT_USE_PSA_CRYPTO will take precedence. */ #define MCUBOOT_USE_MBED_TLS /* * Logging */ #define MCUBOOT_HAVE_LOGGING 1 #define MCUBOOT_LOG_LEVEL @LOG_LEVEL_ID@ #endif /* !__BOOTSIM__ */ /* * Watchdog feeding */ #define MCUBOOT_WATCHDOG_FEED() \ do { \ /* Do nothing. */ \ } while (0) #ifdef __cplusplus } #endif #endif /* __MCUBOOT_CONFIG_H__ */