blob: 772eab1fce251f5d547201b716a6597e70c49495 [file] [log] [blame]
David Hud0da13a2019-12-25 11:21:25 +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
9
10if(NOT DEFINED TFM_ROOT_DIR)
11 message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!")
12endif()
13
14#Include board specific config (CPU, etc...), select platform specific build
15#system settings file
16if(NOT DEFINED TARGET_PLATFORM)
17 message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line")
18elseif(${TARGET_PLATFORM} STREQUAL "AN521")
19 set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake")
20elseif(${TARGET_PLATFORM} STREQUAL "AN519")
21 set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake")
22else()
23 message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.")
24endif()
25
26# These variables select the default setting of this TF-M Profile Small.
27# The settings can be overwritten by the customized platform specific settings
28
29# Library model
30set(CORE_IPC False)
31# TF-M isolation level: 1
32set(TFM_LVL 1)
33
34# BL2 settings can be overwritten in the profile extension configuration
35# or in platform specific cmake file.
36if(NOT DEFINED BL2)
37 set(BL2 True)
38endif()
39
40if(BL2)
41 # Single binary boot
42 set(MCUBOOT_IMAGE_NUMBER 1 CACHE STRING "Single binary boot by default")
43endif()
44
45# Enable Internal Trusted Storage service
46set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON)
47# Decrease the transient internal buffer size to 32 bytes
48set(ITS_BUF_SIZE 32)
49
50# Enable Crypto service
51set(TFM_PARTITION_CRYPTO ON)
52set(CRYPTO_ASYMMETRIC_MODULE_DISABLED ON)
David Hud0da13a2019-12-25 11:21:25 +080053# Set the dedicated mbed-crypto default config file
54set(MBEDTLS_CONFIG_FILE "tfm_profile_s_mbedcrypto_config.h")
55
56# Disable Audit Logging service
57set(TFM_PARTITION_AUDIT_LOG OFF)
58
59# Disable Platform service
60set(TFM_PARTITION_PLATFORM OFF)
61
Kevin Pengc6d74502020-03-04 16:55:37 +080062# Disable Protected Storage service
63set(TFM_PARTITION_PROTECTED_STORAGE OFF)
David Hud0da13a2019-12-25 11:21:25 +080064
David Hu724a12d2020-01-21 15:44:21 +080065# Enable Initial Attestation service
66set(TFM_PARTITION_INITIAL_ATTESTATION ON)
67# Enable Initial Attestation based on symmetric key algorithm
68set(SYMMETRIC_INITIAL_ATTESTATION ON)
David Hud0da13a2019-12-25 11:21:25 +080069
70# Disable all the test cases
71set(REGRESSION False)
72set(CORE_TEST False)
73set(PSA_API_TEST False)
74
75# Include platform specific profile configuration extension file if it is
76# provided via argument TFM_PROFILE_CONFIG_EXT in command line.
77# The configuration extension file can be specified as an absolute path or a
78# relative path to TF-M root folder.
79if(TFM_PROFILE_CONFIG_EXT)
80 get_filename_component(TFM_PROFILE_CONFIG_EXT ${TFM_PROFILE_CONFIG_EXT}
81 ABSOLUTE BASE_DIR ${TFM_ROOT_DIR})
82
83 if(NOT EXISTS ${TFM_PROFILE_CONFIG_EXT})
84 message(FATAL_ERROR "The config extension ${TFM_PROFILE_CONFIG_EXT} is not found")
85 endif()
86
87 include(${TFM_PROFILE_CONFIG_EXT})
88 message("The config extension ${TFM_PROFILE_CONFIG_EXT} is included")
89endif()
90
91include("${TFM_ROOT_DIR}/CommonConfig.cmake")