David Hu | 06976a6 | 2019-12-26 15:41:08 +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 with |
| 9 | # regression tests. |
| 10 | |
| 11 | if(NOT DEFINED TFM_ROOT_DIR) |
| 12 | message(FATAL_ERROR "Variable TFM_ROOT_DIR is not set!") |
| 13 | endif() |
| 14 | |
| 15 | #Include board specific config (CPU, etc...), select platform specific build |
| 16 | #system settings file |
| 17 | if(NOT DEFINED TARGET_PLATFORM) |
| 18 | message(FATAL_ERROR "ERROR: TARGET_PLATFORM is not set in command line") |
| 19 | elseif(${TARGET_PLATFORM} STREQUAL "AN521") |
| 20 | set(PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN521.cmake") |
| 21 | elseif(${TARGET_PLATFORM} STREQUAL "AN519") |
| 22 | set (PLATFORM_CMAKE_FILE "${TFM_ROOT_DIR}/platform/ext/Mps2AN519.cmake") |
| 23 | else() |
| 24 | message(FATAL_ERROR "ERROR: Target \"${TARGET_PLATFORM}\" is not supported.") |
| 25 | endif() |
| 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 |
| 31 | set(CORE_IPC False) |
| 32 | # TF-M isolation level: 1 |
| 33 | set(TFM_LVL 1) |
| 34 | |
| 35 | # BL2 settings can be overwritten in the profile extension configuration |
| 36 | # or in platform specific cmake file. |
| 37 | if(NOT DEFINED BL2) |
| 38 | set(BL2 True) |
| 39 | endif() |
| 40 | |
| 41 | if(BL2) |
| 42 | # Single binary boot |
| 43 | set(MCUBOOT_IMAGE_NUMBER 1 CACHE STRING "Single binary boot by default") |
| 44 | endif() |
| 45 | |
| 46 | # Enable Internal Trusted Storage service |
| 47 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON) |
David Hu | 06976a6 | 2019-12-26 15:41:08 +0800 | [diff] [blame] | 48 | # Decrease the transient internal buffer size to 32 bytes |
| 49 | set(ITS_BUF_SIZE 32) |
| 50 | |
| 51 | # Enable Crypto service |
| 52 | set(TFM_PARTITION_CRYPTO ON) |
| 53 | set(CRYPTO_ASYMMETRIC_MODULE_DISABLED ON) |
David Hu | 06976a6 | 2019-12-26 15:41:08 +0800 | [diff] [blame] | 54 | # Set the dedicated mbed-crypto default config file |
| 55 | set(MBEDTLS_CONFIG_FILE "tfm_profile_s_mbedcrypto_config.h") |
| 56 | |
| 57 | # Disable Audit Logging service |
| 58 | set(TFM_PARTITION_AUDIT_LOG OFF) |
| 59 | |
| 60 | # Disable Platform service |
| 61 | set(TFM_PARTITION_PLATFORM OFF) |
| 62 | |
Kevin Peng | c6d7450 | 2020-03-04 16:55:37 +0800 | [diff] [blame] | 63 | # Disable Protected Storage service |
| 64 | set(TFM_PARTITION_PROTECTED_STORAGE OFF) |
David Hu | 06976a6 | 2019-12-26 15:41:08 +0800 | [diff] [blame] | 65 | |
David Hu | 3b49ce7 | 2020-01-22 14:31:04 +0800 | [diff] [blame] | 66 | # Enable Initial Attestation service |
| 67 | set(TFM_PARTITION_INITIAL_ATTESTATION ON) |
| 68 | # Enable symmetric key algorithm based attestation |
| 69 | set(SYMMETRIC_INITIAL_ATTESTATION ON) |
| 70 | # Disable QCBOR test cases to save memory |
| 71 | set(ENABLE_QCBOR_TESTS OFF) |
| 72 | # Disable t_cose test cases to save memory |
| 73 | set(ENABLE_T_COSE_TESTS OFF) |
David Hu | 06976a6 | 2019-12-26 15:41:08 +0800 | [diff] [blame] | 74 | |
| 75 | # Configure the test cases |
| 76 | set(REGRESSION True) |
| 77 | set(CORE_TEST True) |
| 78 | set(PSA_API_TEST False) |
| 79 | # Configure Crypto test cases |
| 80 | set(TFM_CRYPTO_TEST_ALG_CBC OFF) |
| 81 | # Select AES-CCM by default |
| 82 | set(TFM_CRYPTO_TEST_ALG_CCM ON) |
| 83 | set(TFM_CRYPTO_TEST_ALG_CFB OFF) |
| 84 | set(TFM_CRYPTO_TEST_ALG_CTR OFF) |
| 85 | set(TFM_CRYPTO_TEST_ALG_GCM OFF) |
| 86 | set(TFM_CRYPTO_TEST_ALG_SHA_512 OFF) |
David Hu | 055dce7 | 2020-06-04 15:58:38 +0800 | [diff] [blame] | 87 | set(TFM_CRYPTO_TEST_HKDF OFF) |
David Hu | 06976a6 | 2019-12-26 15:41:08 +0800 | [diff] [blame] | 88 | |
| 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. |
| 93 | if(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") |
| 103 | endif() |
| 104 | |
| 105 | include("${TFM_ROOT_DIR}/CommonConfig.cmake") |