blob: 506fef269337112122954a7aceb67a38f28bca47 [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#-------------------------------------------------------------------------------
7cmake_minimum_required(VERSION 3.16)
8
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")
27set(SP_UUID "46bb39d1-b4d9-45b5-88ff-040027dab249")
28set(TRACE_PREFIX "SEPROXY" CACHE STRING "Trace prefix")
29set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
30set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "Heap size")
31
32#-------------------------------------------------------------------------------
33# Components that are specific to deployment in the opteesp environment.
34#
35#-------------------------------------------------------------------------------
36add_components(TARGET "se-proxy"
37 BASE_DIR ${TS_ROOT}
38 COMPONENTS
39 environments/sp
40)
41
42include(../se-proxy.cmake REQUIRED)
43
44#-------------------------------------------------------------------------------
45# Set target platform to provide drivers needed by the deployment
46#
47#-------------------------------------------------------------------------------
48add_platform(TARGET "se-proxy")
49
50
51target_compile_definitions(se-proxy PRIVATE
52 ARM64=1
53)
54
55if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
56 target_compile_options(se-proxy PRIVATE
57 -fdiagnostics-show-option
58 -gdwarf-2
59 -mstrict-align
60 -std=c99
61 )
62
63 # Options for GCC that control linking
64 target_link_options(se-proxy PRIVATE
65 -zmax-page-size=4096
66 )
67 # Options directly for LD, these are not understood by GCC
68 target_link_options(se-proxy PRIVATE
69 -Wl,--as-needed
70 -Wl,--sort-section=alignment
71 )
72endif()
73
74compiler_generate_binary_output(TARGET se-proxy NAME "${SP_UUID}.bin" SP_BINARY)
75install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_UUID}.bin DESTINATION ${TS_ENV}/bin)
76
77include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
78export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_UUID}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
79
80######################################## install
81if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
82 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
83endif()
84install(TARGETS se-proxy
85 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
86 RUNTIME DESTINATION ${TS_ENV}/bin
87 )
88
89include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED)
90export_sp(
91 SP_UUID ${SP_UUID}
92 SP_NAME ${SP_NAME}
93 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
94 DTS_MEM_REGIONS ${SP_UUID}_memory_regions.dtsi
95 JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
96)