blob: 04c40d087cf5d58f9094b759f82b5c03ff964ca8 [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")
Balint Dobszayc9daea92022-06-15 15:17:11 +020027set(SP_UUID_CANON "46bb39d1-b4d9-45b5-88ff-040027dab249")
Imre Kis840ded22022-01-13 15:32:01 +010028set(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
Julian Hall3d0ec042022-09-06 13:26:14 +010042include(../../env/commonsp/se_proxy_sp.cmake REQUIRED)
43include(../../infra/stub/stub.cmake REQUIRED)
44include(../../se-proxy.cmake REQUIRED)
Imre Kis840ded22022-01-13 15:32:01 +010045
46#-------------------------------------------------------------------------------
47# Set target platform to provide drivers needed by the deployment
48#
49#-------------------------------------------------------------------------------
50add_platform(TARGET "se-proxy")
51
Julian Hall3d0ec042022-09-06 13:26:14 +010052#-------------------------------------------------------------------------------
53# Deployment specific build options
54#-------------------------------------------------------------------------------
Imre Kis840ded22022-01-13 15:32:01 +010055target_compile_definitions(se-proxy PRIVATE
56 ARM64=1
57)
58
59if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
60 target_compile_options(se-proxy PRIVATE
Imre Kis840ded22022-01-13 15:32:01 +010061 -std=c99
62 )
63
Imre Kis840ded22022-01-13 15:32:01 +010064endif()
65
Balint Dobszayc9daea92022-06-15 15:17:11 +020066compiler_generate_binary_output(TARGET se-proxy NAME "${SP_UUID_CANON}.bin" SP_BINARY)
67install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
Imre Kis840ded22022-01-13 15:32:01 +010068
69include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
Balint Dobszayc9daea92022-06-15 15:17:11 +020070export_memory_regions_to_manifest(TARGET se-proxy NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
Imre Kis840ded22022-01-13 15:32:01 +010071
Julian Hall3d0ec042022-09-06 13:26:14 +010072#-------------------------------------------------------------------------------
73# Deployment specific install options
74#-------------------------------------------------------------------------------
Imre Kis840ded22022-01-13 15:32:01 +010075if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
76 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
77endif()
78install(TARGETS se-proxy
79 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
80 RUNTIME DESTINATION ${TS_ENV}/bin
81 )
82
83include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake REQUIRED)
84export_sp(
Balint Dobszayc9daea92022-06-15 15:17:11 +020085 SP_UUID_CANON ${SP_UUID_CANON}
Imre Kis840ded22022-01-13 15:32:01 +010086 SP_NAME ${SP_NAME}
87 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
Balint Dobszayc9daea92022-06-15 15:17:11 +020088 DTS_MEM_REGIONS ${SP_UUID_CANON}_memory_regions.dtsi
Imre Kis840ded22022-01-13 15:32:01 +010089 JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
90)