Soby Mathew | 3b9e184 | 2020-10-07 12:04:56 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------ |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited. All rights reserved. |
Soby Mathew | 3b9e184 | 2020-10-07 12:04:56 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------ |
| 7 | |
| 8 | ############ Override defaults for PSA API tests ############################## |
Kevin Peng | 80f5f43 | 2021-11-03 15:45:13 +0800 | [diff] [blame] | 9 | if ("${TEST_PSA_API}" STREQUAL "IPC") |
David Hu | 020f1f3 | 2022-11-16 15:02:23 +0800 | [diff] [blame] | 10 | # PSA Arch test partitions only support IPC model so far |
| 11 | set(CONFIG_TFM_SPM_BACKEND "IPC" CACHE STRING "The SPM backend [IPC, SFN]") |
Kevin Peng | 80f5f43 | 2021-11-03 15:45:13 +0800 | [diff] [blame] | 12 | set(TFM_PARTITION_FF_TEST ON) |
| 13 | else() |
| 14 | set(TFM_PARTITION_FF_TEST OFF) |
| 15 | endif() |
David Hu | 020f1f3 | 2022-11-16 15:02:23 +0800 | [diff] [blame] | 16 | |
| 17 | if ("${TEST_PSA_API}" STREQUAL "INITIAL_ATTESTATION") |
| 18 | set(TFM_PARTITION_INITIAL_ATTESTATION ON CACHE BOOL "Enable Initial Attestation partition") |
| 19 | set(TFM_PARTITION_CRYPTO ON CACHE BOOL "Enable Crypto partition") |
| 20 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON CACHE BOOL "Enable Internal Trusted Storage partition") |
| 21 | set(TFM_PARTITION_PLATFORM ON CACHE BOOL "Enable Platform partition") |
| 22 | endif() |
| 23 | |
| 24 | if ("${TEST_PSA_API}" STREQUAL "CRYPTO") |
| 25 | set(TFM_PARTITION_CRYPTO ON CACHE BOOL "Enable Crypto partition") |
| 26 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON CACHE BOOL "Enable Internal Trusted Storage partition") |
| 27 | set(TFM_PARTITION_PLATFORM ON CACHE BOOL "Enable Platform partition") |
| 28 | endif() |
| 29 | |
| 30 | if ("${TEST_PSA_API}" STREQUAL "STORAGE") |
| 31 | set(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE ON CACHE BOOL "Enable Internal Trusted Storage partition") |
| 32 | set(TFM_PARTITION_PROTECTED_STORAGE ON CACHE BOOL "Enable Protected Storage partition") |
| 33 | set(TFM_PARTITION_CRYPTO ON CACHE BOOL "Enable Crypto partition") |
| 34 | set(TFM_PARTITION_PLATFORM ON CACHE BOOL "Enable Platform partition") |
| 35 | endif() |
Xinyu Zhang | d755b82 | 2022-10-25 11:18:09 +0800 | [diff] [blame] | 36 | |
Xinyu Zhang | e7581b1 | 2022-11-23 14:19:02 +0800 | [diff] [blame] | 37 | target_compile_definitions(tfm_config |
| 38 | INTERFACE |
| 39 | $<$<STREQUAL:${TEST_PSA_API},CRYPTO>:TEST_PSA_API_CRYPTO> |
Xinyu Zhang | 44dbfa6 | 2022-11-23 14:22:32 +0800 | [diff] [blame^] | 40 | $<$<STREQUAL:${TEST_PSA_API},IPC>:TEST_PSA_API_IPC> |
Xinyu Zhang | e7581b1 | 2022-11-23 14:19:02 +0800 | [diff] [blame] | 41 | ) |
| 42 | |
| 43 | set(PROJECT_CONFIG_HEADER_FILE "${CMAKE_SOURCE_DIR}/config/tests/config_test_psa_api.h" CACHE FILEPATH "User defined header file for TF-M config") |