blob: 08d130ed6e57f9e13810f74971976255a0a69bc9 [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.")
11include(../../deployment.cmake REQUIRED)
12
13#-------------------------------------------------------------------------------
14# The CMakeLists.txt for building the attestation deployment for generic sp
15# environment.
16#
17# Builds the attestation service provider for running in an SEL0 secure
18# partition hosted by any SPM.
19#-------------------------------------------------------------------------------
20include(${TS_ROOT}/environments/sp/env.cmake)
21set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
22project(trusted-services LANGUAGES C ASM)
23add_executable(attestation)
24target_include_directories(attestation PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
25set(SP_NAME "attestation")
Balint Dobszayc9daea92022-06-15 15:17:11 +020026set(SP_UUID_CANON "a1baf155-8876-4695-8f7c-54955e8db974")
27set(SP_UUID_LE "0x55f1baa1 0x95467688 0x95547c8f 0x74b98d5e")
Imre Kis840ded22022-01-13 15:32:01 +010028set(TRACE_PREFIX "ATT" 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# Default deployment specific configuration
34#
35#-------------------------------------------------------------------------------
36set(TS_NO_FLOAT_HW ON)
37
38#-------------------------------------------------------------------------------
39# Components that are specific to deployment in the sp environment.
40#
41#-------------------------------------------------------------------------------
42add_components(TARGET "attestation"
43 BASE_DIR ${TS_ROOT}
44 COMPONENTS
45 environments/sp
46)
47
48include(../attestation.cmake REQUIRED)
49
50#-------------------------------------------------------------------------------
51# Set target platform to provide drivers needed by the deployment
52#
53#-------------------------------------------------------------------------------
54add_platform(TARGET "attestation")
55
56target_compile_definitions(attestation PRIVATE
57 ARM64=1
58)
59
60if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
61 target_compile_options(attestation PRIVATE
Imre Kis840ded22022-01-13 15:32:01 +010062 -std=c99
63 )
64
Imre Kis840ded22022-01-13 15:32:01 +010065endif()
66
Balint Dobszayc9daea92022-06-15 15:17:11 +020067compiler_generate_binary_output(TARGET attestation NAME "${SP_UUID_CANON}.bin" SP_BINARY)
68install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SP_UUID_CANON}.bin DESTINATION ${TS_ENV}/bin)
Imre Kis840ded22022-01-13 15:32:01 +010069
70include(${TS_ROOT}/tools/cmake/common/ExportMemoryRegionsToManifest.cmake REQUIRED)
Balint Dobszayc9daea92022-06-15 15:17:11 +020071export_memory_regions_to_manifest(TARGET attestation NAME "${SP_UUID_CANON}_memory_regions.dtsi" RES EXPORT_MEMORY_REGIONS_DTSI)
Imre Kis840ded22022-01-13 15:32:01 +010072
73######################################## install
74if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
75 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
76endif()
77install(TARGETS attestation
78 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
79 RUNTIME DESTINATION ${TS_ENV}/bin
80 )
81
82include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
83export_sp(
Balint Dobszayc9daea92022-06-15 15:17:11 +020084 SP_UUID_CANON ${SP_UUID_CANON}
85 SP_UUID_LE ${SP_UUID_LE}
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)