Raef Coles | a1f504c | 2020-07-10 09:58:55 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Anton Komlev | 8ab4f04 | 2025-06-03 21:13:07 +0100 | [diff] [blame] | 2 | # SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors |
Raef Coles | a1f504c | 2020-07-10 09:58:55 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Raef Coles | a1f504c | 2020-07-10 09:58:55 +0100 | [diff] [blame] | 8 | install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 9 | DESTINATION bin |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 10 | ) |
| 11 | |
David Hu | b24aead | 2020-10-17 19:46:19 +0800 | [diff] [blame] | 12 | # export veneer lib |
Chris Brand | ca81902 | 2022-07-19 09:25:15 -0700 | [diff] [blame] | 13 | if (CONFIG_TFM_USE_TRUSTZONE) |
Raef Coles | 25fc175 | 2020-11-24 12:04:42 +0000 | [diff] [blame] | 14 | install(FILES ${CMAKE_BINARY_DIR}/secure_fw/s_veneers.o |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 15 | DESTINATION ${INSTALL_INTERFACE_LIB_DIR}) |
David Hu | b24aead | 2020-10-17 19:46:19 +0800 | [diff] [blame] | 16 | endif() |
| 17 | |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 18 | ####################### export headers ######################################### |
| 19 | |
Antonio de Angelis | 2fffac9 | 2025-01-20 14:03:35 +0000 | [diff] [blame] | 20 | if (BL1 AND PLATFORM_DEFAULT_BL1) |
| 21 | install(DIRECTORY ${BL1_1_CONFIG_DIR}/ |
| 22 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}/bl1_1_config) |
| 23 | |
| 24 | install(DIRECTORY ${BL1_2_CONFIG_DIR}/ |
| 25 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}/bl1_2_config) |
| 26 | endif() |
| 27 | |
Nicola Mazzucato | 6414e29 | 2025-05-09 22:05:05 +0100 | [diff] [blame] | 28 | install(FILES ${INTERFACE_INC_DIR}/psa/api_broker.h |
| 29 | ${INTERFACE_INC_DIR}/psa/client.h |
| 30 | ${INTERFACE_INC_DIR}/hybrid_platform/api_broker_defs.h |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 31 | ${INTERFACE_INC_DIR}/psa/error.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 32 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 33 | |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 34 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/psa_manifest/sid.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 35 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa_manifest) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 36 | |
Kevin Peng | 27cf4de | 2023-10-26 16:04:46 +0800 | [diff] [blame] | 37 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/config_impl.h |
| 38 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 39 | |
Kevin Peng | 0e340ea | 2023-08-15 17:51:44 +0800 | [diff] [blame] | 40 | install(FILES ${INTERFACE_INC_DIR}/tfm_veneers.h |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 41 | ${INTERFACE_INC_DIR}/tfm_ns_interface.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 42 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 43 | |
Sherry Zhnag | 482b88b | 2021-08-19 17:51:47 +0800 | [diff] [blame] | 44 | install(FILES ${INTERFACE_INC_DIR}/tfm_ns_client_ext.h |
| 45 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 46 | |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 47 | install(FILES ${CMAKE_SOURCE_DIR}/secure_fw/include/config_tfm.h |
| 48 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
David Hu | 6d1a9b6 | 2023-02-22 16:54:04 +0800 | [diff] [blame] | 49 | install(FILES ${CMAKE_SOURCE_DIR}/config/config_base.h |
| 50 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Nicola Mazzucato | b369b33 | 2025-01-02 09:11:57 +0000 | [diff] [blame] | 51 | install(FILES ${CMAKE_SOURCE_DIR}/secure_fw/spm/include/tfm_hybrid_platform.h |
| 52 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 53 | |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 54 | install(FILES ${INTERFACE_INC_DIR}/tfm_psa_call_pack.h |
| 55 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 56 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/psa/framework_feature.h |
| 57 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
Xinyu Zhang | 93899d0 | 2021-05-11 10:48:52 +0800 | [diff] [blame] | 58 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 59 | if (TFM_PARTITION_NS_AGENT_MAILBOX) |
David Hu | 04969a4 | 2020-06-14 21:25:35 +0800 | [diff] [blame] | 60 | install(FILES ${INTERFACE_INC_DIR}/multi_core/tfm_multi_core_api.h |
| 61 | ${INTERFACE_INC_DIR}/multi_core/tfm_ns_mailbox.h |
| 62 | ${INTERFACE_INC_DIR}/multi_core/tfm_mailbox.h |
David Hu | cb91581 | 2021-12-27 14:22:04 +0800 | [diff] [blame] | 63 | ${INTERFACE_INC_DIR}/multi_core/tfm_ns_mailbox_test.h |
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 | 71f6dcc | 2023-10-18 11:52:21 +0800 | [diff] [blame] | 65 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/multi_core) |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 66 | endif() |
| 67 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 68 | if (TFM_PARTITION_PROTECTED_STORAGE) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 69 | install(FILES ${INTERFACE_INC_DIR}/psa/protected_storage.h |
Jamie Fox | 133ce09 | 2023-11-01 18:42:42 +0000 | [diff] [blame] | 70 | ${INTERFACE_INC_DIR}/psa/storage_common.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 71 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 72 | install(FILES ${INTERFACE_INC_DIR}/tfm_ps_defs.h |
| 73 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 74 | endif() |
| 75 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 76 | if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 77 | install(FILES ${INTERFACE_INC_DIR}/psa/internal_trusted_storage.h |
| 78 | ${INTERFACE_INC_DIR}/psa/storage_common.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 79 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 80 | install(FILES ${INTERFACE_INC_DIR}/tfm_its_defs.h |
| 81 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 82 | endif() |
| 83 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 84 | if (TFM_PARTITION_CRYPTO) |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 85 | install(FILES ${INTERFACE_INC_DIR}/psa/README.rst |
| 86 | ${INTERFACE_INC_DIR}/psa/build_info.h |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 87 | ${INTERFACE_INC_DIR}/psa/crypto.h |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 88 | ${INTERFACE_INC_DIR}/psa/crypto_adjust_auto_enabled.h |
Antonio de Angelis | a0b00f4 | 2024-09-18 12:07:25 +0100 | [diff] [blame] | 89 | ${INTERFACE_INC_DIR}/psa/crypto_adjust_config_dependencies.h |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 90 | ${INTERFACE_INC_DIR}/psa/crypto_adjust_config_key_pair_types.h |
| 91 | ${INTERFACE_INC_DIR}/psa/crypto_adjust_config_synonyms.h |
| 92 | ${INTERFACE_INC_DIR}/psa/crypto_builtin_composites.h |
| 93 | ${INTERFACE_INC_DIR}/psa/crypto_builtin_key_derivation.h |
| 94 | ${INTERFACE_INC_DIR}/psa/crypto_builtin_primitives.h |
| 95 | ${INTERFACE_INC_DIR}/psa/crypto_compat.h |
| 96 | ${INTERFACE_INC_DIR}/psa/crypto_driver_common.h |
| 97 | ${INTERFACE_INC_DIR}/psa/crypto_driver_contexts_composites.h |
| 98 | ${INTERFACE_INC_DIR}/psa/crypto_driver_contexts_key_derivation.h |
| 99 | ${INTERFACE_INC_DIR}/psa/crypto_driver_contexts_primitives.h |
| 100 | ${INTERFACE_INC_DIR}/psa/crypto_extra.h |
| 101 | ${INTERFACE_INC_DIR}/psa/crypto_legacy.h |
Xinyu Zhang | fce2037 | 2023-04-10 14:43:47 +0800 | [diff] [blame] | 102 | ${INTERFACE_INC_DIR}/psa/crypto_platform.h |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 103 | ${INTERFACE_INC_DIR}/psa/crypto_se_driver.h |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 104 | ${INTERFACE_INC_DIR}/psa/crypto_sizes.h |
| 105 | ${INTERFACE_INC_DIR}/psa/crypto_struct.h |
| 106 | ${INTERFACE_INC_DIR}/psa/crypto_types.h |
| 107 | ${INTERFACE_INC_DIR}/psa/crypto_values.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 108 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 109 | install(FILES ${INTERFACE_INC_DIR}/tfm_crypto_defs.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 110 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Antonio de Angelis | 8bb9851 | 2024-01-16 14:13:36 +0000 | [diff] [blame] | 111 | install(DIRECTORY ${INTERFACE_INC_DIR}/mbedtls |
| 112 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 113 | endif() |
| 114 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 115 | if (TFM_PARTITION_INITIAL_ATTESTATION) |
David Hu | 9191b61 | 2023-06-08 12:02:39 +0800 | [diff] [blame] | 116 | install(FILES ${CMAKE_BINARY_DIR}/generated/interface/include/psa/initial_attestation.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 117 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 118 | install(FILES ${INTERFACE_INC_DIR}/tfm_attest_defs.h |
David Hu | 32bd615 | 2022-09-27 13:10:36 +0800 | [diff] [blame] | 119 | ${INTERFACE_INC_DIR}/tfm_attest_iat_defs.h |
David Hu | dc8cb9e | 2021-11-10 12:45:59 +0800 | [diff] [blame] | 120 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 121 | endif() |
| 122 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 123 | if(TFM_PARTITION_PLATFORM) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 124 | install(FILES ${INTERFACE_INC_DIR}/tfm_platform_api.h |
Raef Coles | 4fed463 | 2020-12-08 12:56:47 +0000 | [diff] [blame] | 125 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 126 | endif() |
| 127 | |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 128 | if(TFM_PARTITION_FIRMWARE_UPDATE) |
| 129 | install(FILES ${INTERFACE_INC_DIR}/psa/update.h |
Sherry Zhang | 73126e5 | 2022-02-15 14:27:49 +0800 | [diff] [blame] | 130 | ${CMAKE_BINARY_DIR}/generated/interface/include/psa/fwu_config.h |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 131 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}/psa) |
| 132 | install(FILES ${INTERFACE_INC_DIR}/tfm_fwu_defs.h |
| 133 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 134 | endif() |
| 135 | |
David Hu | 32bd615 | 2022-09-27 13:10:36 +0800 | [diff] [blame] | 136 | if(PLATFORM_DEFAULT_CRYPTO_KEYS) |
| 137 | install(DIRECTORY ${INTERFACE_INC_DIR}/crypto_keys |
| 138 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
| 139 | endif() |
| 140 | |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 141 | ####################### export sources ######################################### |
| 142 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 143 | if (TFM_PARTITION_NS_AGENT_MAILBOX) |
David Hu | 04969a4 | 2020-06-14 21:25:35 +0800 | [diff] [blame] | 144 | install(FILES ${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox.c |
| 145 | ${INTERFACE_SRC_DIR}/multi_core/tfm_multi_core_ns_api.c |
| 146 | ${INTERFACE_SRC_DIR}/multi_core/tfm_multi_core_psa_ns_api.c |
David Hu | d597345 | 2020-11-26 16:47:46 +0800 | [diff] [blame] | 147 | ${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox_thread.c |
Nicola Mazzucato | f21b300 | 2025-06-04 11:01:05 +0100 | [diff] [blame] | 148 | ${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox_common.c |
David Hu | 32bd615 | 2022-09-27 13:10:36 +0800 | [diff] [blame] | 149 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}/multi_core) |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 150 | endif() |
David Hu | f07f3f1 | 2021-04-06 18:03:33 +0800 | [diff] [blame] | 151 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 152 | if (TFM_PARTITION_NS_AGENT_TZ) |
Xinyu Zhang | 1c12d56 | 2023-10-24 12:02:22 +0800 | [diff] [blame] | 153 | install(FILES ${INTERFACE_SRC_DIR}/tfm_tz_psa_ns_api.c |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 154 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
| 155 | endif() |
| 156 | |
Chris Brand | 4ac274d | 2024-01-03 15:31:37 -0800 | [diff] [blame] | 157 | install(DIRECTORY ${INTERFACE_INC_DIR}/os_wrapper |
| 158 | DESTINATION ${INSTALL_INTERFACE_INC_DIR}) |
BohdanHunko | f871df0 | 2023-02-03 14:36:41 +0200 | [diff] [blame] | 159 | |
Chris Brand | fbf3f46 | 2022-06-23 15:27:20 -0700 | [diff] [blame] | 160 | if (CONFIG_TFM_USE_TRUSTZONE) |
BohdanHunko | f871df0 | 2023-02-03 14:36:41 +0200 | [diff] [blame] | 161 | install(DIRECTORY ${INTERFACE_SRC_DIR}/os_wrapper |
David Hu | f07f3f1 | 2021-04-06 18:03:33 +0800 | [diff] [blame] | 162 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 163 | endif() |
| 164 | |
Nicola Mazzucato | 6414e29 | 2025-05-09 22:05:05 +0100 | [diff] [blame] | 165 | if (TFM_HYBRID_PLATFORM_API_BROKER) |
| 166 | install(DIRECTORY ${INTERFACE_SRC_DIR}/hybrid_platform |
| 167 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
| 168 | endif() |
| 169 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 170 | if (TFM_PARTITION_PROTECTED_STORAGE) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 171 | install(FILES ${INTERFACE_SRC_DIR}/tfm_ps_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 172 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 173 | endif() |
| 174 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 175 | if (TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 176 | install(FILES ${INTERFACE_SRC_DIR}/tfm_its_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 177 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 178 | endif() |
| 179 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 180 | if (TFM_PARTITION_CRYPTO) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 181 | install(FILES ${INTERFACE_SRC_DIR}/tfm_crypto_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 182 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 183 | endif() |
| 184 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 185 | if (TFM_PARTITION_INITIAL_ATTESTATION) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 186 | install(FILES ${INTERFACE_SRC_DIR}/tfm_attest_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 187 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 188 | endif() |
| 189 | |
Mark Horvath | fbc2c50 | 2022-09-09 16:16:07 +0200 | [diff] [blame] | 190 | if(TFM_PARTITION_PLATFORM) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 191 | install(FILES ${INTERFACE_SRC_DIR}/tfm_platform_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 192 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Raef Coles | 035c83b | 2020-09-29 10:32:52 +0100 | [diff] [blame] | 193 | endif() |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 194 | |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 195 | ##################### Export image signing information ######################### |
| 196 | |
Raef Coles | cdf3931 | 2023-11-03 14:37:18 +0000 | [diff] [blame] | 197 | if(BL2 AND PLATFORM_DEFAULT_IMAGE_SIGNING) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 198 | install(DIRECTORY bl2/ext/mcuboot/scripts |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 199 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR} |
| 200 | PATTERN "scripts/*.py" |
| 201 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ |
| 202 | GROUP_EXECUTE GROUP_READ |
| 203 | PATTERN "scripts/wrapper/*.py" |
| 204 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ |
| 205 | GROUP_EXECUTE GROUP_READ) |
| 206 | |
| 207 | install(DIRECTORY ${MCUBOOT_PATH}/scripts/imgtool |
| 208 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/scripts) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 209 | |
| 210 | if (MCUBOOT_ENC_IMAGES) |
| 211 | install(FILES ${MCUBOOT_KEY_ENC} |
Raef Coles | 1d68b87 | 2023-11-06 16:33:34 +0000 | [diff] [blame] | 212 | RENAME image_enc_key.pem |
Alamy Liu | 2c13c03 | 2021-01-20 09:55:50 -0800 | [diff] [blame] | 213 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 214 | endif() |
| 215 | |
Raef Coles | 1d68b87 | 2023-11-06 16:33:34 +0000 | [diff] [blame] | 216 | install(FILES $<TARGET_OBJECTS:signing_layout_s> |
Alamy Liu | 2c13c03 | 2021-01-20 09:55:50 -0800 | [diff] [blame] | 217 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/layout_files) |
Raef Coles | 1d68b87 | 2023-11-06 16:33:34 +0000 | [diff] [blame] | 218 | install(FILES ${MCUBOOT_KEY_S} |
| 219 | RENAME image_s_signing_private_key.pem |
Bence Balogh | de3e121 | 2023-07-07 13:07:38 +0200 | [diff] [blame] | 220 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
David Hu | 7673422 | 2023-11-15 12:17:17 +0800 | [diff] [blame] | 221 | # Specify the MCUBOOT_KEY_S path for NS build |
| 222 | set(MCUBOOT_INSTALL_KEY_S |
| 223 | ${INSTALL_IMAGE_SIGNING_DIR}/keys/image_s_signing_private_key.pem) |
Raef Coles | 1d68b87 | 2023-11-06 16:33:34 +0000 | [diff] [blame] | 224 | install(FILES $<TARGET_FILE_DIR:bl2>/image_s_signing_public_key.pem |
Bence Balogh | 11074a2 | 2023-09-29 17:53:06 +0200 | [diff] [blame] | 225 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 226 | |
Raef Coles | 1d68b87 | 2023-11-06 16:33:34 +0000 | [diff] [blame] | 227 | if(MCUBOOT_IMAGE_NUMBER GREATER 1) |
| 228 | install(FILES $<TARGET_OBJECTS:signing_layout_ns> |
| 229 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/layout_files) |
| 230 | install(FILES ${MCUBOOT_KEY_NS} |
| 231 | RENAME image_ns_signing_private_key.pem |
David Hu | 7673422 | 2023-11-15 12:17:17 +0800 | [diff] [blame] | 232 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
| 233 | # Specify the MCUBOOT_KEY_NS path for NS build |
| 234 | set(MCUBOOT_INSTALL_KEY_NS |
| 235 | ${INSTALL_IMAGE_SIGNING_DIR}/keys/image_ns_signing_private_key.pem) |
Raef Coles | 1d68b87 | 2023-11-06 16:33:34 +0000 | [diff] [blame] | 236 | install(FILES $<TARGET_FILE_DIR:bl2>/image_ns_signing_public_key.pem |
| 237 | DESTINATION ${INSTALL_IMAGE_SIGNING_DIR}/keys) |
| 238 | endif() |
Raef Coles | b6814d5 | 2020-12-08 13:15:40 +0000 | [diff] [blame] | 239 | endif() |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 240 | |
| 241 | if(TFM_PARTITION_FIRMWARE_UPDATE) |
Summer Qin | d23bbb3 | 2022-10-18 15:30:06 +0800 | [diff] [blame] | 242 | install(FILES ${INTERFACE_SRC_DIR}/tfm_fwu_api.c |
Summer Qin | 566e03b | 2022-10-08 17:27:42 +0800 | [diff] [blame] | 243 | DESTINATION ${INSTALL_INTERFACE_SRC_DIR}) |
Sherry Zhang | 07b4241 | 2021-01-07 14:19:41 +0800 | [diff] [blame] | 244 | endif() |
Chris Brand | 9edf081 | 2022-07-05 14:18:42 -0700 | [diff] [blame] | 245 | |
Jianliang Shen | bd624ed | 2023-10-24 15:42:59 +0800 | [diff] [blame] | 246 | ######################### Export common configurations ######################### |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 247 | |
Dávid Házi | e793228 | 2023-11-11 23:59:53 +0100 | [diff] [blame] | 248 | install(FILES ${CMAKE_SOURCE_DIR}/config/cp_check.cmake |
Jianliang Shen | bd624ed | 2023-10-24 15:42:59 +0800 | [diff] [blame] | 249 | DESTINATION ${INSTALL_CONFIG_DIR}) |
David Hu | 895cdc3 | 2023-01-16 19:19:25 +0800 | [diff] [blame] | 250 | |
David Hu | 0601777 | 2023-11-07 18:22:42 +0800 | [diff] [blame] | 251 | ################### Read recommended tf-m-tests version ######################## |
| 252 | |
| 253 | include(${CMAKE_SOURCE_DIR}/lib/ext/tf-m-tests/read_version.cmake) |
| 254 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 255 | ###################### Install NS platform sources ############################# |
Chris Brand | 9edf081 | 2022-07-05 14:18:42 -0700 | [diff] [blame] | 256 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 257 | install(CODE "MESSAGE(\"----- Installing platform NS -----\")") |
| 258 | |
Jamie Fox | 62683db | 2024-03-12 15:50:41 +0000 | [diff] [blame] | 259 | install(DIRECTORY $<BUILD_INTERFACE:${CMSIS_PATH}/CMSIS/Core/Include> |
Jamie Fox | 1ec133d | 2024-06-20 16:20:15 +0100 | [diff] [blame] | 260 | $<BUILD_INTERFACE:${CMSIS_PATH}/CMSIS/Driver/Include> |
Gergely Korcsák | 3d54aca | 2024-02-05 17:29:58 +0100 | [diff] [blame] | 261 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}/ext/cmsis) |
David Hu | 66bd9a0 | 2023-10-18 22:34:19 +0800 | [diff] [blame] | 262 | |
| 263 | if(PLATFORM_DEFAULT_UART_STDOUT) |
| 264 | install(FILES ${PLATFORM_DIR}/ext/common/uart_stdout.c |
| 265 | ${PLATFORM_DIR}/ext/common/uart_stdout.h |
| 266 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}/ext/common) |
| 267 | endif() |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 268 | |
David Hu | 71f6dcc | 2023-10-18 11:52:21 +0800 | [diff] [blame] | 269 | install(DIRECTORY ${PLATFORM_DIR}/include |
| 270 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}) |
| 271 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 272 | install(FILES ${CMAKE_SOURCE_DIR}/cmake/spe-CMakeLists.cmake |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 273 | DESTINATION ${CMAKE_INSTALL_PREFIX} |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 274 | RENAME CMakeLists.txt) |
| 275 | |
David Hu | c28b9b2 | 2023-10-14 15:33:16 +0800 | [diff] [blame] | 276 | install(FILES ${PLATFORM_DIR}/ns/toolchain_ns_GNUARM.cmake |
| 277 | ${PLATFORM_DIR}/ns/toolchain_ns_ARMCLANG.cmake |
David Hu | 2bbcb96 | 2023-11-01 14:29:53 +0800 | [diff] [blame] | 278 | ${PLATFORM_DIR}/ns/toolchain_ns_IARARM.cmake |
Matthew Dalzell | eb375ba | 2025-02-05 16:23:45 +0000 | [diff] [blame] | 279 | ${PLATFORM_DIR}/ns/toolchain_ns_CLANG.cmake |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 280 | DESTINATION ${INSTALL_CMAKE_DIR}) |
| 281 | |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 282 | install(FILES |
| 283 | ${CMAKE_SOURCE_DIR}/lib/fih/inc/fih.h |
| 284 | ${PLATFORM_DIR}/include/tfm_plat_ns.h |
| 285 | DESTINATION ${INSTALL_PLATFORM_NS_DIR}/include) |
| 286 | |
| 287 | if (TARGET psa_crypto_config) |
| 288 | # FIXIT: This is a temporal patch to reduce the change scope and simplify review. |
| 289 | # In the future we shall decouple this target from tfm_config becuase |
| 290 | # "psa_crypto_config" target exists not in all configurations. |
| 291 | # Functionally "psa_crypto_config" provides only include path for Crypto accelerator. |
| 292 | install(TARGETS tfm_config psa_crypto_config psa_interface |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 293 | DESTINATION ${CMAKE_INSTALL_PREFIX} |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 294 | EXPORT tfm-config |
| 295 | ) |
| 296 | else() |
| 297 | install(TARGETS tfm_config psa_interface |
Anton Komlev | 3dd9863 | 2023-09-20 16:26:30 +0100 | [diff] [blame] | 298 | DESTINATION ${CMAKE_INSTALL_PREFIX} |
Anton Komlev | aee4b61 | 2023-05-14 17:38:36 +0100 | [diff] [blame] | 299 | EXPORT tfm-config |
| 300 | ) |
| 301 | endif() |
| 302 | |
| 303 | target_include_directories(psa_interface |
| 304 | INTERFACE |
| 305 | $<INSTALL_INTERFACE:interface/include> |
| 306 | ) |
| 307 | |
| 308 | install(EXPORT tfm-config |
| 309 | FILE spe_export.cmake |
| 310 | DESTINATION ${INSTALL_CMAKE_DIR}) |
| 311 | |
| 312 | configure_file(${CMAKE_SOURCE_DIR}/config/spe_config.cmake.in |
| 313 | ${INSTALL_CMAKE_DIR}/spe_config.cmake @ONLY) |
David Hu | 9af4d7d | 2023-11-01 07:52:17 +0800 | [diff] [blame] | 314 | |
| 315 | # Toolchain utils |
Anton Komlev | 8ab4f04 | 2025-06-03 21:13:07 +0100 | [diff] [blame] | 316 | install(FILES |
| 317 | cmake/set_extensions.cmake |
| 318 | cmake/mcpu_features.cmake |
David Hu | 9af4d7d | 2023-11-01 07:52:17 +0800 | [diff] [blame] | 319 | DESTINATION ${INSTALL_CMAKE_DIR}) |