blob: aa54ead862d5ab817a77bd0105d992fa77165223 [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)
53set(CRYPTO_KEY_DERIVATION_MODULE_DISABLED ON)
54# 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 Hud0da13a2019-12-25 11:21:25 +080065
66# Disable Initial Attestation service temporarily
67set(TFM_PARTITION_INITIAL_ATTESTATION OFF)
68
69# Disable all the test cases
70set(REGRESSION False)
71set(CORE_TEST False)
72set(PSA_API_TEST False)
73
74# Include platform specific profile configuration extension file if it is
75# provided via argument TFM_PROFILE_CONFIG_EXT in command line.
76# The configuration extension file can be specified as an absolute path or a
77# relative path to TF-M root folder.
78if(TFM_PROFILE_CONFIG_EXT)
79 get_filename_component(TFM_PROFILE_CONFIG_EXT ${TFM_PROFILE_CONFIG_EXT}
80 ABSOLUTE BASE_DIR ${TFM_ROOT_DIR})
81
82 if(NOT EXISTS ${TFM_PROFILE_CONFIG_EXT})
83 message(FATAL_ERROR "The config extension ${TFM_PROFILE_CONFIG_EXT} is not found")
84 endif()
85
86 include(${TFM_PROFILE_CONFIG_EXT})
87 message("The config extension ${TFM_PROFILE_CONFIG_EXT} is included")
88endif()
89
90include("${TFM_ROOT_DIR}/CommonConfig.cmake")