blob: fa58a4d40401ee62918816bc0661ecba31337800 [file] [log] [blame]
Julian Hallcaa4af82021-05-19 12:02:36 +01001#-------------------------------------------------------------------------------
Imre Kiseeee9642021-12-17 13:59:46 +01002# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
Julian Hallcaa4af82021-05-19 12:02:36 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
Balint Dobszay047aea82022-05-16 14:20:53 +02007cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
Gyorgy Szinga365a042021-12-02 01:48:27 +01008
9# Set default platform.
10set(TS_PLATFORM "arm/fvp/fvp_base_revc-2xaemv8a" CACHE STRING "Target platform location.")
Julian Hallcaa4af82021-05-19 12:02:36 +010011include(../../deployment.cmake REQUIRED)
12
13#-------------------------------------------------------------------------------
14# The CMakeLists.txt for building the attestation deployment for opteesp
15#
16# Builds the attestation service provider for running in an SEL0 secure partition
17# hosted by OPTEE in the role of SPM.
18#-------------------------------------------------------------------------------
19include(${TS_ROOT}/environments/opteesp/env.cmake)
20project(trusted-services LANGUAGES C ASM)
21add_executable(attestation)
22target_include_directories(attestation PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
Balint Dobszayc9daea92022-06-15 15:17:11 +020023set(SP_UUID_CANON "a1baf155-8876-4695-8f7c-54955e8db974")
Imre Kiseeee9642021-12-17 13:59:46 +010024set(SP_HEAP_SIZE "32 * 1024" CACHE STRING "SP heap size in bytes")
Imre Kis2ccd8e82021-10-08 11:21:14 +020025set(TRACE_PREFIX "ATT" CACHE STRING "Trace prefix")
Jelle Selsf1cb0522022-06-30 11:31:31 +020026include(${TS_ROOT}/tools/cmake/common/TargetCompileDefinitions.cmake)
27set_target_uuids(
28 SP_UUID ${SP_UUID_CANON}
29 SP_NAME "attestation"
30)
Julian Hallcaa4af82021-05-19 12:02:36 +010031
Julian Hallcaa4af82021-05-19 12:02:36 +010032#-------------------------------------------------------------------------------
33# Default deployment specific configuration
34#
35#-------------------------------------------------------------------------------
36set(TS_NO_FLOAT_HW ON)
37
38#-------------------------------------------------------------------------------
39# Components that are specific to deployment in the opteesp environment.
40#
41#-------------------------------------------------------------------------------
42add_components(TARGET "attestation"
43 BASE_DIR ${TS_ROOT}
44 COMPONENTS
Julian Hallcaa4af82021-05-19 12:02:36 +010045 "environments/opteesp"
46)
47
Imre Kisd0ed5c22021-12-15 17:05:47 +010048include(../attestation.cmake REQUIRED)
Julian Hallcaa4af82021-05-19 12:02:36 +010049
50#-------------------------------------------------------------------------------
Gyorgy Szinga365a042021-12-02 01:48:27 +010051# Set target platform to provide drivers needed by the deployment
Julian Hallcaa4af82021-05-19 12:02:36 +010052#
53#-------------------------------------------------------------------------------
54add_platform(TARGET "attestation")
55
Julian Hallcaa4af82021-05-19 12:02:36 +010056target_compile_definitions(attestation PRIVATE
57 ARM64=1
58)
59
60target_include_directories(attestation PRIVATE
Julian Hallcaa4af82021-05-19 12:02:36 +010061 ${TS_ROOT}/deployments/attestation/opteesp
62)
63
64if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
65 target_compile_options(attestation PRIVATE
Andrew Beggs97a00d42021-06-15 15:45:46 +000066 -std=c99
Julian Hallcaa4af82021-05-19 12:02:36 +010067 )
68
Julian Hallcaa4af82021-05-19 12:02:36 +010069endif()
70
Balint Dobszayc9daea92022-06-15 15:17:11 +020071compiler_generate_stripped_elf(TARGET attestation NAME "${SP_UUID_CANON}.stripped.elf" RES STRIPPED_ELF)
Julian Hallcaa4af82021-05-19 12:02:36 +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()
77#TODO: api headers
78
79install(TARGETS attestation
80 PUBLIC_HEADER DESTINATION ${TS_ENV}/include
81 RUNTIME DESTINATION ${TS_ENV}/bin
82 )
83install(FILES ${STRIPPED_ELF} DESTINATION ${TS_ENV}/bin)
84
85get_property(_PROTO_FILES TARGET attestation PROPERTY PROTOBUF_FILES)
86install(FILES ${_PROTO_FILES} DESTINATION ${TS_ENV}/lib/protobuf)
87
Imre Kisa74aaf92021-12-14 17:13:06 +010088include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
89export_sp(
Balint Dobszayc9daea92022-06-15 15:17:11 +020090 SP_UUID_CANON ${SP_UUID_CANON}
91 SP_UUID_LE ${SP_UUID_LE}
Imre Kisa74aaf92021-12-14 17:13:06 +010092 SP_NAME "attestation"
93 MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
94 DTS_IN ${CMAKE_CURRENT_LIST_DIR}/default_attestation.dts.in
95 JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
96)