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