blob: af90b926ec9282cb22eba58b12bcaec23f76c96d [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)
David Hu06976a62019-12-26 15:41:08 +080048# Decrease the transient internal buffer size to 32 bytes
49set(ITS_BUF_SIZE 32)
50
51# Enable Crypto service
52set(TFM_PARTITION_CRYPTO ON)
53set(CRYPTO_ASYMMETRIC_MODULE_DISABLED ON)
David Hu06976a62019-12-26 15:41:08 +080054# Set the dedicated mbed-crypto default config file
55set(MBEDTLS_CONFIG_FILE "tfm_profile_s_mbedcrypto_config.h")
56
57# Disable Audit Logging service
58set(TFM_PARTITION_AUDIT_LOG OFF)
59
60# Disable Platform service
61set(TFM_PARTITION_PLATFORM OFF)
62
Kevin Pengc6d74502020-03-04 16:55:37 +080063# Disable Protected Storage service
64set(TFM_PARTITION_PROTECTED_STORAGE OFF)
David Hu06976a62019-12-26 15:41:08 +080065
David Hu3b49ce72020-01-22 14:31:04 +080066# Enable Initial Attestation service
67set(TFM_PARTITION_INITIAL_ATTESTATION ON)
68# Enable symmetric key algorithm based attestation
69set(SYMMETRIC_INITIAL_ATTESTATION ON)
70# Disable QCBOR test cases to save memory
71set(ENABLE_QCBOR_TESTS OFF)
72# Disable t_cose test cases to save memory
73set(ENABLE_T_COSE_TESTS OFF)
David Hu06976a62019-12-26 15:41:08 +080074
75# Configure the test cases
76set(REGRESSION True)
77set(CORE_TEST True)
78set(PSA_API_TEST False)
79# Configure Crypto test cases
80set(TFM_CRYPTO_TEST_ALG_CBC OFF)
81# Select AES-CCM by default
82set(TFM_CRYPTO_TEST_ALG_CCM ON)
83set(TFM_CRYPTO_TEST_ALG_CFB OFF)
84set(TFM_CRYPTO_TEST_ALG_CTR OFF)
85set(TFM_CRYPTO_TEST_ALG_GCM OFF)
86set(TFM_CRYPTO_TEST_ALG_SHA_512 OFF)
David Hu055dce72020-06-04 15:58:38 +080087set(TFM_CRYPTO_TEST_HKDF OFF)
David Hu06976a62019-12-26 15:41:08 +080088
89# Include platform specific profile configuration extension file if it is
90# provided via argument TFM_PROFILE_CONFIG_EXT in command line.
91# The configuration extension file can be specified as an absolute path or a
92# relative path to TF-M root folder.
93if(TFM_PROFILE_CONFIG_EXT)
94 get_filename_component(TFM_PROFILE_CONFIG_EXT ${TFM_PROFILE_CONFIG_EXT}
95 ABSOLUTE BASE_DIR ${TFM_ROOT_DIR})
96
97 if(NOT EXISTS ${TFM_PROFILE_CONFIG_EXT})
98 message(FATAL_ERROR "The config extension ${TFM_PROFILE_CONFIG_EXT} is not found")
99 endif()
100
101 include(${TFM_PROFILE_CONFIG_EXT})
102 message("The config extension ${TFM_PROFILE_CONFIG_EXT} is included")
103endif()
104
105include("${TFM_ROOT_DIR}/CommonConfig.cmake")