blob: 2defdac21f704fdd6e89cdfd370c204be20fd964 [file] [log] [blame]
Anton Komlevaee4b612023-05-14 17:38:36 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited. All rights reserved.
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 Pengef255d72023-10-27 17:03:55 +080011# TF-M Profile
12set(TFM_PROFILE @TFM_PROFILE@ CACHE STRING "The TF-M profile")
13
Dávid Házi1829f9f2023-11-13 16:23:33 +010014set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE @TFM_PARTITION_INTERNAL_TRUSTED_STORAGE@ CACHE BOOL "Enable Internal Trusted Storage partition")
15set(TFM_PARTITION_CRYPTO @TFM_PARTITION_CRYPTO@ CACHE BOOL "Enable Crypto partition")
16set(TFM_PARTITION_INITIAL_ATTESTATION @TFM_PARTITION_INITIAL_ATTESTATION@ CACHE BOOL "Enable Initial Attestation partition")
17set(TFM_PARTITION_PROTECTED_STORAGE @TFM_PARTITION_PROTECTED_STORAGE@ CACHE BOOL "Enable Protected Storage partition")
18set(TFM_PARTITION_PLATFORM @TFM_PARTITION_PLATFORM@ CACHE BOOL "Enable Platform partition")
19set(TFM_PARTITION_FIRMWARE_UPDATE @TFM_PARTITION_FIRMWARE_UPDATE@ CACHE BOOL "Enable firmware update partition")
20set(TFM_PARTITION_NS_AGENT_MAILBOX @TFM_PARTITION_NS_AGENT_MAILBOX@ CACHE BOOL "Enable the Mailbox agents")
Anton Komlevaee4b612023-05-14 17:38:36 +010021
22# The options necessary for signing the final image
23set(BL2 @BL2@)
24set(BL2_HEADER_SIZE @BL2_HEADER_SIZE@)
25set(BL2_TRAILER_SIZE @BL2_TRAILER_SIZE@)
26set(MCUBOOT_IMAGE_NUMBER @MCUBOOT_IMAGE_NUMBER@)
27set(MCUBOOT_CONFIRM_IMAGE @MCUBOOT_CONFIRM_IMAGE@)
28set(MCUBOOT_ENC_IMAGES @MCUBOOT_ENC_IMAGES@)
29set(MCUBOOT_ENC_KEY_LEN @MCUBOOT_ENC_KEY_LEN@)
Michel JAOUENe3acae82023-10-31 11:49:03 +010030set(MCUBOOT_KEY_ENC @MCUBOOT_KEY_ENC@)
Anton Komlevaee4b612023-05-14 17:38:36 +010031set(MCUBOOT_MEASURED_BOOT @MCUBOOT_MEASURED_BOOT@)
32set(MCUBOOT_ALIGN_VAL @MCUBOOT_ALIGN_VAL@)
33set(MCUBOOT_UPGRADE_STRATEGY @MCUBOOT_UPGRADE_STRATEGY@)
34set(MCUBOOT_S_IMAGE_MIN_VER @MCUBOOT_S_IMAGE_MIN_VER@)
35
36set(MCUBOOT_MEASURED_BOOT @MCUBOOT_MEASURED_BOOT@)
37set(MCUBOOT_HW_KEY @MCUBOOT_HW_KEY@)
38
39set(MCUBOOT_SECURITY_COUNTER_S @MCUBOOT_SECURITY_COUNTER_S@)
40set(MCUBOOT_IMAGE_VERSION_S @MCUBOOT_IMAGE_VERSION_S@)
David Hu76734222023-11-15 12:17:17 +080041set(MCUBOOT_KEY_S @MCUBOOT_INSTALL_KEY_S@)
Anton Komlevaee4b612023-05-14 17:38:36 +010042
43set(MCUBOOT_SECURITY_COUNTER_NS @MCUBOOT_SECURITY_COUNTER_NS@)
44set(MCUBOOT_IMAGE_VERSION_NS @MCUBOOT_IMAGE_VERSION_NS@)
David Hu76734222023-11-15 12:17:17 +080045set(MCUBOOT_KEY_NS @MCUBOOT_INSTALL_KEY_NS@)
Dávid Házi34cf9b92023-10-11 11:10:41 +020046set(PLATFORM_DEFAULT_IMAGE_SIGNING @PLATFORM_DEFAULT_IMAGE_SIGNING@)
Anton Komlevaee4b612023-05-14 17:38:36 +010047
Jianliang Shenbd624ed2023-10-24 15:42:59 +080048# The common options describing a platform configuration
Anton Komlevaee4b612023-05-14 17:38:36 +010049
Dávid Házi1829f9f2023-11-13 16:23:33 +010050set(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.")
51set(CONFIG_TFM_USE_TRUSTZONE @CONFIG_TFM_USE_TRUSTZONE@ CACHE BOOL "Use TrustZone")
52set(CONFIG_TFM_SPM_BACKEND @CONFIG_TFM_SPM_BACKEND@ CACHE STRING "The SPM backend")
53set(TFM_MULTI_CORE_TOPOLOGY @TFM_MULTI_CORE_TOPOLOGY@ CACHE BOOL "Platform has multi core")
54set(PSA_FRAMEWORK_HAS_MM_IOVEC @PSA_FRAMEWORK_HAS_MM_IOVEC@ CACHE BOOL "Enable the MM-IOVEC feature")
55set(TFM_ISOLATION_LEVEL @TFM_ISOLATION_LEVEL@ CACHE STRING "The TFM isolation level")
Anton Komlevaee4b612023-05-14 17:38:36 +010056
Dávid Házi1829f9f2023-11-13 16:23:33 +010057set(PLATFORM_DEFAULT_CRYPTO_KEYS @PLATFORM_DEFAULT_CRYPTO_KEYS@ CACHE BOOL "Use the default crypto keys")
58set(PLATFORM_DEFAULT_UART_STDOUT @PLATFORM_DEFAULT_UART_STDOUT@ CACHE BOOL "Use default uart stdout implementation.")
David Hub27a6632023-10-23 22:38:39 +080059
Anton Komlevaee4b612023-05-14 17:38:36 +010060# Testing related options.
61
Kevin Peng27cf4de2023-10-26 16:04:46 +080062set(TEST_PSA_API @TEST_PSA_API@ CACHE STRING "Which (if any) of the PSA API tests should be compiled")
63set(PSA_ARCH_TESTS_PATH @PSA_ARCH_TESTS_PATH@ CACHE PATH "Path to PSA arch test repository if it was give to SPE build")
64set(INCLUDE_PANIC_TESTS @INCLUDE_PANIC_TESTS@ CACHE BOOL "Include panic tests")
Anton Komlevaee4b612023-05-14 17:38:36 +010065
Dávid Házi1829f9f2023-11-13 16:23:33 +010066set(ATTEST_KEY_BITS @ATTEST_KEY_BITS@ CACHE STRING "The size of the initial attestation key in bits")
67set(SYMMETRIC_INITIAL_ATTESTATION @SYMMETRIC_INITIAL_ATTESTATION@ CACHE BOOL "Use symmetric crypto for inital attestation")
68set(ATTEST_INCLUDE_TEST_CODE @ATTEST_INCLUDE_TEST_CODE@ CACHE BOOL "Include minimal development tests in the initial attestation regression test suite")
69set(TFM_MBEDCRYPTO_PSA_CRYPTO_CONFIG_PATH @TFM_MBEDCRYPTO_PSA_CRYPTO_CONFIG_PATH@ CACHE STRING "Config to use psa crypto setting for Mbed Crypto")
70set(CC312_LEGACY_DRIVER_API_ENABLED @CC312_LEGACY_DRIVER_API_ENABLED@ CACHE BOOL "This variable controls whether the legacy driver interface is used for CC-312")
Jianliang Shenbd624ed2023-10-24 15:42:59 +080071
Sherry Zhange16ae262023-11-15 16:22:44 +080072set(TFM_FWU_BOOTLOADER_LIB @TFM_FWU_BOOTLOADER_LIB@ CACHE STRING "Bootloader configure file for Firmware Update partition")
73
Anton Komlevaee4b612023-05-14 17:38:36 +010074# Other common options
Dávid Házie7932282023-11-11 23:59:53 +010075
76# Coprocessor settings
77# It is difficult to sort out coprocessor settings and their dependencies.
78# Export all the essential settings and therefore NS users don't have to figure them out again or
79# include other config files.
80# Also export other coprocessor settings to enable NS integration to validate the whole settings
81# and toolchain compatibility via installed cp_config_check.cmake.
82set(CONFIG_TFM_ENABLE_FP @CONFIG_TFM_ENABLE_FP@ CACHE BOOL "Enable/disable FP usage")
83set(CONFIG_TFM_ENABLE_MVE @CONFIG_TFM_ENABLE_MVE@ CACHE BOOL "Enable/disable integer MVE usage")
84set(CONFIG_TFM_ENABLE_MVE_FP @CONFIG_TFM_ENABLE_MVE_FP@ CACHE BOOL "Enable/disable floating-point MVE usage")
85set(CONFIG_TFM_FLOAT_ABI @CONFIG_TFM_FLOAT_ABI@)
86set(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.")
87set(CONFIG_TFM_LAZY_STACKING @CONFIG_TFM_LAZY_STACKING@ CACHE BOOL "Enable/disable lazy stacking")
Anton Komlevaee4b612023-05-14 17:38:36 +010088
89set(TFM_VERSION @TFM_VERSION@)
90set(TFM_NS_MANAGE_NSID @TFM_NS_MANAGE_NSID@)