Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Nicola Mazzucato | 6414e29 | 2025-05-09 22:05:05 +0100 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors |
Chris Brand | d079033 | 2022-05-20 13:36:30 -0700 | [diff] [blame] | 3 | # Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company) |
| 4 | # or an affiliate of Cypress Semiconductor Corporation. All rights reserved. |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 5 | # |
| 6 | # SPDX-License-Identifier: BSD-3-Clause |
| 7 | # |
| 8 | #------------------------------------------------------------------------------- |
| 9 | |
David Hu | 1249f0d | 2023-12-04 22:57:56 +0800 | [diff] [blame] | 10 | cmake_minimum_required(VERSION 3.21) |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 11 | |
Kevin Peng | 386374c | 2021-11-04 14:36:17 +0800 | [diff] [blame] | 12 | # Generate framework feature |
Kevin Peng | 710acf5 | 2021-11-16 11:42:41 +0800 | [diff] [blame] | 13 | set(PSA_FRAMEWORK_ISOLATION_LEVEL ${TFM_ISOLATION_LEVEL}) |
Kevin Peng | 386374c | 2021-11-04 14:36:17 +0800 | [diff] [blame] | 14 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/psa/framework_feature.h.in |
Kevin Peng | 710acf5 | 2021-11-16 11:42:41 +0800 | [diff] [blame] | 15 | ${CMAKE_BINARY_DIR}/generated/interface/include/psa/framework_feature.h |
| 16 | @ONLY) |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 17 | |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 18 | ###################### PSA interface (header only) ############################# |
| 19 | |
| 20 | add_library(psa_interface INTERFACE) |
| 21 | |
| 22 | target_include_directories(psa_interface |
| 23 | INTERFACE |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 24 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> |
| 25 | $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated/interface/include> |
| 26 | $<BUILD_INTERFACE:$<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:${CMAKE_CURRENT_SOURCE_DIR}/include/multi_core>> |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 27 | ) |
| 28 | |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 29 | target_link_libraries(psa_interface |
| 30 | INTERFACE |
Xinyu Zhang | cdbe362 | 2022-10-31 14:34:25 +0800 | [diff] [blame] | 31 | tfm_config |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 32 | ) |
| 33 | |
| 34 | target_compile_definitions(psa_interface |
| 35 | INTERFACE |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 36 | $<$<BOOL:${CONFIG_TFM_ENABLE_CTX_MGMT}>:CONFIG_TFM_ENABLE_CTX_MGMT> |
Xinyu Zhang | ae99e2d | 2023-07-28 14:03:29 +0800 | [diff] [blame] | 37 | $<$<BOOL:${TFM_ISOLATION_LEVEL}>:TFM_ISOLATION_LEVEL=${TFM_ISOLATION_LEVEL}> |
Chris Brand | ca81902 | 2022-07-19 09:25:15 -0700 | [diff] [blame] | 38 | $<$<BOOL:${CONFIG_TFM_USE_TRUSTZONE}>:CONFIG_TFM_USE_TRUSTZONE> |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 39 | $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:TFM_MULTI_CORE_TOPOLOGY> |
Summer Qin | 2a29959 | 2022-02-07 17:37:10 +0800 | [diff] [blame] | 40 | $<$<BOOL:${CONFIG_TFM_PARTITION_META}>:CONFIG_TFM_PARTITION_META> |
David Hu | b27a663 | 2023-10-23 22:38:39 +0800 | [diff] [blame] | 41 | $<$<BOOL:${TEST_NS_MULTI_CORE}>:TFM_MULTI_CORE_TEST> |
Nicola Mazzucato | 6414e29 | 2025-05-09 22:05:05 +0100 | [diff] [blame] | 42 | $<$<BOOL:${TFM_HYBRID_PLATFORM_API_BROKER}>:TFM_HYBRID_PLATFORM_API_BROKER> |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 43 | ) |
| 44 | |
Anton Komlev | 26023ea | 2024-11-20 14:50:10 +0000 | [diff] [blame] | 45 | add_dependencies(psa_interface manifest_tool) |
| 46 | |
Raef Coles | 7d3545b | 2020-07-10 10:00:35 +0100 | [diff] [blame] | 47 | ###################### PSA api (S lib) ######################################### |
| 48 | |
Kevin Peng | 8b8f7a4 | 2022-08-05 17:56:30 +0800 | [diff] [blame] | 49 | target_sources(tfm_sprt |
| 50 | PRIVATE |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 51 | $<$<BOOL:${TFM_PARTITION_INITIAL_ATTESTATION}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_attest_api.c> |
| 52 | $<$<BOOL:${TFM_PARTITION_CRYPTO}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_crypto_api.c> |
| 53 | $<$<BOOL:${TFM_PARTITION_FIRMWARE_UPDATE}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_fwu_api.c> |
| 54 | $<$<BOOL:${TFM_PARTITION_INTERNAL_TRUSTED_STORAGE}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_its_api.c> |
| 55 | $<$<BOOL:${TFM_PARTITION_PLATFORM}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_platform_api.c> |
| 56 | $<$<BOOL:${TFM_PARTITION_PROTECTED_STORAGE}>:${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_ps_api.c> |
Xinyu Zhang | 526bf5f | 2023-04-18 13:58:15 +0800 | [diff] [blame] | 57 | ${CMAKE_CURRENT_SOURCE_DIR}/src/tfm_psa_call.c |
Kevin Peng | 8b8f7a4 | 2022-08-05 17:56:30 +0800 | [diff] [blame] | 58 | ) |
| 59 | |
David Hu | 8b526d4 | 2020-11-27 20:59:52 +0800 | [diff] [blame] | 60 | ###################### Export configurations to NS ############################# |
| 61 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 62 | if (TFM_MULTI_CORE_TOPOLOGY) |
David Hu | 8b526d4 | 2020-11-27 20:59:52 +0800 | [diff] [blame] | 63 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/multi_core/tfm_mailbox_config.h.in |
David Hu | 186a129 | 2021-09-13 09:05:52 +0800 | [diff] [blame] | 64 | ${CMAKE_BINARY_DIR}/generated/interface/include/tfm_mailbox_config.h |
David Hu | 8b526d4 | 2020-11-27 20:59:52 +0800 | [diff] [blame] | 65 | NEWLINE_STYLE UNIX |
| 66 | ) |
| 67 | endif() |