diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 5d476eb583..0b434ba064 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -2583,6 +2583,18 @@ West: labels: - manifest-tf-m-tests +"West project: trusted-firmware-a": + status: maintained + maintainers: + - povergoing + - sgrrzhf + collaborators: + - carlocaione + files: + - modules/trusted-firmware-a/ + labels: + - manifest-trusted-firmware-a + "West project: psa-arch-tests": status: maintained maintainers: diff --git a/modules/Kconfig b/modules/Kconfig index 69dbdb74b8..103ea092ae 100644 --- a/modules/Kconfig +++ b/modules/Kconfig @@ -74,6 +74,9 @@ comment "mbedtls module not available." comment "Trusted-firmware-m module not available." depends on !ZEPHYR_TRUSTED_FIRMWARE_M_MODULE +comment "Trusted-firmware-a module not available." + depends on !ZEPHYR_TRUSTED_FIRMWARE_A_MODULE + comment "Nanopb module not available." depends on !ZEPHYR_NANOPB_MODULE diff --git a/modules/trusted-firmware-a/CMakeLists.txt b/modules/trusted-firmware-a/CMakeLists.txt new file mode 100644 index 0000000000..72c1ea5c75 --- /dev/null +++ b/modules/trusted-firmware-a/CMakeLists.txt @@ -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() diff --git a/modules/trusted-firmware-a/Kconfig b/modules/trusted-firmware-a/Kconfig new file mode 100644 index 0000000000..f99366128d --- /dev/null +++ b/modules/trusted-firmware-a/Kconfig @@ -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 diff --git a/west.yml b/west.yml index 10fe26f678..e1604575dc 100644 --- a/west.yml +++ b/west.yml @@ -239,6 +239,11 @@ manifest: path: modules/tee/tf-m/trusted-firmware-m groups: - tee + - name: trusted-firmware-a + revision: d29cddecde614d81cbec1fb0086cdaebd77d3575 + path: modules/tee/tf-a/trusted-firmware-a + groups: + - tee - name: tf-m-tests revision: c99a86b295c4887520da9d8402566d7f225c974e path: modules/tee/tf-m/tf-m-tests