blob: 9eab64bf23e41c88d58518375b302efe129e7621 [file] [log] [blame]
Julian Hall527ddd52021-06-28 11:57:17 +01001#-------------------------------------------------------------------------------
Gyorgy Szing8a1e7f42023-07-26 18:26:48 +02002# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
Julian Hall527ddd52021-06-28 11:57:17 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
Balint Dobszay047aea82022-05-16 14:20:53 +02007cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
Gyorgy Szinga365a042021-12-02 01:48:27 +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)
Julian Hall527ddd52021-06-28 11:57:17 +010012
13#-------------------------------------------------------------------------------
14# The CMakeLists.txt for building the se-proxy deployment for opteesp
15#
16# Builds proxy service providers that communicate with a separate secure element
17# that hosts a set of service endpoints. This deployment is for running in an
18# SEL0 secure partition hosted by OPTEE in the role of SPM.
19#-------------------------------------------------------------------------------
20include(${TS_ROOT}/environments/opteesp/env.cmake)
21project(trusted-services LANGUAGES C ASM)
22add_executable(se-proxy)
23target_include_directories(se-proxy PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
Jelle Sels4960c412023-02-01 09:43:24 +010024set(SP_BIN_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249")
25set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}")
26
Imre Kiseeee9642021-12-17 13:59:46 +010027set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
Gabor Toth1b0c11a2024-04-05 11:43:55 +020028set(SP_BOOT_ORDER "2" CACHE STRING "Boot order of the SP")
Imre Kisd0ed5c22021-12-15 17:05:47 +010029set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix")
Julian Hall527ddd52021-06-28 11:57:17 +010030
Julian Hall3d0ec042022-09-06 13:26:14 +010031target_include_directories(se-proxy PRIVATE
32 ${CMAKE_CURRENT_LIST_DIR}
33)
34
Julian Hall527ddd52021-06-28 11:57:17 +010035#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010036# Components that are specific to deployment in the opteesp environment.
37#
38#-------------------------------------------------------------------------------
Jelle Sels4960c412023-02-01 09:43:24 +010039
Julian Hall527ddd52021-06-28 11:57:17 +010040add_components(TARGET "se-proxy"
41 BASE_DIR ${TS_ROOT}
42 COMPONENTS
Julian Hall527ddd52021-06-28 11:57:17 +010043 "environments/opteesp"
Julian Hall527ddd52021-06-28 11:57:17 +010044)
45
Julian Hall3d0ec042022-09-06 13:26:14 +010046include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
47include(../../infra/stub/stub.cmake REQUIRED)
48include(../../se-proxy.cmake REQUIRED)
Julian Hall527ddd52021-06-28 11:57:17 +010049
50#-------------------------------------------------------------------------------
Gyorgy Szinga365a042021-12-02 01:48:27 +010051# Set target platform to provide drivers needed by the deployment
Julian Hall527ddd52021-06-28 11:57:17 +010052#
53#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010054add_platform(TARGET "se-proxy")
55
Julian Hall3d0ec042022-09-06 13:26:14 +010056#-------------------------------------------------------------------------------
57# Deployment specific build options
58#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010059target_compile_definitions(se-proxy PRIVATE
60 ARM64=1
61)
62
Julian Hall527ddd52021-06-28 11:57:17 +010063if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
64 target_compile_options(se-proxy PRIVATE
Julian Hall527ddd52021-06-28 11:57:17 +010065 -std=c99
66 )
67
Julian Hall527ddd52021-06-28 11:57:17 +010068endif()
69
Julian Hall3d0ec042022-09-06 13:26:14 +010070#-------------------------------------------------------------------------------
71# Deployment specific install options
72#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010073if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
74 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
75endif()
76#TODO: api headers
77
78install(TARGETS se-proxy
Julian Hall527ddd52021-06-28 11:57:17 +010079 RUNTIME DESTINATION ${TS_ENV}/bin
80 )
Julian Hall527ddd52021-06-28 11:57:17 +010081
82get_property(_PROTO_FILES TARGET se-proxy PROPERTY PROTOBUF_FILES)
83install(FILES ${_PROTO_FILES} DESTINATION ${TS_ENV}/lib/protobuf)
84
Imre Kisa74aaf92021-12-14 17:13:06 +010085include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
86export_sp(
Jelle Sels4960c412023-02-01 09:43:24 +010087 SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
88 SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
Gabor Toth7e4babe2024-03-14 11:09:19 +010089 SP_BOOT_ORDER ${SP_BOOT_ORDER}
Imre Kisa74aaf92021-12-14 17:13:06 +010090 SP_NAME "se-proxy"
91 MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
92 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_se-proxy.dts.in
93 JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
94)