blob: 9c2252cdcaaf7fd1a651d486a77dd17ebfda0791 [file] [log] [blame]
Balint Dobszay1b631eb2021-01-15 11:09:36 +01001#-------------------------------------------------------------------------------
Gyorgy Szing96669942021-12-08 04:19:50 +01002# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
Balint Dobszay1b631eb2021-01-15 11:09:36 +01003#
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 Dobszay1b631eb2021-01-15 11:09:36 +010011
Gyorgy Szing96669942021-12-08 04:19:50 +010012set(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 Kisb49e4262022-07-22 17:22:05 +020014set(LINUX_FFA_USER_SHIM_REFSPEC "v5.0.0"
Gyorgy Szing96669942021-12-08 04:19:50 +010015 CACHE STRING "Linux FF-A user space shim git refspec")
Balint Dobszay1b631eb2021-01-15 11:09:36 +010016
Gyorgy Szing96669942021-12-08 04:19:50 +010017set(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 Dobszay1b631eb2021-01-15 11:09:36 +010019
Gyorgy Szing96669942021-12-08 04:19:50 +010020if (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 Dobszay1b631eb2021-01-15 11:09:36 +010023endif()
24
Gyorgy Szing96669942021-12-08 04:19:50 +010025set(GIT_OPTIONS
26 GIT_REPOSITORY ${LINUX_FFA_USER_SHIM_URL}
27 GIT_TAG ${LINUX_FFA_USER_SHIM_REFSPEC}
Julian Halla628af32022-04-01 10:08:18 +010028 GIT_SHALLOW FALSE
Gyorgy Szing96669942021-12-08 04:19:50 +010029 )
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 Dobszay1b631eb2021-01-15 11:09:36 +010037find_path(LINUX_FFA_USER_SHIM_INCLUDE_DIR
38 NAMES arm_ffa_user.h
Gyorgy Szing96669942021-12-08 04:19:50 +010039 PATHS ${LINUX_FFA_USER_SHIM_SOURCE_DIR}
Balint Dobszay1b631eb2021-01-15 11:09:36 +010040 NO_DEFAULT_PATH
41 REQUIRED
42 DOC "Linux FF-A user space shim include directory"
43)
Gyorgy Szing96669942021-12-08 04:19:50 +010044
45set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
46 "${LINUX_FFA_USER_SHIM_INCLUDE_DIR}/arm_ffa_user.h")