Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Raef Coles | 88ff799 | 2024-01-11 10:27:05 +0000 | [diff] [blame] | 2 | # Copyright (c) 2020-2024, Arm Limited. All rights reserved. |
Chris Brand | cae2026 | 2022-06-23 12:05:33 -0700 | [diff] [blame] | 3 | # Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company) |
| 4 | # or an affiliate of Cypress Semiconductor Corporation. All rights reserved. |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 5 | # |
| 6 | # SPDX-License-Identifier: BSD-3-Clause |
| 7 | # |
| 8 | #------------------------------------------------------------------------------- |
| 9 | |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 10 | #################################################################################################### |
| 11 | # These configurations below are not included in Kconfig configuration system. |
| 12 | |
Raef Coles | 6981732 | 2020-10-19 14:14:14 +0100 | [diff] [blame] | 13 | set(TFM_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/toolchain_GNUARM.cmake CACHE FILEPATH "Path to TFM compiler toolchain file") |
Øyvind Rønningstad | a9d5eac | 2021-01-22 14:21:25 +0100 | [diff] [blame] | 14 | set(TFM_PLATFORM "" CACHE STRING "Platform to build TF-M for. Must be either a relative path from [TF-M]/platform/ext/target, or an absolute path.") |
Raef Coles | 6981732 | 2020-10-19 14:14:14 +0100 | [diff] [blame] | 15 | set(CROSS_COMPILE arm-none-eabi CACHE STRING "Cross-compilation triplet") |
| 16 | |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 17 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/api_ns CACHE PATH "Install prefix") |
| 18 | |
| 19 | set(INTERFACE_INC_DIR ${CMAKE_SOURCE_DIR}/interface/include) |
| 20 | set(INTERFACE_SRC_DIR ${CMAKE_SOURCE_DIR}/interface/src) |
| 21 | |
| 22 | set(INSTALL_INTERFACE_INC_DIR ${CMAKE_INSTALL_PREFIX}/interface/include) |
| 23 | set(INSTALL_INTERFACE_SRC_DIR ${CMAKE_INSTALL_PREFIX}/interface/src) |
| 24 | set(INSTALL_INTERFACE_LIB_DIR ${CMAKE_INSTALL_PREFIX}/interface/lib) |
| 25 | set(INSTALL_IMAGE_SIGNING_DIR ${CMAKE_INSTALL_PREFIX}/image_signing) |
| 26 | set(INSTALL_CMAKE_DIR ${CMAKE_INSTALL_PREFIX}/cmake) |
Jianliang Shen | bd624ed | 2023-10-24 15:42:59 +0800 | [diff] [blame] | 27 | set(INSTALL_CONFIG_DIR ${CMAKE_INSTALL_PREFIX}/config) |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 28 | set(INSTALL_PLATFORM_NS_DIR ${CMAKE_INSTALL_PREFIX}/platform) |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 29 | |
| 30 | set(TFM_DEBUG_SYMBOLS ON CACHE BOOL "Add debug symbols. Note that setting CMAKE_BUILD_TYPE to Debug or RelWithDebInfo will also add debug symbols.") |
| 31 | set(TFM_CODE_COVERAGE OFF CACHE BOOL "Whether to build the binary for lcov tools") |
| 32 | |
Tomi Fontanilles | 17e9e9c | 2024-05-15 12:44:46 +0300 | [diff] [blame] | 33 | set(TFM_TESTS_REVISION_CHECKS ON CACHE BOOL "Whether to perform checks on the tf-m-tests repository revision.") |
| 34 | |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 35 | set(PROJECT_CONFIG_HEADER_FILE "" CACHE FILEPATH "User defined header file for TF-M config") |
| 36 | |
| 37 | # External libraries source and version |
| 38 | set(MBEDCRYPTO_PATH "DOWNLOAD" CACHE PATH "Path to Mbed Crypto (or DOWNLOAD to fetch automatically") |
| 39 | set(MBEDCRYPTO_FORCE_PATCH OFF CACHE BOOL "Always apply MBed Crypto patches") |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 40 | set(MBEDCRYPTO_VERSION "mbedtls-3.6.0" CACHE STRING "The version of Mbed Crypto to use") |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 41 | set(MBEDCRYPTO_GIT_REMOTE "https://github.com/Mbed-TLS/mbedtls.git" CACHE STRING "The URL (or path) to retrieve MbedTLS from.") |
| 42 | |
| 43 | set(MCUBOOT_PATH "DOWNLOAD" CACHE PATH "Path to MCUboot (or DOWNLOAD to fetch automatically") |
Jamie McCrae | eb8ff0d | 2024-08-14 09:38:10 +0100 | [diff] [blame] | 44 | set(MCUBOOT_VERSION "6071ceb" CACHE STRING "The version of MCUboot to use") |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 45 | |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 46 | set(PLATFORM_PSA_ADAC_SECURE_DEBUG FALSE CACHE BOOL "Whether to use psa-adac secure debug.") |
| 47 | set(PLATFORM_PSA_ADAC_SOURCE_PATH "DOWNLOAD" CACHE PATH "Path to source dir of psa-adac.") |
Jamie Fox | 7a9b7c7 | 2024-02-20 11:43:26 +0000 | [diff] [blame] | 48 | set(PLATFORM_PSA_ADAC_VERSION "5f5490cebe66" CACHE STRING "The version of psa-adac to use.") |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 49 | |
| 50 | set(PLATFORM_IS_FVP FALSE CACHE BOOL "Whether to enable FVP or FPGA build of the platform.") |
| 51 | |
Raef Coles | 88ff799 | 2024-01-11 10:27:05 +0000 | [diff] [blame] | 52 | set(CODE_SHARING_OUTPUT_FILE_SUFFIX "_shared_symbols.axf" CACHE STRING "Suffix to use for code-sharing output files") |
| 53 | set(CODE_SHARING_INPUT_FILE_SUFFIX "_shared_symbols.axf" CACHE STRING "Suffix to use for code-sharing input files") |
| 54 | |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 55 | #################################################################################################### |
| 56 | # These configurations below are also referred by Kconfig configuration system, |
| 57 | # together with TF-M Header File Config System options. |
| 58 | |
Raef Coles | 15a37f8 | 2021-12-07 15:59:14 +0000 | [diff] [blame] | 59 | set(BL1 OFF CACHE BOOL "Whether to build BL1") |
Raef Coles | f0ba05b | 2021-11-25 09:57:17 +0000 | [diff] [blame] | 60 | set(BL2 ON CACHE BOOL "Whether to build BL2") |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 61 | set(NS_EVALUATION_APP_PATH "" CACHE PATH "Path to TFM NS Evaluation Application") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 62 | |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 63 | set(TFM_ISOLATION_LEVEL 1 CACHE STRING "Isolation level") |
Kevin Peng | 386374c | 2021-11-04 14:36:17 +0800 | [diff] [blame] | 64 | set(PSA_FRAMEWORK_HAS_MM_IOVEC OFF CACHE BOOL "Enable MM-IOVEC") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 65 | set(TFM_PROFILE "" CACHE STRING "Profile to use") |
Tamas Ban | b881bea | 2020-11-04 16:18:36 +0000 | [diff] [blame] | 66 | set(TFM_FIH_PROFILE OFF CACHE STRING "Fault injection hardening profile [OFF, LOW, MEDIUM, HIGH]") |
Anton Komlev | a07180c | 2022-10-24 23:53:47 +0100 | [diff] [blame] | 67 | set(CONFIG_TFM_SPM_BACKEND "SFN" CACHE STRING "The SPM backend [IPC, SFN]") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 68 | |
Sherry Zhnag | 482b88b | 2021-08-19 17:51:47 +0800 | [diff] [blame] | 69 | # An NSPE client_id is provided by the NSPE OS via the SPM or directly by the SPM. |
| 70 | # When `TFM_NS_MANAGE_NSID` is `ON`, TF-M supports NSPE OS providing NSPE client_id. |
| 71 | set(TFM_NS_MANAGE_NSID OFF CACHE BOOL "Support NSPE OS providing NSPE client_id") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 72 | |
| 73 | set(TFM_EXTRA_CONFIG_PATH "" CACHE PATH "Path to extra cmake config file") |
Kevin Peng | 3880066 | 2021-07-14 10:28:23 +0800 | [diff] [blame] | 74 | |
| 75 | set(TFM_MANIFEST_LIST ${CMAKE_SOURCE_DIR}/tools/tfm_manifest_list.yaml CACHE FILEPATH "TF-M native Secure Partition manifests list file") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 76 | |
Tamas Ban | f8b0b2d | 2020-10-26 13:03:13 +0000 | [diff] [blame] | 77 | set(TFM_CODE_SHARING OFF CACHE PATH "Enable code sharing between MCUboot and secure firmware") |
David Vincze | a6f501e | 2021-06-14 10:42:30 +0200 | [diff] [blame] | 78 | set(CONFIG_TFM_BOOT_STORE_MEASUREMENTS ON CACHE BOOL "Store measurement values from all the boot stages. Used for initial attestation token.") |
David Vincze | 8c95d2a | 2022-01-19 10:11:58 +0100 | [diff] [blame] | 79 | set(CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS ON CACHE BOOL "Enable storing of encoded measurements in boot.") |
Tamas Ban | f8b0b2d | 2020-10-26 13:03:13 +0000 | [diff] [blame] | 80 | |
Summer Qin | d839593 | 2021-02-25 14:56:49 +0800 | [diff] [blame] | 81 | set(TFM_PXN_ENABLE OFF CACHE BOOL "Use Privileged execute never (PXN)") |
| 82 | |
Øyvind Rønningstad | f2c8dad | 2021-01-15 15:33:33 +0100 | [diff] [blame] | 83 | set(TFM_EXCEPTION_INFO_DUMP OFF CACHE BOOL "On fatal errors in the secure firmware, capture info about the exception. Print the info if the SPM log level is sufficient.") |
Raef Coles | 78cba2a | 2024-03-04 10:09:20 +0000 | [diff] [blame] | 84 | set(TFM_LOG_FATAL_ERRORS OFF CACHE BOOL "Log fatal errors when they occur to aid debugging") |
| 85 | set(TFM_LOG_NONFATAL_ERRORS OFF CACHE BOOL "Log non-fatal errors when they occur to aid debugging") |
| 86 | set(TFM_HALT_ON_FATAL_ERRORS OFF CACHE BOOL "On fatal errors in the secure firmware, halt immediately to allow debugging") |
| 87 | set(TFM_LOG_ERR_FILE_AND_LINE OFF CACHE BOOL "Log file name and line numbers of fatal and non-fatal errors") |
Øyvind Rønningstad | f2c8dad | 2021-01-15 15:33:33 +0100 | [diff] [blame] | 88 | |
Sebastian Bøe | 055d83a | 2022-02-21 12:01:41 +0100 | [diff] [blame] | 89 | set(CONFIG_TFM_HALT_ON_CORE_PANIC OFF CACHE BOOL "On fatal errors in the secure firmware, halt instead of rebooting.") |
Jackson Cooper-Driver | c024948 | 2024-07-09 10:34:36 +0100 | [diff] [blame^] | 90 | set(CONFIG_TFM_BACKTRACE_ON_CORE_PANIC OFF CACHE BOOL "On fatal errors in secure firmware, log backtrace and then halt") |
Sebastian Bøe | 055d83a | 2022-02-21 12:01:41 +0100 | [diff] [blame] | 91 | |
Chris Brand | 30106ba | 2022-01-13 13:48:50 -0800 | [diff] [blame] | 92 | set(CONFIG_TFM_STACK_WATERMARKS OFF CACHE BOOL "Whether to pre-fill partition stacks with a set value to help determine stack usage") |
| 93 | |
Nicola Mazzucato | fc1bf77 | 2024-05-07 16:21:33 +0100 | [diff] [blame] | 94 | set(CONFIG_TFM_BRANCH_PROTECTION_FEAT BRANCH_PROTECTION_DISABLED CACHE STRING "Set default branch protection usage to disabled") |
| 95 | |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 96 | ############################ Platform ########################################## |
| 97 | |
David Hu | 8b526d4 | 2020-11-27 20:59:52 +0800 | [diff] [blame] | 98 | set(NUM_MAILBOX_QUEUE_SLOT 1 CACHE BOOL "Number of mailbox queue slots") |
Mark Horvath | dadc1ea | 2021-03-12 15:39:25 +0100 | [diff] [blame] | 99 | set(TFM_PLAT_SPECIFIC_MULTI_CORE_COMM OFF CACHE BOOL "Whether to use a platform specific inter-core communication instead of mailbox in dual-cpu topology") |
David Hu | 6086394 | 2020-10-14 14:49:19 +0800 | [diff] [blame] | 100 | |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 101 | set(DEBUG_AUTHENTICATION CHIP_DEFAULT CACHE STRING "Debug authentication setting. [CHIP_DEFAULT, NONE, NS_ONLY, FULL") |
| 102 | set(SECURE_UART1 OFF CACHE BOOL "Enable secure UART1") |
| 103 | |
| 104 | set(CRYPTO_HW_ACCELERATOR OFF CACHE BOOL "Whether to enable the crypto hardware accelerator on supported platforms") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 105 | |
Raef Coles | 148b947 | 2021-06-18 08:48:17 +0100 | [diff] [blame] | 106 | set(OTP_NV_COUNTERS_RAM_EMULATION OFF CACHE BOOL "Enable OTP/NV_COUNTERS emulation in RAM. Has no effect on non-default implementations of the OTP and NV_COUNTERS") |
Raef Coles | 249aba9 | 2022-06-16 10:20:29 +0100 | [diff] [blame] | 107 | set(TFM_NS_NV_COUNTER_AMOUNT 0 CACHE STRING "How many NS NV counters are enabled") |
Raef Coles | 148b947 | 2021-06-18 08:48:17 +0100 | [diff] [blame] | 108 | |
Aziz IDOMAR | 83d3de5 | 2024-04-12 20:14:53 +0100 | [diff] [blame] | 109 | set(PLATFORM_ERROR_CODES OFF CACHE BOOL "Whether to use platform-specific error codes.") |
Raef Coles | 15a37f8 | 2021-12-07 15:59:14 +0000 | [diff] [blame] | 110 | |
Aziz IDOMAR | 83d3de5 | 2024-04-12 20:14:53 +0100 | [diff] [blame] | 111 | set(PLATFORM_DEFAULT_BL1 ON CACHE STRING "Whether to use default BL1 or platform-specific one") |
Raef Coles | 33ff153 | 2021-06-18 09:18:08 +0100 | [diff] [blame] | 112 | set(PLATFORM_DEFAULT_ATTEST_HAL ON CACHE BOOL "Use default attest hal implementation.") |
Roman Mazurak | 1e5fbbd | 2024-05-20 21:17:26 +0300 | [diff] [blame] | 113 | set(PLATFORM_DEFAULT_ITS_HAL ON CACHE BOOL "Use default ITS HAL implementation.") |
| 114 | set(PLATFORM_DEFAULT_PS_HAL ON CACHE BOOL "Use default Protected Storage HAL implementation.") |
Raef Coles | 33ff153 | 2021-06-18 09:18:08 +0100 | [diff] [blame] | 115 | set(PLATFORM_DEFAULT_NV_COUNTERS ON CACHE BOOL "Use default nv counter implementation.") |
| 116 | set(PLATFORM_DEFAULT_CRYPTO_KEYS ON CACHE BOOL "Use default crypto keys implementation.") |
| 117 | set(PLATFORM_DEFAULT_ROTPK ON CACHE BOOL "Use default root of trust public key.") |
| 118 | set(PLATFORM_DEFAULT_IAK ON CACHE BOOL "Use default initial attestation_key.") |
| 119 | set(PLATFORM_DEFAULT_UART_STDOUT ON CACHE BOOL "Use default uart stdout implementation.") |
| 120 | set(PLATFORM_DEFAULT_NV_SEED ON CACHE BOOL "Use default NV seed implementation.") |
Raef Coles | 148b947 | 2021-06-18 08:48:17 +0100 | [diff] [blame] | 121 | set(PLATFORM_DEFAULT_OTP ON CACHE BOOL "Use trusted on-chip flash to implement OTP memory") |
Michel Jaouen | d0fd8d9 | 2021-10-14 09:22:41 +0200 | [diff] [blame] | 122 | set(PLATFORM_DEFAULT_OTP_WRITEABLE ON CACHE BOOL "Use OTP memory with write support") |
Raef Coles | aefbe08 | 2021-06-18 08:53:43 +0100 | [diff] [blame] | 123 | set(PLATFORM_DEFAULT_PROVISIONING ON CACHE BOOL "Use default provisioning implementation") |
Raef Coles | 236c188 | 2022-09-13 13:35:43 +0100 | [diff] [blame] | 124 | set(PLATFORM_DEFAULT_SYSTEM_RESET_HALT ON CACHE BOOL "Use default system reset/halt implementation") |
Raef Coles | b5be31b | 2022-11-01 11:42:42 +0000 | [diff] [blame] | 125 | set(PLATFORM_DEFAULT_IMAGE_SIGNING ON CACHE BOOL "Use default image signing implementation") |
Raef Coles | aefbe08 | 2021-06-18 08:53:43 +0100 | [diff] [blame] | 126 | |
| 127 | set(TFM_DUMMY_PROVISIONING ON CACHE BOOL "Provision with dummy values. NOT to be used in production") |
Satish Kumar | e945bc2 | 2021-07-31 08:26:27 +0100 | [diff] [blame] | 128 | |
Raef Coles | 15a37f8 | 2021-12-07 15:59:14 +0000 | [diff] [blame] | 129 | set(BL1_HEADER_SIZE 0x000 CACHE STRING "BL1 Header size") |
| 130 | set(BL1_TRAILER_SIZE 0x000 CACHE STRING "BL1 Trailer size") |
| 131 | |
Raef Coles | f0ba05b | 2021-11-25 09:57:17 +0000 | [diff] [blame] | 132 | set(BL2_HEADER_SIZE 0x000 CACHE STRING "BL2 Header size") |
| 133 | set(BL2_TRAILER_SIZE 0x000 CACHE STRING "BL2 Trailer size") |
| 134 | |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 135 | ############################ Partitions ######################################## |
Xinyu Zhang | 77668dd | 2022-10-24 16:17:37 +0800 | [diff] [blame] | 136 | set(TFM_PARTITION_PROTECTED_STORAGE OFF CACHE BOOL "Enable Protected Storage partition") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 137 | set(PS_ENCRYPTION ON CACHE BOOL "Enable encryption for Protected Storage partition") |
Chris Brand | e8d48d7 | 2024-07-24 12:19:07 -0700 | [diff] [blame] | 138 | set(PS_SUPPORT_FORMAT_TRANSITION OFF CACHE BOOL "Enable reading the older format of Protected Storage data") |
Jamie Fox | 865778b | 2020-10-23 19:52:51 +0100 | [diff] [blame] | 139 | set(PS_CRYPTO_AEAD_ALG PSA_ALG_GCM CACHE STRING "The AEAD algorithm to use for authenticated encryption in Protected Storage") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 140 | |
Xinyu Zhang | 77668dd | 2022-10-24 16:17:37 +0800 | [diff] [blame] | 141 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE OFF CACHE BOOL "Enable Internal Trusted Storage partition") |
Markus Swarowsky | 7de096f | 2023-03-16 10:32:02 +0100 | [diff] [blame] | 142 | set(ITS_ENCRYPTION OFF CACHE BOOL "Enable authenticated encryption of ITS files using platform specific APIs") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 143 | |
Xinyu Zhang | 77668dd | 2022-10-24 16:17:37 +0800 | [diff] [blame] | 144 | set(TFM_PARTITION_CRYPTO OFF CACHE BOOL "Enable Crypto partition") |
Raef Coles | 79809c7 | 2022-03-02 13:48:20 +0000 | [diff] [blame] | 145 | set(CRYPTO_TFM_BUILTIN_KEYS_DRIVER ON CACHE BOOL "Whether to allow crypto service to store builtin keys. Without this, ALL builtin keys must be stored in a platform-specific location") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 146 | |
Xinyu Zhang | 77668dd | 2022-10-24 16:17:37 +0800 | [diff] [blame] | 147 | set(TFM_PARTITION_INITIAL_ATTESTATION OFF CACHE BOOL "Enable Initial Attestation partition") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 148 | set(SYMMETRIC_INITIAL_ATTESTATION OFF CACHE BOOL "Use symmetric crypto for inital attestation") |
Joakim Andersson | 7f572ff | 2022-08-09 16:50:36 +0200 | [diff] [blame] | 149 | set(ATTEST_INCLUDE_TEST_CODE OFF CACHE BOOL "Include minimal development tests in the initial attestation regression test suite") |
David Vincze | 75ee516 | 2022-06-08 17:23:09 +0200 | [diff] [blame] | 150 | set(ATTEST_KEY_BITS 256 CACHE STRING "The size of the initial attestation key in bits") |
David Hu | 9191b61 | 2023-06-08 12:02:39 +0800 | [diff] [blame] | 151 | set(PSA_INITIAL_ATTEST_MAX_TOKEN_SIZE 0x250 CACHE STRING "The maximum possible size of a token") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 152 | |
Xinyu Zhang | 77668dd | 2022-10-24 16:17:37 +0800 | [diff] [blame] | 153 | set(TFM_PARTITION_PLATFORM OFF CACHE BOOL "Enable Platform partition") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 154 | |
Jianliang Shen | 212027d | 2023-02-21 10:56:50 +0800 | [diff] [blame] | 155 | ############################ Mbedcrypto configurations ######################### |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 156 | |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 157 | set(MBEDCRYPTO_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Build type of Mbed Crypto library") |
Håkon Øye Amundsen | 8ab569b | 2021-11-04 13:59:04 +0000 | [diff] [blame] | 158 | set(TFM_MBEDCRYPTO_CONFIG_PATH |
| 159 | "${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/mbedcrypto_config/tfm_mbedcrypto_config_default.h" CACHE PATH |
| 160 | "Config to use for Mbed Crypto. For increased flexibility when pointing to a file, set the type \ |
| 161 | of this setting to 'STRING' by passing the :<type> portion when specifying the setting value in \ |
| 162 | the command line. E.g. '-DTFM_MBEDCRYPTO_CONFIG_PATH:STRING=some_file_which_is_generated.h' \ |
| 163 | This can be useful if the config file is generated and placed inside a directory already added \ |
| 164 | to the include path of mbedtls.") |
Summer Qin | 7c0d8d3 | 2021-12-17 15:43:08 +0800 | [diff] [blame] | 165 | set(TFM_MBEDCRYPTO_PSA_CRYPTO_CONFIG_PATH "${CMAKE_SOURCE_DIR}/lib/ext/mbedcrypto/mbedcrypto_config/crypto_config_default.h" CACHE PATH "Config to use psa crypto setting for Mbed Crypto.") |
Antonio de Angelis | b631951 | 2024-05-11 21:22:58 +0100 | [diff] [blame] | 166 | set(TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH "" CACHE PATH "Config to append to standard Mbed Crypto config, used by platforms to configure feature support") |
Raef Coles | 9ec67e6 | 2020-07-10 09:40:35 +0100 | [diff] [blame] | 167 | |
Jianliang Shen | dfe406b | 2023-11-07 14:29:50 +0800 | [diff] [blame] | 168 | ########################## TF-M performance #################################### |
| 169 | |
| 170 | set(CONFIG_TFM_ENABLE_PROFILING OFF CACHE BOOL "Enable profiling for TF-M") |
| 171 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 172 | ########################## MCUBoot signing ##################################### |
| 173 | |
| 174 | if (CONFIG_TFM_BOOT_STORE_MEASUREMENTS AND CONFIG_TFM_BOOT_STORE_ENCODED_MEASUREMENTS) |
| 175 | set(MCUBOOT_MEASURED_BOOT ON) |
| 176 | else() |
| 177 | set(MCUBOOT_MEASURED_BOOT OFF) |
| 178 | endif() |
| 179 | |
Raef Coles | 1d91a7a | 2024-03-06 14:22:26 +0000 | [diff] [blame] | 180 | ########################## TF-M Runtime Sanitization ########################### |
| 181 | |
| 182 | set(BL1_1_SANITIZE OFF CACHE STRING "Enable a runtime sanitizer for BL1_1") |
| 183 | set(BL1_2_SANITIZE OFF CACHE STRING "Enable a runtime sanitizer for BL1_2") |
| 184 | set(BL2_SANITIZE OFF CACHE STRING "Enable a runtime sanitizer for BL2") |
| 185 | set(TFM_SANITIZE OFF CACHE STRING "Enable a runtime sanitizer for the TF-M runtime") |
| 186 | |
David Vincze | 0c515de | 2020-11-25 19:02:57 +0100 | [diff] [blame] | 187 | ################################################################################ |
| 188 | |
| 189 | # Specifying the accepted values for certain configuration options to facilitate |
| 190 | # their later validation. |
| 191 | |
Tamas Ban | b881bea | 2020-11-04 16:18:36 +0000 | [diff] [blame] | 192 | ########################## FIH ################################################# |
| 193 | |
| 194 | set_property(CACHE TFM_FIH_PROFILE PROPERTY STRINGS "OFF;LOW;MEDIUM;HIGH") |
Raef Coles | 1d91a7a | 2024-03-06 14:22:26 +0000 | [diff] [blame] | 195 | |
| 196 | ########################## TF-M Runtime Sanitization ########################### |
| 197 | |
| 198 | set(SANITIZE_OPTIONS "undefined;shift;shift-exponent;shift-base; integer-divide-by-zero;unreachable;vla-bound; null;return;signed-integer-overflow;bounds; bounds-strict;alignment;object-size; float-divide-by-zero;float-cast-overflow; nonnull-attribute;returns-nonnull-attribute; bool;enum;vptr;pointer-overflow;builtin") |
| 199 | |
| 200 | set_property(CACHE BL1_1_SANITIZE PROPERTY STRINGS ${SANITIZE_OPTIONS}) |
| 201 | set_property(CACHE BL1_2_SANITIZE PROPERTY STRINGS ${SANITIZE_OPTIONS}) |
| 202 | set_property(CACHE BL2_SANITIZE PROPERTY STRINGS ${SANITIZE_OPTIONS}) |
| 203 | set_property(CACHE TFM_SANITIZE PROPERTY STRINGS ${SANITIZE_OPTIONS}) |