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