Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 2 | # Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 3 | # |
| 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 | #------------------------------------------------------------------------------- |
| 14 | target_include_directories(spm-test${SP_NUMBER} PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
| 15 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 16 | #------------------------------------------------------------------------------- |
| 17 | # Extend with components that are common across all deployments of |
| 18 | # spm-test |
| 19 | # |
| 20 | #------------------------------------------------------------------------------- |
| 21 | target_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 | #------------------------------------------------------------------------------- |
| 30 | add_platform(TARGET spm-test${SP_NUMBER}) |
| 31 | |
| 32 | ################################################################# |
| 33 | |
| 34 | target_compile_definitions(spm-test${SP_NUMBER} PRIVATE |
| 35 | ARM64=1 |
| 36 | ) |
| 37 | |
| 38 | target_include_directories(spm-test${SP_NUMBER} PRIVATE |
| 39 | ${TS_ROOT}/components/service/spm_test |
| 40 | ) |
| 41 | |
Gyorgy Szing | 34aaf21 | 2022-10-20 07:26:23 +0200 | [diff] [blame] | 42 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
| 43 | target_compile_options(spm-test${SP_NUMBER} PRIVATE |
| 44 | -std=c99 |
| 45 | ) |
| 46 | endif() |
| 47 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 48 | #------------------------------------------------------------------------------- |
| 49 | # Deployment specific source files |
| 50 | #------------------------------------------------------------------------------- |
| 51 | target_sources(spm-test${SP_NUMBER} PRIVATE |
| 52 | ${TS_ROOT}/components/service/spm_test/sp.c |
| 53 | ) |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 54 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 55 | ######################################## install |
| 56 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 57 | set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE) |
| 58 | endif() |
| 59 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 60 | install(TARGETS spm-test${SP_NUMBER} |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 61 | RUNTIME DESTINATION ${TS_ENV}/bin |
| 62 | ) |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 63 | |
Gyorgy Szing | e9e0fed | 2025-01-06 15:24:04 +0100 | [diff] [blame] | 64 | |
| 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. |
| 68 | if (NOT DEFINED CFG_TEST_MEM_REGION_ADDRESS) |
| 69 | message(FATAL_ERROR "Mandatory variable CFG_TEST_MEM_REGION_ADDRESS is not defined.") |
| 70 | endif() |
| 71 | uint64_split(VALUE ${CFG_TEST_MEM_REGION_ADDRESS} OUT_PREFIX MEM_REG) |
| 72 | |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 73 | include(${TS_ROOT}/tools/cmake/common/ExportSp.cmake) |
| 74 | export_sp( |
Jelle Sels | 4960c41 | 2023-02-01 09:43:24 +0100 | [diff] [blame] | 75 | SP_FFA_UUID_CANON ${SP_FFA_UUID_CANON} |
Gyorgy Szing | 3e3db70 | 2023-07-21 14:18:19 +0200 | [diff] [blame] | 76 | SP_BIN_UUID_CANON ${SP_BIN_UUID_CANON} |
Gabor Toth | 6a89a26 | 2024-04-05 11:39:39 +0200 | [diff] [blame] | 77 | SP_BOOT_ORDER ${SP_BOOT_ORDER} |
Jelle Sels | 0375666 | 2021-05-20 10:41:57 +0200 | [diff] [blame] | 78 | 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 | ) |