diff options
Diffstat (limited to 'meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc')
-rw-r--r-- | meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | 80 |
1 files changed, 46 insertions, 34 deletions
diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc index 807e1254..922c0a34 100644 --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc @@ -1,14 +1,17 @@ DESCRIPTION = "Trusted Firmware-A" -LICENSE = "BSD-3-Clause" - -PROVIDES = "virtual/trusted-firmware-a" +LICENSE = "BSD-3-Clause & MIT" PACKAGE_ARCH = "${MACHINE_ARCH}" inherit deploy -SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa" -UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$" +SRC_URI_TRUSTED_FIRMWARE_A ?= "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https" +SRCBRANCH = "master" +SRC_URI = "${SRC_URI_TRUSTED_FIRMWARE_A};name=tfa;branch=${SRCBRANCH}" + +UPSTREAM_CHECK_GITTAGREGEX = "^(lts-)?v(?P<pver>\d+(\.\d+)+)$" + +SRCREV_FORMAT = "tfa" COMPATIBLE_MACHINE ?= "invalid" @@ -48,21 +51,20 @@ SRC_URI_MBEDTLS ??= "" # This should be set to MBEDTLS LIC FILES checksum LIC_FILES_CHKSUM_MBEDTLS ??= "" # add MBEDTLS to our sources if activated -SRC_URI_append = " ${@bb.utils.contains('TFA_MBEDTLS', '1', '${SRC_URI_MBEDTLS}', '', d)}" +SRC_URI:append = " ${@bb.utils.contains('TFA_MBEDTLS', '1', '${SRC_URI_MBEDTLS}', '', d)}" # Update license variables -LICENSE_append = "${@bb.utils.contains('TFA_MBEDTLS', '1', ' & Apache-2.0', '', d)}" -LIC_FILES_CHKSUM_append = "${@bb.utils.contains('TFA_MBEDTLS', '1', ' ${LIC_FILES_CHKSUM_MBEDTLS}', '', d)}" +LICENSE:append = "${@bb.utils.contains('TFA_MBEDTLS', '1', ' & Apache-2.0', '', d)}" +LIC_FILES_CHKSUM:append = "${@bb.utils.contains('TFA_MBEDTLS', '1', ' ${LIC_FILES_CHKSUM_MBEDTLS}', '', d)}" # add mbed TLS to version -SRCREV_FORMAT_append = "${@bb.utils.contains('TFA_MBEDTLS', '1', '_mbedtls', '', d)}" - -SRC_URI_append = " \ - file://0002-pmf.h-made-PMF_STOTE_ENABLE-pass-Wtautological.patch \ - file://0003-xlat-tables-v2-remove-tautological-assert.patch \ - " +SRCREV_FORMAT:append = "${@bb.utils.contains('TFA_MBEDTLS', '1', '_mbedtls', '', d)}" # U-boot support (set TFA_UBOOT to 1 to activate) # When U-Boot support is activated BL33 is activated with u-boot.bin file -TFA_UBOOT ?= "0" +TFA_UBOOT ??= "0" + +# UEFI support (set TFA_UEFI to 1 to activate) +# When UEFI support is activated BL33 is activated with uefi.bin file +TFA_UEFI ??= "0" # What to build # By default we only build bl1, do_deploy will copy @@ -87,12 +89,12 @@ LD[unexport] = "1" do_configure[noexec] = "1" # Baremetal, just need a compiler -DEPENDS_remove = "virtual/${TARGET_PREFIX}compilerlibs virtual/libc" +DEPENDS:remove = "virtual/${TARGET_PREFIX}compilerlibs virtual/libc" # We need dtc for dtbs compilation # We need openssl for fiptool DEPENDS = "dtc-native openssl-native" -DEPENDS_append_toolchain-clang = " compiler-rt" +DEPENDS:append:toolchain-clang = " compiler-rt" # CC and LD introduce arguments which conflict with those otherwise provided by # this recipe. The heads of these variables excluding those arguments @@ -101,11 +103,12 @@ def remove_options_tail (in_string): from itertools import takewhile return ' '.join(takewhile(lambda x: not x.startswith('-'), in_string.split(' '))) -EXTRA_OEMAKE += "LD=${@remove_options_tail(d.getVar('LD'))}" +EXTRA_OEMAKE += "LD='${@remove_options_tail(d.getVar('LD'))}'" -EXTRA_OEMAKE += "CC=${@remove_options_tail(d.getVar('CC'))}" +EXTRA_OEMAKE += "CC='${@remove_options_tail(d.getVar('CC'))}'" -EXTRA_OEMAKE += "V=1" +# Verbose builds, no -Werror +EXTRA_OEMAKE += "V=1 E=0" # Add platform parameter EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}" @@ -128,7 +131,15 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_MBEDTLS', '1', 'MBEDTLS_DIR=${TFA_MBE # Uboot support DEPENDS += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot', '', d)}" do_compile[depends] += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot:do_deploy', '', d)}" -EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', 'BL33=${DEPLOY_DIR_IMAGE}/u-boot.bin', '',d)}" +EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', 'BL33=${DEPLOY_DIR_IMAGE}/u-boot.bin', '', d)}" + +# UEFI support +DEPENDS += " ${@bb.utils.contains('TFA_UEFI', '1', 'edk2-firmware', '', d)}" +EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UEFI', '1', 'BL33=${RECIPE_SYSROOT}/firmware/uefi.bin', '', d)}" + +# TFTF test support +DEPENDS += " ${@bb.utils.contains('TFTF_TESTS', '1', 'tf-a-tests', '', d)}" +EXTRA_OEMAKE += "${@bb.utils.contains('TFTF_TESTS', '1', 'BL33=${RECIPE_SYSROOT}/firmware/tftf.bin', '',d)}" # Hafnium support SEL2_SPMC = "${@'${TFA_SPMD_SPM_AT_SEL2}' if d.getVar('TFA_SPD', True) == 'spmd' else ''}" @@ -144,30 +155,26 @@ EXTRA_OEMAKE += "${@bb.utils.contains('SEL2_SPMC', '1', 'ARM_SPMC_MANIFEST_DTS=$ # Tell the tools where the native OpenSSL is located EXTRA_OEMAKE += "OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}" +# Use the correct native compiler +EXTRA_OEMAKE += "HOSTCC='${BUILD_CC}'" # Runtime variables EXTRA_OEMAKE += "RUNTIME_SYSROOT=${STAGING_DIR_HOST}" -EXTRA_OEMAKE += "TARGET_FPU=${TARGET_FPU}" BUILD_DIR = "${B}/${TFA_PLATFORM}" BUILD_DIR .= "${@'/${TFA_BOARD}' if d.getVar('TFA_BOARD') else ''}" BUILD_DIR .= "/${@'debug' if d.getVar("TFA_DEBUG") == '1' else 'release'}" -# The following hack is needed to fit properly in yocto build environment -# TFA is forcing the host compiler and its flags in the Makefile using := -# assignment for GCC and CFLAGS. do_compile() { - cd ${S} - - # These changes are needed to have the native tools compiling and executing properly - sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile + # This is still needed to have the native tools executing properly by + # setting the RPATH + sed -i '/^LDOPTS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile - # This can be removed when only TF-A 2.4 onwards is supported - sed -i 's^OPENSSL_DIR.*=.*$^OPENSSL_DIR = ${STAGING_DIR_NATIVE}/${prefix_native}^' ${S}/tools/*/Makefile + sed -i '/^LIB/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/cert_create/Makefile # Currently there are races if you build all the targets at once in parallel for T in ${TFA_BUILD_TARGET}; do - oe_runmake $T + oe_runmake -C ${S} $T done } do_compile[cleandirs] = "${B}" @@ -221,10 +228,15 @@ do_install() { done } -FILES_${PN} = "/firmware" +FILES:${PN} = "/firmware" SYSROOT_DIRS += "/firmware" + +FILES:${PN}-dbg = "/firmware/*.elf" # Skip QA check for relocations in .text of elf binaries -INSANE_SKIP_${PN} = "textrel" +INSANE_SKIP:${PN}-dbg += "textrel" +# Build paths are currently embedded +INSANE_SKIP:${PN} += "buildpaths" +INSANE_SKIP:${PN}-dbg += "buildpaths" do_deploy() { cp -rf ${D}/firmware/* ${DEPLOYDIR}/ |