blob: 77ea841d2ccc430d54e723ff5eb8632d4c62311b [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")
Imre Kisd0ed5c22021-12-15 17:05:47 +010028set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix")
Julian Hall527ddd52021-06-28 11:57:17 +010029
Julian Hall3d0ec042022-09-06 13:26:14 +010030target_include_directories(se-proxy PRIVATE
31 ${CMAKE_CURRENT_LIST_DIR}
32)
33
Julian Hall527ddd52021-06-28 11:57:17 +010034#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010035# Components that are specific to deployment in the opteesp environment.
36#
37#-------------------------------------------------------------------------------
Jelle Sels4960c412023-02-01 09:43:24 +010038
Julian Hall527ddd52021-06-28 11:57:17 +010039add_components(TARGET "se-proxy"
40 BASE_DIR ${TS_ROOT}
41 COMPONENTS
Julian Hall527ddd52021-06-28 11:57:17 +010042 "environments/opteesp"
Julian Hall527ddd52021-06-28 11:57:17 +010043)
44
Julian Hall3d0ec042022-09-06 13:26:14 +010045include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
46include(../../infra/stub/stub.cmake REQUIRED)
47include(../../se-proxy.cmake REQUIRED)
Julian Hall527ddd52021-06-28 11:57:17 +010048
49#-------------------------------------------------------------------------------
Gyorgy Szinga365a042021-12-02 01:48:27 +010050# Set target platform to provide drivers needed by the deployment
Julian Hall527ddd52021-06-28 11:57:17 +010051#
52#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010053add_platform(TARGET "se-proxy")
54
Julian Hall3d0ec042022-09-06 13:26:14 +010055#-------------------------------------------------------------------------------
56# Deployment specific build options
57#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010058target_compile_definitions(se-proxy PRIVATE
59 ARM64=1
60)
61
Julian Hall527ddd52021-06-28 11:57:17 +010062if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
63 target_compile_options(se-proxy PRIVATE
Julian Hall527ddd52021-06-28 11:57:17 +010064 -std=c99
65 )
66
Julian Hall527ddd52021-06-28 11:57:17 +010067endif()
68
Julian Hall3d0ec042022-09-06 13:26:14 +010069#-------------------------------------------------------------------------------
70# Deployment specific install options
71#-------------------------------------------------------------------------------
Julian Hall527ddd52021-06-28 11:57:17 +010072if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
73 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
74endif()
75#TODO: api headers
76
77install(TARGETS se-proxy
78 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
79 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}
Imre Kisa74aaf92021-12-14 17:13:06 +010089 SP_NAME "se-proxy"
90 MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
91 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_se-proxy.dts.in
92 JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
93)