blob: b99bf10eb34febaf6ed46e98640ad6718b54c614 [file] [log] [blame]
Jelle Sels03756662021-05-20 10:41:57 +02001#-------------------------------------------------------------------------------
Jelle Sels4960c412023-02-01 09:43:24 +01002# Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
Jelle Sels03756662021-05-20 10:41:57 +02003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7#-------------------------------------------------------------------------------
8# The CMakeLists.txt for building the spm-test sp deployment for opteesp
9#
10# Used for building the SPs used in the spm test. The SP can be build twice
11# , to be able to test inter SPs communication. This is done by passing the
12# -DSP_NUMBER=1 parameter.
13#-------------------------------------------------------------------------------
14target_include_directories(spm-test${SP_NUMBER} PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}")
15
Jelle Sels03756662021-05-20 10:41:57 +020016#-------------------------------------------------------------------------------
17# Extend with components that are common across all deployments of
18# spm-test
19#
20#-------------------------------------------------------------------------------
21target_include_directories(spm-test${SP_NUMBER} PRIVATE
22 ${TS_ROOT}
23 ${TS_ROOT}/components
24)
25
26#-------------------------------------------------------------------------------
27# Set target platform to provide drivers needed by the deployment
28#
29#-------------------------------------------------------------------------------
30add_platform(TARGET spm-test${SP_NUMBER})
31
32#################################################################
33
34target_compile_definitions(spm-test${SP_NUMBER} PRIVATE
35 ARM64=1
36)
37
38target_include_directories(spm-test${SP_NUMBER} PRIVATE
39 ${TS_ROOT}/components/service/spm_test
40)
41
Gyorgy Szing34aaf212022-10-20 07:26:23 +020042if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
43 target_compile_options(spm-test${SP_NUMBER} PRIVATE
44 -std=c99
45 )
46endif()
47
Jelle Sels03756662021-05-20 10:41:57 +020048#-------------------------------------------------------------------------------
49# Deployment specific source files
50#-------------------------------------------------------------------------------
51target_sources(spm-test${SP_NUMBER} PRIVATE
52 ${TS_ROOT}/components/service/spm_test/sp.c
53)
Jelle Sels03756662021-05-20 10:41:57 +020054
Jelle Sels03756662021-05-20 10:41:57 +020055######################################## install
56if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
57 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
58endif()
59
Jelle Sels03756662021-05-20 10:41:57 +020060install(TARGETS spm-test${SP_NUMBER}
Jelle Sels03756662021-05-20 10:41:57 +020061 RUNTIME DESTINATION ${TS_ENV}/bin
62 )
Jelle Sels03756662021-05-20 10:41:57 +020063
Gyorgy Szinge9e0fed2025-01-06 15:24:04 +010064
65# Convert the base address used for memory region testing for the manifest file. The manifest template will use
66# MEM_REG_LO and MEM_REG_HI.
67# This value is either defined in platform.cmake or on the command line.
68if (NOT DEFINED CFG_TEST_MEM_REGION_ADDRESS)
69 message(FATAL_ERROR "Mandatory variable CFG_TEST_MEM_REGION_ADDRESS is not defined.")
70endif()
71uint64_split(VALUE ${CFG_TEST_MEM_REGION_ADDRESS} OUT_PREFIX MEM_REG)
72
Jelle Sels03756662021-05-20 10:41:57 +020073include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake)
74export_sp(
Jelle Sels4960c412023-02-01 09:43:24 +010075 SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON}
Gyorgy Szing3e3db702023-07-21 14:18:19 +020076 SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON}
Gabor Toth6a89a262024-04-05 11:39:39 +020077 SP_BOOT_ORDER ${SP_BOOT_ORDER}
Jelle Sels03756662021-05-20 10:41:57 +020078 SP_NAME "spm-test${SP_NUMBER}"
79 MK_IN ${TS_ROOT}/environments/opteesp/sp.mk.in
80 DTS_IN ${TS_ROOT}/deployments/spm-test${SP_NUMBER}/opteesp/default_spm_test${SP_NUMBER}.dts.in
81 JSON_IN ${TS_ROOT}/environments/opteesp/sp_pkg.json.in
82)