blob: b5eb6373cd3d7c5c1cf22af01db1632142c33430 [file] [log] [blame]
Jamie Foxab30e712023-03-30 17:48:36 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited. All rights reserved.
3#
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
22 dpe_cmd_decode.c
Maulik Patelad2f3db2023-05-17 15:41:36 +010023 dpe_context_mngr.c
Jamie Foxab30e712023-03-30 17:48:36 +010024 dpe_impl.c
Jamie Foxe7f8b4e2023-05-30 18:03:20 +010025 dpe_log.c
Jamie Foxab30e712023-03-30 17:48:36 +010026 dpe_req_mngr.c
27)
28
29# Add the source files generated by parse tools when building.
30# The intermedia file defines the partition stack.
31target_sources(tfm_app_rot_partition_dpe
32 PRIVATE
33 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/intermedia_tfm_dpe.c
34)
35
36# The load info file includes the static data of the partition.
37target_sources(tfm_partitions
38 INTERFACE
39 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment/auto_generated/load_info_tfm_dpe.c
40)
41
42target_include_directories(tfm_app_rot_partition_dpe
43 PRIVATE
44 ${CMAKE_CURRENT_SOURCE_DIR}
45 PUBLIC
46 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/dice_protection_environment
47)
48
Maulik Patelad2f3db2023-05-17 15:41:36 +010049target_compile_definitions(tfm_app_rot_partition_dpe
50 PRIVATE
51 $<$<BOOL:${TFM_S_REG_TEST}>:TFM_S_REG_TEST>
52)
53
Jamie Foxab30e712023-03-30 17:48:36 +010054target_link_libraries(tfm_app_rot_partition_dpe
55 PRIVATE
56 tfm_sprt
57 qcbor
58)
59
60############################ Secure API ########################################
61
62target_sources(tfm_sprt
63 PRIVATE
64 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
65 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
66)
67
68target_include_directories(tfm_sprt
69 PUBLIC
70 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include
71)
72
73target_link_libraries(tfm_sprt
74 PRIVATE
75 qcbor
76)
77
78############################ Non-secure API ####################################
79
80add_library(dpe_api_ns INTERFACE)
81
82target_sources(dpe_api_ns
83 INTERFACE
84 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
85 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
86)
87
88target_include_directories(dpe_api_ns
89 INTERFACE
90 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include
91)
92
93target_link_libraries(dpe_api_ns
94 INTERFACE
95 tfm_qcbor_ns
96)
97
98############################ Partition Defs ####################################
99
100target_link_libraries(tfm_partitions
101 INTERFACE
102 tfm_app_rot_partition_dpe
103)
104
105target_compile_definitions(tfm_config
106 INTERFACE
107 TFM_PARTITION_DPE
108)
109
110install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
111 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
112 DESTINATION ${TFM_INSTALL_PATH}/interface/src)
113
114install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dice_protection_environment.h
115 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dpe_client.h
116 DESTINATION ${TFM_INSTALL_PATH}/interface/include)