Gabor Ambrus | a84494a | 2023-08-14 23:04:48 +0200 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
| 8 | |
| 9 | # Set default platform. |
| 10 | set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.") |
| 11 | |
| 12 | |
| 13 | include(../../../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 | #------------------------------------------------------------------------------- |
| 22 | include(${TS_ROOT}/environments/sp/env.cmake) |
| 23 | project(trusted-services LANGUAGES C ASM) |
| 24 | add_executable(logging) |
| 25 | target_include_directories(logging PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
| 26 | |
| 27 | set(SP_NAME "logging") |
| 28 | set(SP_BIN_UUID_CANON "da9dffbd-d590-40ed-975f-19c65a3d52d3") |
| 29 | set(SP_FFA_UUID_CANON "${TS_RPC_UUID_CANON}") |
| 30 | set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes") |
| 31 | set(SP_STACK_SIZE "64 * 1024" CACHE STRING "Stack size") |
Gabor Toth | 1b0c11a | 2024-04-05 11:43:55 +0200 | [diff] [blame] | 32 | set(SP_BOOT_ORDER "0" CACHE STRING "Boot order of the SP") |
Gabor Ambrus | a84494a | 2023-08-14 23:04:48 +0200 | [diff] [blame] | 33 | set(TRACE_PREFIX "LOGGING" CACHE STRING "Trace prefix") |
| 34 | |
| 35 | target_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 | #------------------------------------------------------------------------------- |
| 44 | add_components(TARGET "logging" |
| 45 | BASE_DIR ${TS_ROOT} |
| 46 | COMPONENTS |
| 47 | environments/sp |
| 48 | ) |
| 49 | |
| 50 | include(../../env/commonsp/logging_sp.cmake REQUIRED) |
| 51 | include(../../logging.cmake REQUIRED) |
| 52 | |
| 53 | #------------------------------------------------------------------------------- |
| 54 | # Set target platform to provide drivers needed by the deployment |
| 55 | # |
| 56 | #------------------------------------------------------------------------------- |
| 57 | add_platform(TARGET "logging") |
| 58 | |
| 59 | #------------------------------------------------------------------------------- |
| 60 | # Deployment specific build options |
| 61 | # |
| 62 | #------------------------------------------------------------------------------- |
| 63 | target_compile_definitions(logging PRIVATE |
| 64 | ARM64=1 |
| 65 | ) |
| 66 | |
| 67 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 68 | target_compile_options(logging PRIVATE |
| 69 | -std=c99 |
| 70 | -Werror |
| 71 | ) |
| 72 | |
| 73 | endif() |
| 74 | |
| 75 | compiler_generate_binary_output(TARGET logging NAME "${SP_BIN_UUID_CANON}.bin" SP_BINARY) |
| 76 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_BIN_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin) |
| 77 | |
| 78 | include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED) |
| 79 | export_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 | #------------------------------------------------------------------------------- |
| 85 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 86 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 87 | endif() |
Gabor Ambrus | a84494a | 2023-08-14 23:04:48 +0200 | [diff] [blame] | 88 | |
| 89 | install(TARGETS logging |
Gabor Ambrus | a84494a | 2023-08-14 23:04:48 +0200 | [diff] [blame] | 90 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 91 | ) |
| 92 | |
| 93 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake) |
| 94 | export_sp( |
| 95 | SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON} |
| 96 | SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON} |
| 97 | SP_UUID_LE ${SP_UUID_LE} |
Gabor Toth | 7e4babe | 2024-03-14 11:09:19 +0100 | [diff] [blame] | 98 | SP_BOOT_ORDER ${SP_BOOT_ORDER} |
Gabor Ambrus | a84494a | 2023-08-14 23:04:48 +0200 | [diff] [blame] | 99 | SP_NAME ${SP_NAME} |
| 100 | DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_${SP_NAME}.dts.in |
| 101 | DTS_MEM_REGIONS ${SP_BIN_UUID_CANON}_memory_regions.dtsi |
| 102 | JSON_IN ${TS_ROOT}/environments/sp/sp_pkg.json.in |
| 103 | ) |