Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Maulik Patel | 439be35 | 2025-04-15 14:34:28 +0100 | [diff] [blame^] | 2 | # SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | # This CMake script template contains the set of options settled on secure side |
| 9 | # build but necessary for building the non-secure side too. |
| 10 | |
Kevin Peng | ef255d7 | 2023-10-27 17:03:55 +0800 | [diff] [blame] | 11 | # TF-M Profile |
| 12 | set(TFM_PROFILE @TFM_PROFILE@ CACHE STRING "The TF-M profile") |
| 13 | |
Dávid Házi | 1829f9f | 2023-11-13 16:23:33 +0100 | [diff] [blame] | 14 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE @TFM_PARTITION_INTERNAL_TRUSTED_STORAGE@ CACHE BOOL "Enable Internal Trusted Storage partition") |
| 15 | set(TFM_PARTITION_CRYPTO @TFM_PARTITION_CRYPTO@ CACHE BOOL "Enable Crypto partition") |
| 16 | set(TFM_PARTITION_INITIAL_ATTESTATION @TFM_PARTITION_INITIAL_ATTESTATION@ CACHE BOOL "Enable Initial Attestation partition") |
| 17 | set(TFM_PARTITION_PROTECTED_STORAGE @TFM_PARTITION_PROTECTED_STORAGE@ CACHE BOOL "Enable Protected Storage partition") |
| 18 | set(TFM_PARTITION_PLATFORM @TFM_PARTITION_PLATFORM@ CACHE BOOL "Enable Platform partition") |
| 19 | set(TFM_PARTITION_FIRMWARE_UPDATE @TFM_PARTITION_FIRMWARE_UPDATE@ CACHE BOOL "Enable firmware update partition") |
| 20 | set(TFM_PARTITION_NS_AGENT_MAILBOX @TFM_PARTITION_NS_AGENT_MAILBOX@ CACHE BOOL "Enable the Mailbox agents") |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 21 | |
| 22 | # The options necessary for signing the final image |
| 23 | set(BL2 @BL2@) |
| 24 | set(BL2_HEADER_SIZE @BL2_HEADER_SIZE@) |
| 25 | set(BL2_TRAILER_SIZE @BL2_TRAILER_SIZE@) |
| 26 | set(MCUBOOT_IMAGE_NUMBER @MCUBOOT_IMAGE_NUMBER@) |
Maulik Patel | 439be35 | 2025-04-15 14:34:28 +0100 | [diff] [blame^] | 27 | set(TFM_S_KEY_ID @TFM_S_KEY_ID@) |
| 28 | set(TFM_NS_KEY_ID @TFM_NS_KEY_ID@) |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 29 | set(MCUBOOT_CONFIRM_IMAGE @MCUBOOT_CONFIRM_IMAGE@) |
| 30 | set(MCUBOOT_ENC_IMAGES @MCUBOOT_ENC_IMAGES@) |
| 31 | set(MCUBOOT_ENC_KEY_LEN @MCUBOOT_ENC_KEY_LEN@) |
Michel JAOUEN | e3acae8 | 2023-10-31 11:49:03 +0100 | [diff] [blame] | 32 | set(MCUBOOT_KEY_ENC @MCUBOOT_KEY_ENC@) |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 33 | set(MCUBOOT_MEASURED_BOOT @MCUBOOT_MEASURED_BOOT@) |
| 34 | set(MCUBOOT_ALIGN_VAL @MCUBOOT_ALIGN_VAL@) |
| 35 | set(MCUBOOT_UPGRADE_STRATEGY @MCUBOOT_UPGRADE_STRATEGY@) |
| 36 | set(MCUBOOT_S_IMAGE_MIN_VER @MCUBOOT_S_IMAGE_MIN_VER@) |
| 37 | |
| 38 | set(MCUBOOT_MEASURED_BOOT @MCUBOOT_MEASURED_BOOT@) |
| 39 | set(MCUBOOT_HW_KEY @MCUBOOT_HW_KEY@) |
Maulik Patel | 439be35 | 2025-04-15 14:34:28 +0100 | [diff] [blame^] | 40 | set(MCUBOOT_BUILTIN_KEY @MCUBOOT_BUILTIN_KEY@) |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 41 | |
| 42 | set(MCUBOOT_SECURITY_COUNTER_S @MCUBOOT_SECURITY_COUNTER_S@) |
| 43 | set(MCUBOOT_IMAGE_VERSION_S @MCUBOOT_IMAGE_VERSION_S@) |
David Hu | 7673422 | 2023-11-15 12:17:17 +0800 | [diff] [blame] | 44 | set(MCUBOOT_KEY_S @MCUBOOT_INSTALL_KEY_S@) |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 45 | |
| 46 | set(MCUBOOT_SECURITY_COUNTER_NS @MCUBOOT_SECURITY_COUNTER_NS@) |
| 47 | set(MCUBOOT_IMAGE_VERSION_NS @MCUBOOT_IMAGE_VERSION_NS@) |
David Hu | 7673422 | 2023-11-15 12:17:17 +0800 | [diff] [blame] | 48 | set(MCUBOOT_KEY_NS @MCUBOOT_INSTALL_KEY_NS@) |
Dávid Házi | 34cf9b9 | 2023-10-11 11:10:41 +0200 | [diff] [blame] | 49 | set(PLATFORM_DEFAULT_IMAGE_SIGNING @PLATFORM_DEFAULT_IMAGE_SIGNING@) |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 50 | |
Jianliang Shen | bd624ed | 2023-10-24 15:42:59 +0800 | [diff] [blame] | 51 | # The common options describing a platform configuration |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 52 | |
Dávid Házi | 1829f9f | 2023-11-13 16:23:33 +0100 | [diff] [blame] | 53 | set(TFM_PLATFORM @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.") |
| 54 | set(CONFIG_TFM_USE_TRUSTZONE @CONFIG_TFM_USE_TRUSTZONE@ CACHE BOOL "Use TrustZone") |
| 55 | set(CONFIG_TFM_SPM_BACKEND @CONFIG_TFM_SPM_BACKEND@ CACHE STRING "The SPM backend") |
| 56 | set(TFM_MULTI_CORE_TOPOLOGY @TFM_MULTI_CORE_TOPOLOGY@ CACHE BOOL "Platform has multi core") |
| 57 | set(PSA_FRAMEWORK_HAS_MM_IOVEC @PSA_FRAMEWORK_HAS_MM_IOVEC@ CACHE BOOL "Enable the MM-IOVEC feature") |
| 58 | set(TFM_ISOLATION_LEVEL @TFM_ISOLATION_LEVEL@ CACHE STRING "The TFM isolation level") |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 59 | |
Dávid Házi | 1829f9f | 2023-11-13 16:23:33 +0100 | [diff] [blame] | 60 | set(PLATFORM_DEFAULT_CRYPTO_KEYS @PLATFORM_DEFAULT_CRYPTO_KEYS@ CACHE BOOL "Use the default crypto keys") |
| 61 | set(PLATFORM_DEFAULT_UART_STDOUT @PLATFORM_DEFAULT_UART_STDOUT@ CACHE BOOL "Use default uart stdout implementation.") |
David Hu | b27a663 | 2023-10-23 22:38:39 +0800 | [diff] [blame] | 62 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 63 | # Other common options |
Dávid Házi | e793228 | 2023-11-11 23:59:53 +0100 | [diff] [blame] | 64 | |
| 65 | # Coprocessor settings |
| 66 | # It is difficult to sort out coprocessor settings and their dependencies. |
| 67 | # Export all the essential settings and therefore NS users don't have to figure them out again or |
| 68 | # include other config files. |
| 69 | # Also export other coprocessor settings to enable NS integration to validate the whole settings |
| 70 | # and toolchain compatibility via installed cp_config_check.cmake. |
| 71 | set(CONFIG_TFM_ENABLE_FP @CONFIG_TFM_ENABLE_FP@ CACHE BOOL "Enable/disable FP usage") |
| 72 | set(CONFIG_TFM_ENABLE_MVE @CONFIG_TFM_ENABLE_MVE@ CACHE BOOL "Enable/disable integer MVE usage") |
| 73 | set(CONFIG_TFM_ENABLE_MVE_FP @CONFIG_TFM_ENABLE_MVE_FP@ CACHE BOOL "Enable/disable floating-point MVE usage") |
| 74 | set(CONFIG_TFM_FLOAT_ABI @CONFIG_TFM_FLOAT_ABI@) |
Roman Mazurak | 0a79e67 | 2024-08-14 16:48:13 +0300 | [diff] [blame] | 75 | set(CONFIG_TFM_DISABLE_CP10CP11 @CONFIG_TFM_DISABLE_CP10CP11@ CACHE BOOL "This disables the coprocessors CP10-CP11") |
Dávid Házi | e793228 | 2023-11-11 23:59:53 +0100 | [diff] [blame] | 76 | set(CONFIG_TFM_ENABLE_CP10CP11 @CONFIG_TFM_ENABLE_CP10CP11@ CACHE BOOL "Make FPU and MVE operational when SPE and/or NSPE require FPU or MVE usage. This alone only enables the coprocessors CP10-CP11, whereas CONFIG_TFM_FLOAT_ABI=hard along with CONFIG_TFM_ENABLE_FP, CONFIG_TFM_ENABLE_MVE or CONFIG_TFM_ENABLE_MVE_FP compiles the code with hardware FP or MVE instructions and ABI.") |
| 77 | set(CONFIG_TFM_LAZY_STACKING @CONFIG_TFM_LAZY_STACKING@ CACHE BOOL "Enable/disable lazy stacking") |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 78 | |
| 79 | set(TFM_VERSION @TFM_VERSION@) |
| 80 | set(TFM_NS_MANAGE_NSID @TFM_NS_MANAGE_NSID@) |
David Hu | 0601777 | 2023-11-07 18:22:42 +0800 | [diff] [blame] | 81 | |
Tomi Fontanilles | f38236c | 2024-05-15 12:20:44 +0300 | [diff] [blame] | 82 | set(RECOMMENDED_TFM_TESTS_VERSION @TFM_TESTS_VERSION@) |
Tomi Fontanilles | 17e9e9c | 2024-05-15 12:44:46 +0300 | [diff] [blame] | 83 | set(CHECK_TFM_TESTS_VERSION @TFM_TESTS_REVISION_CHECKS@) |