blob: 96b0728899c4d40aa36404df0122e1b89b9ddafa [file] [log] [blame]
Jamie Foxab30e712023-03-30 17:48:36 +01001#-------------------------------------------------------------------------------
Jamie Fox63c33f12024-04-12 17:36:07 +01002# Copyright (c) 2023-2024, Arm Limited. All rights reserved.
Jamie Foxab30e712023-03-30 17:48:36 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8if (NOT TFM_PARTITION_DPE)
9 return()
10endif()
11
12cmake_minimum_required(VERSION 3.15)
13cmake_policy(SET CMP0079 NEW)
14
15# The name of the target is required to be of the pattern
16# tfm_app_rot_partition_x or tfm_psa_rot_partition_x, as it affects how the
17# linker script will lay the partition in memory.
18add_library(tfm_app_rot_partition_dpe STATIC)
19
20target_sources(tfm_app_rot_partition_dpe
21 PRIVATE
Jamie Fox34681992023-09-04 18:14:06 +010022 dpe_boot_data.c
Maulik Patel2358bbb2023-07-21 10:56:56 +010023 dpe_certificate.c
Jamie Foxab30e712023-03-30 17:48:36 +010024 dpe_cmd_decode.c
Maulik Patelad2f3db2023-05-17 15:41:36 +010025 dpe_context_mngr.c
Maulik Patel58595d32023-06-22 10:08:53 +010026 dpe_crypto_interface.c
Jamie Foxe7f8b4e2023-05-30 18:03:20 +010027 dpe_log.c
Jamie Foxab30e712023-03-30 17:48:36 +010028 dpe_req_mngr.c
29)
30
31# Add the source files generated by parse tools when building.
32# The intermedia file defines the partition stack.
33target_sources(tfm_app_rot_partition_dpe
34 PRIVATE
35 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/intermedia_tfm_dpe.c
36)
37
38# The load info file includes the static data of the partition.
39target_sources(tfm_partitions
40 INTERFACE
41 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/load_info_tfm_dpe.c
42)
43
44target_include_directories(tfm_app_rot_partition_dpe
45 PRIVATE
46 ${CMAKE_CURRENT_SOURCE_DIR}
47 PUBLIC
48 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment
49)
50
Maulik Patelad2f3db2023-05-17 15:41:36 +010051target_compile_definitions(tfm_app_rot_partition_dpe
52 PRIVATE
Jamie Fox63c33f12024-04-12 17:36:07 +010053 $<$<OR:$<BOOL:${TFM_S_REG_TEST}>,$<BOOL:${TFM_NS_REG_TEST}>>:DPE_TEST_MODE>
Maulik Patelad2f3db2023-05-17 15:41:36 +010054)
55
Jamie Foxab30e712023-03-30 17:48:36 +010056target_link_libraries(tfm_app_rot_partition_dpe
57 PRIVATE
58 tfm_sprt
59 qcbor
Maulik Patel2358bbb2023-07-21 10:56:56 +010060 tfm_t_cose_s
Jamie Fox34681992023-09-04 18:14:06 +010061 platform_s
Antonio de Angelis2f6601f2024-02-07 13:34:59 +000062 psa_crypto_config
Jamie Foxab30e712023-03-30 17:48:36 +010063)
64
65############################ Secure API ########################################
66
67target_sources(tfm_sprt
68 PRIVATE
69 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
70 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
71)
72
73target_include_directories(tfm_sprt
74 PUBLIC
75 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include
76)
77
78target_link_libraries(tfm_sprt
79 PRIVATE
80 qcbor
81)
82
Jamie Foxab30e712023-03-30 17:48:36 +010083############################ Partition Defs ####################################
84
85target_link_libraries(tfm_partitions
86 INTERFACE
87 tfm_app_rot_partition_dpe
88)
89
90target_compile_definitions(tfm_config
91 INTERFACE
92 TFM_PARTITION_DPE
93)
94
95install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
96 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
Jamie Fox805db7b2023-11-01 18:46:58 +000097 DESTINATION ${INSTALL_INTERFACE_SRC_DIR})
Jamie Foxab30e712023-03-30 17:48:36 +010098
Jamie Fox63c33f12024-04-12 17:36:07 +010099install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/
Jamie Fox805db7b2023-11-01 18:46:58 +0000100 DESTINATION ${INSTALL_INTERFACE_INC_DIR})