diff --git a/meta-arm-bsp/conf/machine/juno.conf b/meta-arm-bsp/conf/machine/juno.conf index 878b6b19..898a863d 100644 --- a/meta-arm-bsp/conf/machine/juno.conf +++ b/meta-arm-bsp/conf/machine/juno.conf @@ -20,6 +20,7 @@ SERIAL_CONSOLES = "115200;ttyAMA0" # Use kernel provided by linaro (Contains support for SCMi or HDMI) PREFERRED_PROVIDER_virtual/kernel ?= "linux-linaro-arm" PREFERRED_VERSION_linux-linaro-arm ?= "4.19%" +PREFERRED_VERSION_trusted-firmware-a ?= "2.1%" EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot firmware-image-juno" 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 93ca1994..e6d48e42 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 @@ -81,8 +81,15 @@ 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)}" - +# 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() { + # These changes are needed to have the fiptool compiling and executing properly + sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile + sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile + export LD_LIBRARY_PATH=${STAGING_DIR_NATIVE}${libdir}:$LD_LIBRARY_PATH + oe_runmake ${TFA_BUILD_TARGET} } diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.1.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.1.bb index e8933fb1..4d412027 100644 --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.1.bb +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.1.bb @@ -1,6 +1,9 @@ # # Trusted firmware-A 2.1 # + +require trusted-firmware-a.inc + SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa" # Use TF-A for version @@ -33,20 +36,3 @@ LIC_FILES_CHKSUM_MBEDTLS += " \ SRC_URI[mbedtls.md5sum] = "37cdec398ae9ebdd4640df74af893c95" SRC_URI[mbedtls.sha256sum] = "a6834fcd7b7e64b83dfaaa6ee695198cb5019a929b2806cb0162e049f98206a4" - -require trusted-firmware-a.inc - -# 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. -# To properly use the native toolchain of yocto and the right libraries we need -# to pass the proper flags to gcc. This is achieved here by creating a gcc -# script to force passing to gcc the right CFLAGS and LDFLAGS -do_compile_prepend() { - #Create an host gcc build parser to ensure the proper include path is used - mkdir -p bin - echo "#!/usr/bin/env bash" > bin/gcc - echo "$(which ${BUILD_CC}) ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \$@" >> bin/gcc - chmod a+x bin/gcc - export PATH="$PWD/bin:$PATH" -} diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bb new file mode 100644 index 00000000..4d5316ea --- /dev/null +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.2.bb @@ -0,0 +1,38 @@ +# +# Trusted firmware-A 2.2 +# + +require trusted-firmware-a.inc + +SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa" + +# Use TF-A for version +SRCREV_FORMAT = "tfa" + +# TF-A v2.2 +SRCREV_tfa = "7192b956bde11652a835eee0724dca0e403fee90" + +S = "${WORKDIR}/git" + +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89" + +SRC_URI[tfa.md5sum] = "75c8f4958fb493d9bd7a8e5a9636ec18" +SRC_URI[tfa.sha256sum] = "7c4c00a4f28d3cfbb235fd1a1fb28c4d2fc1d657c9301686e7d8824ef575d059" + +# +# mbed TLS source +# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1 +# + +SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls" + +# mbed TLS v2.16.2 +SRCREV_mbedtls = "d81c11b8ab61fd5b2da8133aa73c5fe33a0633eb" + +LIC_FILES_CHKSUM_MBEDTLS += " \ + file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ + file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \ + " + +SRC_URI[mbedtls.md5sum] = "37cdec398ae9ebdd4640df74af893c95" +SRC_URI[mbedtls.sha256sum] = "a6834fcd7b7e64b83dfaaa6ee695198cb5019a929b2806cb0162e049f98206a4" diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file mode 100644 index 00000000..bfda87bc --- /dev/null +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb @@ -0,0 +1,38 @@ +# +# Trusted firmware-A 2.3 +# + +require trusted-firmware-a.inc + +SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa" + +# Use TF-A for version +SRCREV_FORMAT = "tfa" + +# TF-A v2.3 +SRCREV_tfa = "ecd27ad85f1eba29f6bf92c39dc002c85b07dad5" + +S = "${WORKDIR}/git" + +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89" + +SRC_URI[tfa.md5sum] = "75c8f4958fb493d9bd7a8e5a9636ec18" +SRC_URI[tfa.sha256sum] = "7c4c00a4f28d3cfbb235fd1a1fb28c4d2fc1d657c9301686e7d8824ef575d059" + +# +# mbed TLS source +# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1 +# + +SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls" + +# mbed TLS v2.18.1 +SRCREV_mbedtls = "ca933c7e0c9e84738b168b6b0feb89af4183a60a" + +LIC_FILES_CHKSUM_MBEDTLS += " \ + file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ + file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \ + " + +SRC_URI[mbedtls.md5sum] = "37cdec398ae9ebdd4640df74af893c95" +SRC_URI[mbedtls.sha256sum] = "a6834fcd7b7e64b83dfaaa6ee695198cb5019a929b2806cb0162e049f98206a4" diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_git.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_git.bb index 4bf3ae5e..c443ecd6 100644 --- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_git.bb +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_git.bb @@ -9,30 +9,23 @@ DEFAULT_PREFERENCE = "-1" require trusted-firmware-a.inc SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa" -SRCREV_FORMAT = "tfa" -LIC_FILES_CHKSUM ?= "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89" +# Use TF-A for version +SRCREV_FORMAT = "tfa" + +S = "${WORKDIR}/git" + +LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89" + +# # mbed TLS source # Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1 +# + SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls" -LIC_FILES_CHKSUM_MBEDTLS ?= " \ + +LIC_FILES_CHKSUM_MBEDTLS += " \ file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \ " -S = "${WORKDIR}/git" - -# 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. -# To properly use the native toolchain of yocto and the right libraries we need -# to pass the proper flags to gcc. This is achieved here by creating a gcc -# script to force passing to gcc the right CFLAGS and LDFLAGS -do_compile_prepend() { - # Create an host gcc build parser to ensure the proper include path is used - mkdir -p bin - echo "#!/usr/bin/env bash" > bin/gcc - echo "$(which ${BUILD_CC}) ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \$@" >> bin/gcc - chmod a+x bin/gcc - export PATH="$PWD/bin:$PATH" -}