Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved. |
| 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) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +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) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 12 | |
| 13 | #------------------------------------------------------------------------------- |
| 14 | # The CMakeLists.txt for building the se-proxy deployment for generic sp |
| 15 | # environment. |
| 16 | # |
| 17 | # Builds proxy service providers that communicate with a separate secure element |
| 18 | # that hosts a set of service endpoints. This deployment is for running in an |
| 19 | # SEL0 secure partition hosted by any SPM. |
| 20 | #------------------------------------------------------------------------------- |
| 21 | include(${TS_ROOT}/environments/sp/env.cmake) |
| 22 | set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type") |
| 23 | project(trusted-services LANGUAGES C ASM) |
| 24 | add_executable(se-proxy) |
| 25 | target_include_directories(se-proxy PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
| 26 | set(SP_NAME "se-proxy") |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 27 | set(SP_BIN_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249") |
| 28 | set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}") |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 29 | set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix") |
| 30 | set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size") |
| 31 | set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "Heap size") |
Gabor Toth | 1b0c11a | 2024-04-05 11:43:55 +0200 | [diff] [blame] | 32 | set(SP_BOOT_ORDER "2" CACHE STRING "Boot order of the SP") |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 33 | |
| 34 | #------------------------------------------------------------------------------- |
| 35 | # Components that are specific to deployment in the opteesp environment. |
| 36 | # |
| 37 | #------------------------------------------------------------------------------- |
| 38 | add_components(TARGET "se-proxy" |
| 39 | BASE_DIR ${TS_ROOT} |
| 40 | COMPONENTS |
| 41 | environments/sp |
| 42 | ) |
| 43 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 44 | include(../../env/commonsp/se_proxy_sp.cmake REQUIRED) |
| 45 | include(../../infra/stub/stub.cmake REQUIRED) |
| 46 | include(../../se-proxy.cmake REQUIRED) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 47 | |
| 48 | #------------------------------------------------------------------------------- |
| 49 | # Set target platform to provide drivers needed by the deployment |
| 50 | # |
| 51 | #------------------------------------------------------------------------------- |
| 52 | add_platform(TARGET "se-proxy") |
| 53 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 54 | #------------------------------------------------------------------------------- |
| 55 | # Deployment specific build options |
| 56 | #------------------------------------------------------------------------------- |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 57 | target_compile_definitions(se-proxy PRIVATE |
| 58 | ARM64=1 |
| 59 | ) |
| 60 | |
| 61 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 62 | target_compile_options(se-proxy PRIVATE |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 63 | -std=c99 |
| 64 | ) |
| 65 | |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 66 | endif() |
| 67 | |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 68 | compiler_generate_binary_output(TARGET se-proxy NAME "${SP_BIN_UUID_CANON}.bin" SP_BINARY) |
| 69 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_BIN_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 70 | |
| 71 | include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED) |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 72 | export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_BIN_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 73 | |
Julian Hall | 3d0ec04 | 2022-09-06 13:26:14 +0100 | [diff] [blame] | 74 | #------------------------------------------------------------------------------- |
| 75 | # Deployment specific install options |
| 76 | #------------------------------------------------------------------------------- |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 77 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 78 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 79 | endif() |
| 80 | install(TARGETS se-proxy |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 81 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 82 | ) |
| 83 | |
| 84 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED) |
| 85 | export_sp( |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 86 | SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON} |
| 87 | SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON} |
Gabor Toth | 7e4babe | 2024-03-14 11:09:19 +0100 | [diff] [blame] | 88 | SP_BOOT_ORDER ${SP_BOOT_ORDER} |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 89 | SP_NAME ${SP_NAME} |
| 90 | DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 91 | DTS_MEM_REGIONS ${SP_BIN_UUID_CANON}_memory_regions.dtsi |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 92 | JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in |
| 93 | ) |