David Hu | d0da13a | 2019-12-25 11:21:25 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 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 | |
| 10 | if(NOT DEFINED TFM_ROOT_DIR) |
| 11 | message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!") |
| 12 | endif() |
| 13 | |
| 14 | #Include board specific config (CPU, etc...), select platform specific build |
| 15 | #system settings file |
| 16 | if(NOT DEFINED TARGET_PLATFORM) |
| 17 | message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line") |
| 18 | elseif(${TARGET_PLATFORM} STREQUAL "AN521") |
| 19 | set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake") |
| 20 | elseif(${TARGET_PLATFORM} STREQUAL "AN519") |
| 21 | set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake") |
| 22 | else() |
| 23 | message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.") |
| 24 | endif() |
| 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 |
| 30 | set(CORE_IPC False) |
| 31 | # TF-M isolation level: 1 |
| 32 | set(TFM_LVL 1) |
| 33 | |
| 34 | # BL2 settings can be overwritten in the profile extension configuration |
| 35 | # or in platform specific cmake file. |
| 36 | if(NOT DEFINED BL2) |
| 37 | set(BL2 True) |
| 38 | endif() |
| 39 | |
| 40 | if(BL2) |
| 41 | # Single binary boot |
| 42 | set(MCUBOOT_IMAGE_NUMBER 1 CACHE STRING "Single binary boot by default") |
| 43 | endif() |
| 44 | |
| 45 | # Enable Internal Trusted Storage service |
| 46 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON) |
| 47 | # Decrease the transient internal buffer size to 32 bytes |
| 48 | set(ITS_BUF_SIZE 32) |
| 49 | |
| 50 | # Enable Crypto service |
| 51 | set(TFM_PARTITION_CRYPTO ON) |
| 52 | set(CRYPTO_ASYMMETRIC_MODULE_DISABLED ON) |
David Hu | d0da13a | 2019-12-25 11:21:25 +0800 | [diff] [blame] | 53 | # Set the dedicated mbed-crypto default config file |
| 54 | set(MBEDTLS_CONFIG_FILE "tfm_profile_s_mbedcrypto_config.h") |
| 55 | |
| 56 | # Disable Audit Logging service |
| 57 | set(TFM_PARTITION_AUDIT_LOG OFF) |
| 58 | |
| 59 | # Disable Platform service |
| 60 | set(TFM_PARTITION_PLATFORM OFF) |
| 61 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame] | 62 | # Disable Protected Storage service |
| 63 | set(TFM_PARTITION_PROTECTED_STORAGE OFF) |
David Hu | d0da13a | 2019-12-25 11:21:25 +0800 | [diff] [blame] | 64 | |
David Hu | 724a12d | 2020-01-21 15:44:21 +0800 | [diff] [blame] | 65 | # Enable Initial Attestation service |
| 66 | set(TFM_PARTITION_INITIAL_ATTESTATION ON) |
| 67 | # Enable Initial Attestation based on symmetric key algorithm |
| 68 | set(SYMMETRIC_INITIAL_ATTESTATION ON) |
David Hu | d0da13a | 2019-12-25 11:21:25 +0800 | [diff] [blame] | 69 | |
| 70 | # Disable all the test cases |
| 71 | set(REGRESSION False) |
| 72 | set(CORE_TEST False) |
| 73 | set(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. |
| 79 | if(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") |
| 89 | endif() |
| 90 | |
| 91 | include("${TFM_ROOT_DIR}/CommonConfig.cmake") |