blob: 70d40739d2e1dee1a7c1aee38ef9411516a3486d [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.")
Julian Hall3d0ec042022-09-06 13:26:14 +010011include(../../../deployment.cmake REQUIRED)
Imre Kis840ded22022-01-13 15:32:01 +010012
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")
Jelle Sels4960c412023-02-01 09:43:24 +010027set(SP_BIN_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249")
28set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}")
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
Julian Hall3d0ec042022-09-06 13:26:14 +010043include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
44include(../../infra/stub/stub.cmake REQUIRED)
45include(../../se-proxy.cmake REQUIRED)
Imre Kis840ded22022-01-13 15:32:01 +010046
47#-------------------------------------------------------------------------------
48# Set target platform to provide drivers needed by the deployment
49#
50#-------------------------------------------------------------------------------
51add_platform(TARGET "se-proxy")
52
Julian Hall3d0ec042022-09-06 13:26:14 +010053#-------------------------------------------------------------------------------
54# Deployment specific build options
55#-------------------------------------------------------------------------------
Imre Kis840ded22022-01-13 15:32:01 +010056target_compile_definitions(se-proxy PRIVATE
57 ARM64=1
58)
59
60if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
61 target_compile_options(se-proxy PRIVATE
Imre Kis840ded22022-01-13 15:32:01 +010062 -std=c99
63 )
64
Imre Kis840ded22022-01-13 15:32:01 +010065endif()
66
Jelle Sels4960c412023-02-01 09:43:24 +010067compiler_generate_binary_output(TARGET se-proxy NAME "${SP_BIN_UUID_CANON}.bin" SP_BINARY)
68install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_BIN_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
Imre Kis840ded22022-01-13 15:32:01 +010069
70include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
Jelle Sels4960c412023-02-01 09:43:24 +010071export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_BIN_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
Imre Kis840ded22022-01-13 15:32:01 +010072
Julian Hall3d0ec042022-09-06 13:26:14 +010073#-------------------------------------------------------------------------------
74# Deployment specific install options
75#-------------------------------------------------------------------------------
Imre Kis840ded22022-01-13 15:32:01 +010076if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
77 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
78endif()
79install(TARGETS se-proxy
80 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
81 RUNTIME DESTINATION ${TS_ENV}/bin
82 )
83
84include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED)
85export_sp(
Jelle Sels4960c412023-02-01 09:43:24 +010086 SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
87 SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
Imre Kis840ded22022-01-13 15:32:01 +010088 SP_NAME ${SP_NAME}
89 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
Jelle Sels4960c412023-02-01 09:43:24 +010090 DTS_MEM_REGIONS ${SP_BIN_UUID_CANON}_memory_regions.dtsi
Imre Kis840ded22022-01-13 15:32:01 +010091 JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
92)