blob: 0f4d7a2a75fb545794017e701b37ca27b575b731 [file] [log] [blame]
Gabor Ambrusa84494a2023-08-14 23:04:48 +02001#-------------------------------------------------------------------------------
2# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
8
9# Set default platform.
10set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
11
12
13include(../../../deployment.cmake REQUIRED)
14
15#-------------------------------------------------------------------------------
16# The CMakeLists.txt for building the protected-storage deployment for generic
17# sp environment.
18#
19# Builds the secure storage service provider for running in an SEL0 secure
20# partition hosted by any SPM.
21#-------------------------------------------------------------------------------
22include(${TS_ROOT}/environments/sp/env.cmake)
23project(trusted-services LANGUAGES C ASM)
24add_executable(logging)
25target_include_directories(logging PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
26
27set(SP_NAME "logging")
28set(SP_BIN_UUID_CANON "da9dffbd-d590-40ed-975f-19c65a3d52d3")
29set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}")
30set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
31set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size")
Gabor Toth1b0c11a2024-04-05 11:43:55 +020032set(SP_BOOT_ORDER "0" CACHE STRING "Boot order of the SP")
Gabor Ambrusa84494a2023-08-14 23:04:48 +020033set(TRACE_PREFIX "LOGGING" CACHE STRING "Trace prefix")
34
35target_include_directories(logging PRIVATE
36 ${CMAKE_CURRENT_LIST_DIR}
37)
38
39#-------------------------------------------------------------------------------
40# Add components - this deployment uses an infrastructure that provides
41# ram backed storage for SFS.
42#
43#-------------------------------------------------------------------------------
44add_components(TARGET "logging"
45 BASE_DIR ${TS_ROOT}
46 COMPONENTS
47 environments/sp
48)
49
50include(../../env/commonsp/logging_sp.cmake REQUIRED)
51include(../../logging.cmake REQUIRED)
52
53#-------------------------------------------------------------------------------
54# Set target platform to provide drivers needed by the deployment
55#
56#-------------------------------------------------------------------------------
57add_platform(TARGET "logging")
58
59#-------------------------------------------------------------------------------
60# Deployment specific build options
61#
62#-------------------------------------------------------------------------------
63target_compile_definitions(logging PRIVATE
64 ARM64=1
65)
66
67if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
68 target_compile_options(logging PRIVATE
69 -std=c99
70 -Werror
71 )
72
73endif()
74
75compiler_generate_binary_output(TARGET logging NAME "${SP_BIN_UUID_CANON}.bin" SP_BINARY)
76install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_BIN_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
77
78include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
79export_memory_regions_to_manifest(TARGET logging NAME "${SP_BIN_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
80
81#-------------------------------------------------------------------------------
82# Deployment specific install options
83#
84#-------------------------------------------------------------------------------
85if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
86 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
87endif()
88install(TARGETS logging
89 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
90 RUNTIME DESTINATION ${TS_ENV}/bin
91 )
92
93install(TARGETS logging
94 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
95 RUNTIME DESTINATION ${TS_ENV}/bin
96 )
97
98include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
99export_sp(
100 SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
101 SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
102 SP_UUID_LE ${SP_UUID_LE}
Gabor Toth7e4babe2024-03-14 11:09:19 +0100103 SP_BOOT_ORDER ${SP_BOOT_ORDER}
Gabor Ambrusa84494a2023-08-14 23:04:48 +0200104 SP_NAME ${SP_NAME}
105 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in
106 DTS_MEM_REGIONS ${SP_BIN_UUID_CANON}_memory_regions.dtsi
107 JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in
108)