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