blob: 424513448887d46e922925f68608883ae7d5ba59 [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
Maulik Patel2358bbb2023-07-21 10:56:56 +010022 dpe_certificate.c
Jamie Foxab30e712023-03-30 17:48:36 +010023 dpe_cmd_decode.c
Maulik Patelad2f3db2023-05-17 15:41:36 +010024 dpe_context_mngr.c
Maulik Patel58595d32023-06-22 10:08:53 +010025 dpe_crypto_interface.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
Maulik Patel2358bbb2023-07-21 10:56:56 +010059 tfm_t_cose_s
Jamie Foxab30e712023-03-30 17:48:36 +010060)
61
62############################ Secure API ########################################
63
64target_sources(tfm_sprt
65 PRIVATE
66 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
67 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
68)
69
70target_include_directories(tfm_sprt
71 PUBLIC
72 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include
73)
74
75target_link_libraries(tfm_sprt
76 PRIVATE
77 qcbor
78)
79
80############################ Non-secure API ####################################
81
82add_library(dpe_api_ns INTERFACE)
83
84target_sources(dpe_api_ns
85 INTERFACE
86 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
87 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
88)
89
90target_include_directories(dpe_api_ns
91 INTERFACE
92 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include
93)
94
95target_link_libraries(dpe_api_ns
96 INTERFACE
97 tfm_qcbor_ns
98)
99
100############################ Partition Defs ####################################
101
102target_link_libraries(tfm_partitions
103 INTERFACE
104 tfm_app_rot_partition_dpe
105)
106
107target_compile_definitions(tfm_config
108 INTERFACE
109 TFM_PARTITION_DPE
110)
111
112install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_cmd_encode.c
113 ${CMAKE_CURRENT_SOURCE_DIR}/interface/src/dpe_client.c
114 DESTINATION ${TFM_INSTALL_PATH}/interface/src)
115
116install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dice_protection_environment.h
117 ${CMAKE_CURRENT_SOURCE_DIR}/interface/include/dpe_client.h
118 DESTINATION ${TFM_INSTALL_PATH}/interface/include)