blob: 824d88613bf4e0371fa8e201e2199ea81dbd26a6 [file] [log] [blame]
David Hu06976a62019-12-26 15:41:08 +08001#-------------------------------------------------------------------------------
2# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8# This file holds information of the configuration for TF-M Profile Small with
9# regression tests.
10
11if(NOT DEFINED TFM_ROOT_DIR)
12 message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
13endif()
14
15#Include board specific config (CPU, etc...), select platform specific build
16#system settings file
17if(NOT DEFINED TARGET_PLATFORM)
18 message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
19elseif(${TARGET_PLATFORM} STREQUAL "AN521")
20 set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
21elseif(${TARGET_PLATFORM} STREQUAL "AN519")
22 set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
23else()
24 message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
25endif()
26
27# These variables select the default setting of this TF-M Profile Small.
28# The settings can be overwritten by the customized platform specific settings
29
30# Library model
31set(CORE_IPC False)
32# TF-M isolation level: 1
33set(TFM_LVL 1)
34
35# BL2 settings can be overwritten in the profile extension configuration
36# or in platform specific cmake file.
37if(NOT DEFINED BL2)
38 set(BL2 True)
39endif()
40
41if(BL2)
42 # Single binary boot
43 set(MCUBOOT_IMAGE_NUMBER 1 CACHE STRING "Single binary boot by default")
44endif()
45
46# Enable Internal Trusted Storage service
47set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON)
48# Use the real Flash for Internal Trusted Storage
49set(ITS_RAM_FS OFF)
50# Decrease the transient internal buffer size to 32 bytes
51set(ITS_BUF_SIZE 32)
52
53# Enable Crypto service
54set(TFM_PARTITION_CRYPTO ON)
55set(CRYPTO_ASYMMETRIC_MODULE_DISABLED ON)
David Hu06976a62019-12-26 15:41:08 +080056# Set the dedicated mbed-crypto default config file
57set(MBEDTLS_CONFIG_FILE "tfm_profile_s_mbedcrypto_config.h")
58
59# Disable Audit Logging service
60set(TFM_PARTITION_AUDIT_LOG OFF)
61
62# Disable Platform service
63set(TFM_PARTITION_PLATFORM OFF)
64
Kevin Pengc6d74502020-03-04 16:55:37 +080065# Disable Protected Storage service
66set(TFM_PARTITION_PROTECTED_STORAGE OFF)
David Hu06976a62019-12-26 15:41:08 +080067
David Hu3b49ce72020-01-22 14:31:04 +080068# Enable Initial Attestation service
69set(TFM_PARTITION_INITIAL_ATTESTATION ON)
70# Enable symmetric key algorithm based attestation
71set(SYMMETRIC_INITIAL_ATTESTATION ON)
72# Disable QCBOR test cases to save memory
73set(ENABLE_QCBOR_TESTS OFF)
74# Disable t_cose test cases to save memory
75set(ENABLE_T_COSE_TESTS OFF)
David Hu06976a62019-12-26 15:41:08 +080076
77# Configure the test cases
78set(REGRESSION True)
79set(CORE_TEST True)
80set(PSA_API_TEST False)
81# Configure Crypto test cases
82set(TFM_CRYPTO_TEST_ALG_CBC OFF)
83# Select AES-CCM by default
84set(TFM_CRYPTO_TEST_ALG_CCM ON)
85set(TFM_CRYPTO_TEST_ALG_CFB OFF)
86set(TFM_CRYPTO_TEST_ALG_CTR OFF)
87set(TFM_CRYPTO_TEST_ALG_GCM OFF)
88set(TFM_CRYPTO_TEST_ALG_SHA_512 OFF)
David Hu055dce72020-06-04 15:58:38 +080089set(TFM_CRYPTO_TEST_HKDF OFF)
David Hu06976a62019-12-26 15:41:08 +080090
91# Include platform specific profile configuration extension file if it is
92# provided via argument TFM_PROFILE_CONFIG_EXT in command line.
93# The configuration extension file can be specified as an absolute path or a
94# relative path to TF-M root folder.
95if(TFM_PROFILE_CONFIG_EXT)
96 get_filename_component(TFM_PROFILE_CONFIG_EXT ${TFM_PROFILE_CONFIG_EXT}
97 ABSOLUTE BASE_DIR ${TFM_ROOT_DIR})
98
99 if(NOT EXISTS ${TFM_PROFILE_CONFIG_EXT})
100 message(FATAL_ERROR "The config extension ${TFM_PROFILE_CONFIG_EXT} is not found")
101 endif()
102
103 include(${TFM_PROFILE_CONFIG_EXT})
104 message("The config extension ${TFM_PROFILE_CONFIG_EXT} is included")
105endif()
106
107include("${TFM_ROOT_DIR}/CommonConfig.cmake")