modules: tfa: integrate trusted-firmware-a

This commit integrates trusted-firmware-a as a zephyr module

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
This commit is contained in:
Huifeng Zhang 2022-07-08 10:32:56 +08:00 committed by Fabio Baltieri
commit 97897a003d
5 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,36 @@
# Copyright (c) 2022 Arm Limited (or its affiliates). All rights reserved.
# SPDX-License-Identifier: Apache-2.0
if (CONFIG_BUILD_WITH_TFA)
set(TFA_BINARY_DIR ${CMAKE_BINARY_DIR}/tfa)
file(MAKE_DIRECTORY ${TFA_BINARY_DIR})
include(ExternalProject)
ExternalProject_Add(
tfa
SOURCE_DIR ${ZEPHYR_TRUSTED_FIRMWARE_A_MODULE_DIR}
BINARY_DIR ${TFA_BINARY_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
BUILD_ALWAYS True
USES_TERMINAL_BUILD True
)
if (CONFIG_TFA_MAKE_BUILD_TYPE_DEBUG)
set(TFA_BUILD_DEBUG "1")
else()
set(TFA_BUILD_DEBUG "0")
endif()
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands
COMMAND make -C ${ZEPHYR_TRUSTED_FIRMWARE_A_MODULE_DIR}
DEBUG=${TFA_BUILD_DEBUG}
CROSS_COMPILE=${CROSS_COMPILE}
BUILD_BASE=${TFA_BINARY_DIR} PLAT=${TFA_PLAT}
BL33=${CMAKE_BINARY_DIR}/zephyr/${KERNEL_BIN_NAME}
all fip
)
endif()

View file

@ -0,0 +1,22 @@
# Copyright (c) 2022 Arm Limited (or its affiliates). All rights reserved.
# SPDX-License-Identifier: Apache-2.0
config ZEPHYR_TRUSTED_FIRMWARE_A_MODULE
bool
menuconfig BUILD_WITH_TFA
bool "Build with TF-A as the Secure Execution Environment"
help
When enabled, this option instructs the Zephyr build process to
additionally generate a TF-A image for the Secure Execution
environment, along with the Zephyr image. The Zephyr image
itself is to be executed in the Non-Secure Processing Environment.
if BUILD_WITH_TFA
config TFA_MAKE_BUILD_TYPE_DEBUG
bool "Debug build"
help
When enabled, the build type of TF-A would be debug.
endif # BUILD_WITH_TFA