blob: 2442fd6bd55182a77b7395f9d8e27354f91dca92 [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")
Gabor Toth1b0c11a2024-04-05 11:43:55 +020032set(SP_BOOT_ORDER "2" CACHE STRING "Boot order of the SP")
Imre Kis840ded22022-01-13 15:32:01 +010033
34#-------------------------------------------------------------------------------
35# Components that are specific to deployment in the opteesp environment.
36#
37#-------------------------------------------------------------------------------
38add_components(TARGET "se-proxy"
39 BASE_DIR ${TS_ROOT}
40 COMPONENTS
41 environments/sp
42)
43
Julian Hall3d0ec042022-09-06 13:26:14 +010044include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
45include(../../infra/stub/stub.cmake REQUIRED)
46include(../../se-proxy.cmake REQUIRED)
Imre Kis840ded22022-01-13 15:32:01 +010047
48#-------------------------------------------------------------------------------
49# Set target platform to provide drivers needed by the deployment
50#
51#-------------------------------------------------------------------------------
52add_platform(TARGET "se-proxy")
53
Julian Hall3d0ec042022-09-06 13:26:14 +010054#-------------------------------------------------------------------------------
55# Deployment specific build options
56#-------------------------------------------------------------------------------
Imre Kis840ded22022-01-13 15:32:01 +010057target_compile_definitions(se-proxy PRIVATE
58 ARM64=1
59)
60
61if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
62 target_compile_options(se-proxy PRIVATE
Imre Kis840ded22022-01-13 15:32:01 +010063 -std=c99
64 )
65
Imre Kis840ded22022-01-13 15:32:01 +010066endif()
67
Jelle Sels4960c412023-02-01 09:43:24 +010068compiler_generate_binary_output(TARGET se-proxy NAME "${SP_BIN_UUID_CANON}.bin" SP_BINARY)
69install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_BIN_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
Imre Kis840ded22022-01-13 15:32:01 +010070
71include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
Jelle Sels4960c412023-02-01 09:43:24 +010072export_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 +010073
Julian Hall3d0ec042022-09-06 13:26:14 +010074#-------------------------------------------------------------------------------
75# Deployment specific install options
76#-------------------------------------------------------------------------------
Imre Kis840ded22022-01-13 15:32:01 +010077if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
78 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
79endif()
80install(TARGETS se-proxy
Imre Kis840ded22022-01-13 15:32:01 +010081 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}
Gabor Toth7e4babe2024-03-14 11:09:19 +010088 SP_BOOT_ORDER ${SP_BOOT_ORDER}
Imre Kis840ded22022-01-13 15:32:01 +010089 SP_NAME ${SP_NAME}
90 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
Jelle Sels4960c412023-02-01 09:43:24 +010091 DTS_MEM_REGIONS ${SP_BIN_UUID_CANON}_memory_regions.dtsi
Imre Kis840ded22022-01-13 15:32:01 +010092 JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
93)