Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Gyorgy Szing | 8a1e7f4 | 2023-07-26 18:26:48 +0200 | [diff] [blame] | 2 | # Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved. |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
Balint Dobszay | 047aea8 | 2022-05-16 14:20:53 +0200 | [diff] [blame] | 7 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
Gyorgy Szing | a365a04 | 2021-12-02 01:48:27 +0100 | [diff] [blame] | 8 | |
| 9 | # Set default platform. |
| 10 | set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.") |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 11 | include(../../../deployment.cmake REQUIRED) |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 12 | |
| 13 | #------------------------------------------------------------------------------- |
| 14 | # The CMakeLists.txt for building the se-proxy deployment for opteesp |
| 15 | # |
| 16 | # Builds proxy service providers that communicate with a separate secure element |
| 17 | # that hosts a set of service endpoints. This deployment is for running in an |
| 18 | # SEL0 secure partition hosted by OPTEE in the role of SPM. |
| 19 | #------------------------------------------------------------------------------- |
| 20 | include(${TS_ROOT}/environments/opteesp/env.cmake) |
| 21 | project(trusted-services LANGUAGES C ASM) |
| 22 | add_executable(se-proxy) |
| 23 | target_include_directories(se-proxy PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 24 | set(SP_BIN_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249") |
| 25 | set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}") |
| 26 | |
Imre Kis | eeee964 | 2021-12-17 13:59:46 +0100 | [diff] [blame] | 27 | set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes") |
Gabor Toth | 1b0c11a | 2024-04-05 11:43:55 +0200 | [diff] [blame] | 28 | set(SP_BOOT_ORDER "2" CACHE STRING "Boot order of the SP") |
Imre Kis | d0ed5c2 | 2021-12-15 17:05:47 +0100 | [diff] [blame] | 29 | set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix") |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 30 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 31 | target_include_directories(se-proxy PRIVATE |
| 32 | ${CMAKE_CURRENT_LIST_DIR} |
| 33 | ) |
| 34 | |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 35 | #------------------------------------------------------------------------------- |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 36 | # Components that are specific to deployment in the opteesp environment. |
| 37 | # |
| 38 | #------------------------------------------------------------------------------- |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 39 | |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 40 | add_components(TARGET "se-proxy" |
| 41 | BASE_DIR ${TS_ROOT} |
| 42 | COMPONENTS |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 43 | "environments/opteesp" |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 44 | ) |
| 45 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 46 | include(../../env/commonsp/se_proxy_sp.cmake REQUIRED) |
| 47 | include(../../infra/stub/stub.cmake REQUIRED) |
| 48 | include(../../se-proxy.cmake REQUIRED) |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 49 | |
| 50 | #------------------------------------------------------------------------------- |
Gyorgy Szing | a365a04 | 2021-12-02 01:48:27 +0100 | [diff] [blame] | 51 | # Set target platform to provide drivers needed by the deployment |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 52 | # |
| 53 | #------------------------------------------------------------------------------- |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 54 | add_platform(TARGET "se-proxy") |
| 55 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 56 | #------------------------------------------------------------------------------- |
| 57 | # Deployment specific build options |
| 58 | #------------------------------------------------------------------------------- |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 59 | target_compile_definitions(se-proxy PRIVATE |
| 60 | ARM64=1 |
| 61 | ) |
| 62 | |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 63 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 64 | target_compile_options(se-proxy PRIVATE |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 65 | -std=c99 |
| 66 | ) |
| 67 | |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 68 | endif() |
| 69 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 70 | #------------------------------------------------------------------------------- |
| 71 | # Deployment specific install options |
| 72 | #------------------------------------------------------------------------------- |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 73 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 74 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 75 | endif() |
| 76 | #TODO: api headers |
| 77 | |
| 78 | install(TARGETS se-proxy |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 79 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 80 | ) |
Julian Hall | 527ddd5 | 2021-06-28 11:57:17 +0100 | [diff] [blame] | 81 | |
| 82 | get_property(_PROTO_FILES TARGET se-proxy PROPERTY PROTOBUF_FILES) |
| 83 | install(FILES ${_PROTO_FILES} DESTINATION ${TS_ENV}/lib/protobuf) |
| 84 | |
Imre Kis | a74aaf9 | 2021-12-14 17:13:06 +0100 | [diff] [blame] | 85 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake) |
| 86 | export_sp( |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 87 | SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON} |
| 88 | SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON} |
Gabor Toth | 7e4babe | 2024-03-14 11:09:19 +0100 | [diff] [blame] | 89 | SP_BOOT_ORDER ${SP_BOOT_ORDER} |
Imre Kis | a74aaf9 | 2021-12-14 17:13:06 +0100 | [diff] [blame] | 90 | SP_NAME "se-proxy" |
| 91 | MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in |
| 92 | DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_se-proxy.dts.in |
| 93 | JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in |
| 94 | ) |