blob: 324ebb22d99b4bad7a6adde0f75ba61a353766a0 [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)
56set(CRYPTO_KEY_DERIVATION_MODULE_DISABLED ON)
57# Set the dedicated mbed-crypto default config file
58set(MBEDTLS_CONFIG_FILE "tfm_profile_s_mbedcrypto_config.h")
59
60# Disable Audit Logging service
61set(TFM_PARTITION_AUDIT_LOG OFF)
62
63# Disable Platform service
64set(TFM_PARTITION_PLATFORM OFF)
65
Kevin Pengc6d74502020-03-04 16:55:37 +080066# Disable Protected Storage service
67set(TFM_PARTITION_PROTECTED_STORAGE OFF)
David Hu06976a62019-12-26 15:41:08 +080068
69# Disable Initial Attestation service temporarily
70set(TFM_PARTITION_INITIAL_ATTESTATION OFF)
71
72# Configure the test cases
73set(REGRESSION True)
74set(CORE_TEST True)
75set(PSA_API_TEST False)
76# Configure Crypto test cases
77set(TFM_CRYPTO_TEST_ALG_CBC OFF)
78# Select AES-CCM by default
79set(TFM_CRYPTO_TEST_ALG_CCM ON)
80set(TFM_CRYPTO_TEST_ALG_CFB OFF)
81set(TFM_CRYPTO_TEST_ALG_CTR OFF)
82set(TFM_CRYPTO_TEST_ALG_GCM OFF)
83set(TFM_CRYPTO_TEST_ALG_SHA_512 OFF)
84
85# Include platform specific profile configuration extension file if it is
86# provided via argument TFM_PROFILE_CONFIG_EXT in command line.
87# The configuration extension file can be specified as an absolute path or a
88# relative path to TF-M root folder.
89if(TFM_PROFILE_CONFIG_EXT)
90 get_filename_component(TFM_PROFILE_CONFIG_EXT ${TFM_PROFILE_CONFIG_EXT}
91 ABSOLUTE BASE_DIR ${TFM_ROOT_DIR})
92
93 if(NOT EXISTS ${TFM_PROFILE_CONFIG_EXT})
94 message(FATAL_ERROR "The config extension ${TFM_PROFILE_CONFIG_EXT} is not found")
95 endif()
96
97 include(${TFM_PROFILE_CONFIG_EXT})
98 message("The config extension ${TFM_PROFILE_CONFIG_EXT} is included")
99endif()
100
101include("${TFM_ROOT_DIR}/CommonConfig.cmake")