Jamie Fox | ab30e71 | 2023-03-30 17:48:36 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | if (NOT TFM_PARTITION_DPE) |
| 9 | return() |
| 10 | endif() |
| 11 | |
| 12 | cmake_minimum_required(VERSION 3.15) |
| 13 | cmake_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. |
| 18 | add_library(tfm_app_rot_partition_dpe STATIC) |
| 19 | |
| 20 | target_sources(tfm_app_rot_partition_dpe |
| 21 | PRIVATE |
| 22 | dpe_cmd_decode.c |
| 23 | dpe_impl.c |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame^] | 24 | dpe_log.c |
Jamie Fox | ab30e71 | 2023-03-30 17:48:36 +0100 | [diff] [blame] | 25 | 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. |
| 30 | target_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. |
| 36 | target_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 | |
| 41 | target_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 | |
| 48 | target_link_libraries(tfm_app_rot_partition_dpe |
| 49 | PRIVATE |
| 50 | tfm_sprt |
| 51 | qcbor |
| 52 | ) |
| 53 | |
| 54 | ############################ Secure API ######################################## |
| 55 | |
| 56 | target_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 | |
| 62 | target_include_directories(tfm_sprt |
| 63 | PUBLIC |
| 64 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/include |
| 65 | ) |
| 66 | |
| 67 | target_link_libraries(tfm_sprt |
| 68 | PRIVATE |
| 69 | qcbor |
| 70 | ) |
| 71 | |
| 72 | ############################ Non-secure API #################################### |
| 73 | |
| 74 | add_library(dpe_api_ns INTERFACE) |
| 75 | |
| 76 | target_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 | |
| 82 | target_include_directories(dpe_api_ns |
| 83 | INTERFACE |
| 84 | ${CMAKE_CURRENT_SOURCE_DIR}/interface/include |
| 85 | ) |
| 86 | |
| 87 | target_link_libraries(dpe_api_ns |
| 88 | INTERFACE |
| 89 | tfm_qcbor_ns |
| 90 | ) |
| 91 | |
| 92 | ############################ Partition Defs #################################### |
| 93 | |
| 94 | target_link_libraries(tfm_partitions |
| 95 | INTERFACE |
| 96 | tfm_app_rot_partition_dpe |
| 97 | ) |
| 98 | |
| 99 | target_compile_definitions(tfm_config |
| 100 | INTERFACE |
| 101 | TFM_PARTITION_DPE |
| 102 | ) |
| 103 | |
| 104 | install(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 | |
| 108 | install(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) |