Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved. |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
| 8 | # Find Linux FF-A user space shim repo location. |
| 9 | # It contains a kernel module which exposes FF-A operations to user space using DebugFS. |
| 10 | |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 11 | |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 12 | set(LINUX_FFA_USER_SHIM_URL "https://git.gitlab.arm.com/linux-arm/linux-trusted-services.git" |
| 13 | CACHE STRING "Linux FF-A user space shim repository URL") |
Imre Kis | b49e426 | 2022-07-22 17:22:05 +0200 | [diff] [blame] | 14 | set(LINUX_FFA_USER_SHIM_REFSPEC "v5.0.0" |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 15 | CACHE STRING "Linux FF-A user space shim git refspec") |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 16 | |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 17 | set(LINUX_FFA_USER_SHIM_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_deps/linux_ffa_user_shim-src" |
| 18 | CACHE PATH "Location of Linux driver source.") |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 19 | |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 20 | if (DEFINED ENV{LINUX_FFA_USER_SHIM_SOURCE_DIR}) |
| 21 | set(LINUX_FFA_USER_SHIM_SOURCE_DIR $ENV{LINUX_FFA_USER_SHIM_SOURCE_DIR} |
| 22 | CACHE PATH "Location of Linux driver source." FORCE) |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 23 | endif() |
| 24 | |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 25 | set(GIT_OPTIONS |
| 26 | GIT_REPOSITORY ${LINUX_FFA_USER_SHIM_URL} |
| 27 | GIT_TAG ${LINUX_FFA_USER_SHIM_REFSPEC} |
Julian Hall | a628af3 | 2022-04-01 10:08:18 +0100 | [diff] [blame] | 28 | GIT_SHALLOW FALSE |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 29 | ) |
| 30 | include(${TS_ROOT}/tools/cmake/common/LazyFetch.cmake REQUIRED) |
| 31 | LazyFetch_MakeAvailable( |
| 32 | DEP_NAME linux_ffa_user_shim |
| 33 | FETCH_OPTIONS "${GIT_OPTIONS}" |
| 34 | SOURCE_DIR ${LINUX_FFA_USER_SHIM_SOURCE_DIR} |
| 35 | ) |
| 36 | |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 37 | find_path(LINUX_FFA_USER_SHIM_INCLUDE_DIR |
| 38 | NAMES arm_ffa_user.h |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 39 | PATHS ${LINUX_FFA_USER_SHIM_SOURCE_DIR} |
Balint Dobszay | 1b631eb | 2021-01-15 11:09:36 +0100 | [diff] [blame] | 40 | NO_DEFAULT_PATH |
| 41 | REQUIRED |
| 42 | DOC "Linux FF-A user space shim include directory" |
| 43 | ) |
Gyorgy Szing | 9666994 | 2021-12-08 04:19:50 +0100 | [diff] [blame] | 44 | |
| 45 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS |
| 46 | "${LINUX_FFA_USER_SHIM_INCLUDE_DIR}/arm_ffa_user.h") |