blob: ea95008790760151b3e3d9f82673dfdf8672d3cf [file] [log] [blame]
Imre Kis840ded22022-01-13 15:32:01 +01001#-------------------------------------------------------------------------------
2# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
Balint Dobszay047aea82022-05-16 14:20:53 +02007cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
Imre Kis840ded22022-01-13 15:32:01 +01008
9# Set default platform.
10set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
11include(../../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#-------------------------------------------------------------------------------
21include(${TS_ROOT}/environments/sp/env.cmake)
22set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
23project(trusted-services LANGUAGES C ASM)
24add_executable(se-proxy)
25target_include_directories(se-proxy PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
26set(SP_NAME "se-proxy")
Balint Dobszayc9daea92022-06-15 15:17:11 +020027set(SP_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249")
28set(SP_UUID_LE "0xd139bb46 0xb545d9b4 0x0004ff88 0x49b2da27")
Imre Kis840ded22022-01-13 15:32:01 +010029set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix")
30set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
31set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "Heap size")
32
33#-------------------------------------------------------------------------------
34# Components that are specific to deployment in the opteesp environment.
35#
36#-------------------------------------------------------------------------------
37add_components(TARGET "se-proxy"
38 BASE_DIR ${TS_ROOT}
39 COMPONENTS
40 environments/sp
41)
42
43include(../se-proxy.cmake REQUIRED)
44
45#-------------------------------------------------------------------------------
46# Set target platform to provide drivers needed by the deployment
47#
48#-------------------------------------------------------------------------------
49add_platform(TARGET "se-proxy")
50
51
52target_compile_definitions(se-proxy PRIVATE
53 ARM64=1
54)
55
56if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
57 target_compile_options(se-proxy PRIVATE
Imre Kis840ded22022-01-13 15:32:01 +010058 -std=c99
59 )
60
Imre Kis840ded22022-01-13 15:32:01 +010061endif()
62
Balint Dobszayc9daea92022-06-15 15:17:11 +020063compiler_generate_binary_output(TARGET se-proxy NAME "${SP_UUID_CANON}.bin" SP_BINARY)
64install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
Imre Kis840ded22022-01-13 15:32:01 +010065
66include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
Balint Dobszayc9daea92022-06-15 15:17:11 +020067export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
Imre Kis840ded22022-01-13 15:32:01 +010068
69######################################## install
70if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
71 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
72endif()
73install(TARGETS se-proxy
74 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
75 RUNTIME DESTINATION ${TS_ENV}/bin
76 )
77
78include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED)
79export_sp(
Balint Dobszayc9daea92022-06-15 15:17:11 +020080 SP_UUID_CANON ${SP_UUID_CANON}
81 SP_UUID_LE ${SP_UUID_LE}
Imre Kis840ded22022-01-13 15:32:01 +010082 SP_NAME ${SP_NAME}
83 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
Balint Dobszayc9daea92022-06-15 15:17:11 +020084 DTS_MEM_REGIONS ${SP_UUID_CANON}_memory_regions.dtsi
Imre Kis840ded22022-01-13 15:32:01 +010085 JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
86)