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.") |
| 11 | include(../../deployment.cmake REQUIRED) |
| 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") |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 27 | set(SP_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249") |
| 28 | set(SP_UUID_LE "0xd139bb46 0xb545d9b4 0x0004ff88 0x49b2da27") |
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") |
| 32 | |
| 33 | #------------------------------------------------------------------------------- |
| 34 | # Components that are specific to deployment in the opteesp environment. |
| 35 | # |
| 36 | #------------------------------------------------------------------------------- |
| 37 | add_components(TARGET "se-proxy" |
| 38 | BASE_DIR ${TS_ROOT} |
| 39 | COMPONENTS |
| 40 | environments/sp |
| 41 | ) |
| 42 | |
| 43 | include(../se-proxy.cmake REQUIRED) |
| 44 | |
| 45 | #------------------------------------------------------------------------------- |
| 46 | # Set target platform to provide drivers needed by the deployment |
| 47 | # |
| 48 | #------------------------------------------------------------------------------- |
| 49 | add_platform(TARGET "se-proxy") |
| 50 | |
| 51 | |
| 52 | target_compile_definitions(se-proxy PRIVATE |
| 53 | ARM64=1 |
| 54 | ) |
| 55 | |
| 56 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 57 | target_compile_options(se-proxy PRIVATE |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 58 | -std=c99 |
| 59 | ) |
| 60 | |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 61 | endif() |
| 62 | |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 63 | compiler_generate_binary_output(TARGET se-proxy NAME "${SP_UUID_CANON}.bin" SP_BINARY) |
| 64 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 65 | |
| 66 | include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED) |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 67 | export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI) |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 68 | |
| 69 | ######################################## install |
| 70 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 71 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 72 | endif() |
| 73 | install(TARGETS se-proxy |
| 74 | PUBLIC_HEADER DESTINATION ${TS_ENV}/include |
| 75 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 76 | ) |
| 77 | |
| 78 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED) |
| 79 | export_sp( |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 80 | SP_UUID_CANON ${SP_UUID_CANON} |
| 81 | SP_UUID_LE ${SP_UUID_LE} |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 82 | SP_NAME ${SP_NAME} |
| 83 | DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in |
Balint Dobszay | c9daea9 | 2022-06-15 15:17:11 +0200 | [diff] [blame] | 84 | DTS_MEM_REGIONS ${SP_UUID_CANON}_memory_regions.dtsi |
Imre Kis | 840ded2 | 2022-01-13 15:32:01 +0100 | [diff] [blame] | 85 | JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in |
| 86 | ) |