diff options
Diffstat (limited to 'recipes-bsp/atf')
-rw-r--r-- | recipes-bsp/atf/atf-tools_git.bb | 19 | ||||
-rw-r--r-- | recipes-bsp/atf/atf/0001-Makefile-add-CC-gcc.patch | 28 | ||||
-rw-r--r-- | recipes-bsp/atf/atf/0001-fix-fiptool-build-error.patch | 28 | ||||
-rw-r--r-- | recipes-bsp/atf/atf_git.bb | 237 | ||||
-rw-r--r-- | recipes-bsp/atf/qoriq-atf-2.6.inc | 12 | ||||
-rw-r--r-- | recipes-bsp/atf/qoriq-atf-tools_2.6.bb | 15 | ||||
-rw-r--r-- | recipes-bsp/atf/qoriq-atf/tf-a-tests-no-warn-rwx-segments.patch | 35 | ||||
-rw-r--r-- | recipes-bsp/atf/qoriq-atf_2.6.bb | 189 |
8 files changed, 251 insertions, 312 deletions
diff --git a/recipes-bsp/atf/atf-tools_git.bb b/recipes-bsp/atf/atf-tools_git.bb deleted file mode 100644 index a5998fe2..00000000 --- a/recipes-bsp/atf/atf-tools_git.bb +++ /dev/null @@ -1,19 +0,0 @@ -SUMMARY = "Tools for ARM Trusted Firmware, e.g. FIP image creation tool" -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443" - -SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/atf;nobranch=1" -SRCREV = "17f94e4315e81e3d1b22d863d9614d724e8273dc" - -S = "${WORKDIR}/git" - -DEPENDS += "openssl" - -EXTRA_OEMAKE = "fiptool V=1 HOSTCC='${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}'" - -do_install () { - install -m 0755 -d ${D}/${bindir} - install -m 0755 ${S}/tools/fiptool/fiptool ${D}/${bindir}/ -} - -BBCLASSEXTEND = "native" diff --git a/recipes-bsp/atf/atf/0001-Makefile-add-CC-gcc.patch b/recipes-bsp/atf/atf/0001-Makefile-add-CC-gcc.patch deleted file mode 100644 index efa2749e..00000000 --- a/recipes-bsp/atf/atf/0001-Makefile-add-CC-gcc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 3161524085339ae214f7dee17a98ccd6c442d66b Mon Sep 17 00:00:00 2001 -From: Chunrong Guo <chunrong.guo@nxp.com> -Date: Thu, 16 Aug 2018 17:38:04 +0800 -Subject: [PATCH] Makefile: add CC=gcc - - -Upstream-Status: Inappropriate [embedded specific] - -Signed-off-by: Chunrong Guo <chunrong.guo@nxp.com> ---- - plat/nxp/tools/Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/plat/nxp/tools/Makefile b/plat/nxp/tools/Makefile -index e648fd1..43d3b56 100644 ---- a/plat/nxp/tools/Makefile -+++ b/plat/nxp/tools/Makefile -@@ -32,6 +32,7 @@ endif - INCLUDE_PATHS := - - HOSTCC ?= gcc -+CC = gcc - - .PHONY: all clean distclean - --- -2.7.4 - diff --git a/recipes-bsp/atf/atf/0001-fix-fiptool-build-error.patch b/recipes-bsp/atf/atf/0001-fix-fiptool-build-error.patch deleted file mode 100644 index ffd9965a..00000000 --- a/recipes-bsp/atf/atf/0001-fix-fiptool-build-error.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a76ae26fdb673613f5f97872b7275c630b7b24b8 Mon Sep 17 00:00:00 2001 -From: BJ DevOps Team <bjdevops@NXP1.onmicrosoft.com> -Date: Wed, 16 May 2018 13:26:45 +0800 -Subject: [PATCH] fix fiptool build error - -Upstream-Status: Inappropriate [embedded specific] - ---- - tools/fiptool/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile -index e0e3923..f213f44 100644 ---- a/tools/fiptool/Makefile -+++ b/tools/fiptool/Makefile -@@ -19,7 +19,8 @@ ifeq (${DEBUG},1) - else - CFLAGS += -O2 - endif --LDLIBS := -lcrypto -+ -+LDLIBS := -Wl,-rpath=${LIBPATH}/usr/lib -L${LIBPATH}/usr/lib -lcrypto - - ifeq (${V},0) - Q := @ --- -1.8.3.1 - diff --git a/recipes-bsp/atf/atf_git.bb b/recipes-bsp/atf/atf_git.bb deleted file mode 100644 index d75e3eb2..00000000 --- a/recipes-bsp/atf/atf_git.bb +++ /dev/null @@ -1,237 +0,0 @@ -DESCRIPTION = "ARM Trusted Firmware" - -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443" - -inherit deploy - -DEPENDS += "u-boot-mkimage-native u-boot openssl openssl-native mbedtls rcw cst-native" -DEPENDS_append_lx2160a += "ddr-phy" -do_compile[depends] += "u-boot:do_deploy rcw:do_deploy uefi:do_deploy" - -S = "${WORKDIR}/git" - -SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/atf;nobranch=1" -SRCREV = "85e98b945172118c55f0cea9c1f655b4307e6fab" - -SRC_URI += "file://0001-fix-fiptool-build-error.patch \ - file://0001-Makefile-add-CC-gcc.patch \ -" -COMPATIBLE_MACHINE = "(qoriq)" -PACKAGE_ARCH = "${MACHINE_ARCH}" -PLATFORM = "${MACHINE}" -PLATFORM_ls1088ardb-pb = "ls1088ardb" -# requires CROSS_COMPILE set by hand as there is no configure script -export CROSS_COMPILE="${TARGET_PREFIX}" -export ARCH="arm64" -# Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application -CFLAGS[unexport] = "1" -LDFLAGS[unexport] = "1" -AS[unexport] = "1" -LD[unexport] = "1" - -EXTRA_OEMAKE += "HOSTCC='${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}'" - -BOOTTYPE ?= "nor nand qspi flexspi_nor sd emmc" -OTABOOTTYPE ?= "nor qspi flexspi_nor" -BUILD_SECURE = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'true', 'false', d)}" -BUILD_OPTEE = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'true', 'false', d)}" -BUILD_FUSE = "${@bb.utils.contains('DISTRO_FEATURES', 'fuse', 'true', 'false', d)}" -BUILD_OTA = "${@bb.utils.contains('DISTRO_FEATURES', 'ota', 'true', 'false', d)}" - -PACKAGECONFIG ??= " \ - ${@bb.utils.filter('COMBINED_FEATURES', 'optee', d)} \ -" -PACKAGECONFIG[optee] = ",,optee-os-qoriq" - -uboot_boot_sec ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot" -uboot_boot ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa" -rcw ?= "" -rcw_ls1012afrwy = "_default" -rcw_ls1012ardb = "_default" -rcwsec ?= "_sben" - -chassistype ?= "ls2088_1088" -chassistype_ls1012ardb = "ls104x_1012" -chassistype_ls1012afrwy = "ls104x_1012" -chassistype_ls1043ardb = "ls104x_1012" -chassistype_ls1046ardb = "ls104x_1012" -chassistype_ls1046afrwy = "ls104x_1012" - -ddrphyopt ?= "" -ddrphyopt_lx2160ardb = "fip_ddr_sec" - -do_configure[noexec] = "1" - -do_compile() { - export LIBPATH="${RECIPE_SYSROOT_NATIVE}" - install -d ${S}/include/tools_share/openssl - cp -r ${RECIPE_SYSROOT}/usr/include/openssl/* ${S}/include/tools_share/openssl - if [ ! -f ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pri ]; then - ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_keys 1024 - else - cp ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pri ${S} - cp ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pub ${S} - fi - - if [ "${BUILD_FUSE}" = "true" ]; then - ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_fusescr ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/input_files/gen_fusescr/${chassistype}/input_fuse_file - fuseopt="fip_fuse FUSE_PROG=1 FUSE_PROV_FILE=fuse_scr.bin" - fi - if [ "${BUILD_SECURE}" = "true" ]; then - secureopt="TRUSTED_BOARD_BOOT=1 ${ddrphyopt} CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst" - secext="_sec" - bl33="${uboot_boot_sec}" - if [ ${chassistype} = ls104x_1012 ]; then - rcwtemp="${rcwsec}" - else - rcwtemp="${rcw}" - fi - else - bl33="${uboot_boot}" - rcwtemp="${rcw}" - fi - - if [ "${BUILD_OPTEE}" = "true" ]; then - bl32="${DEPLOY_DIR_IMAGE}/optee/tee_${MACHINE}.bin" - bl32opt="BL32=${bl32}" - spdopt="SPD=opteed" - fi - - if [ "${BUILD_OTA}" = "true" ]; then - otaopt="POLICY_OTA=1" - btype="${OTABOOTTYPE}" - else - btype="${BOOTTYPE}" - fi - - if [ -f ${DEPLOY_DIR_IMAGE}/ddr-phy/ddr4_pmu_train_dmem.bin ]; then - cp ${DEPLOY_DIR_IMAGE}/ddr-phy/*.bin ${S}/ - fi - - for d in ${btype}; do - case $d in - nor) - rcwimg="${RCWNOR}${rcwtemp}.bin" - uefiboot="${UEFI_NORBOOT}" - ;; - nand) - rcwimg="${RCWNAND}${rcwtemp}.bin" - ;; - qspi) - rcwimg="${RCWQSPI}${rcwtemp}.bin" - uefiboot="${UEFI_QSPIBOOT}" - if [ "${BUILD_SECURE}" = "true" ] && [ ${MACHINE} = ls1046ardb ]; then - rcwimg="RR_FFSSPPPH_1133_5559/rcw_1600_qspiboot_sben.bin" - fi - ;; - sd) - rcwimg="${RCWSD}${rcwtemp}.bin" - ;; - emmc) - rcwimg="${RCWEMMC}${rcwtemp}.bin" - ;; - flexspi_nor) - rcwimg="${RCWXSPI}${rcwtemp}.bin" - uefiboot="${UEFI_XSPIBOOT}" - ;; - esac - - if [ -f "${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg}" ]; then - oe_runmake V=1 -C ${S} realclean - oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt} - cp -r ${S}/build/${PLATFORM}/release/bl2_${d}*.pbl ${S} - cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S} - if [ "${BUILD_FUSE}" = "true" ]; then - cp -f ${S}/build/${PLATFORM}/release/fuse_fip.bin ${S} - fi - - if [ ${MACHINE} = ls1012afrwy ]; then - oe_runmake V=1 -C ${S} realclean - oe_runmake V=1 -C ${S} all fip pbl PLAT=ls1012afrwy_512mb BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt} - cp -r ${S}/build/ls1012afrwy_512mb/release/bl2_qspi${secext}.pbl ${S}/bl2_${d}${secext}_512mb.pbl - cp -r ${S}/build/ls1012afrwy_512mb/release/fip.bin ${S}/fip_512mb.bin - if [ "${BUILD_FUSE}" = "true" ]; then - cp -r ${S}/build/ls1012afrwy_512mb/release/fuse_fip.bin ${S}/fuse_fip_512mb.bin - fi - fi - if [ -n "${uefiboot}" -a -f "${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot}" ]; then - oe_runmake V=1 -C ${S} realclean - oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${PLATFORM}/${rcwimg} BL33=${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt} - cp -r ${S}/build/${PLATFORM}/release/fip.bin ${S}/fip_uefi.bin - fi - fi - rcwimg="" - uefiboot="" - done -} - -do_install() { - install -d ${D}/boot/atf - cp -r ${S}/srk.pri ${D}/boot/atf - cp -r ${S}/srk.pub ${D}/boot/atf - if [ "${BUILD_SECURE}" = "true" ]; then - secext="_sec" - fi - if [ -f "${S}/fip_uefi.bin" ]; then - cp -r ${S}/fip_uefi.bin ${D}/boot/atf/fip_uefi.bin - fi - if [ -f "${S}/fuse_fip.bin" ]; then - cp -r ${S}/fuse_fip.bin ${D}/boot/atf/fuse_fip.bin - fi - if [ -f "${S}/fip.bin" ]; then - cp -r ${S}/fip.bin ${D}/boot/atf/fip.bin - fi - for d in ${BOOTTYPE}; do - if [ -e ${S}/bl2_${d}${secext}.pbl ]; then - cp -r ${S}/bl2_${d}${secext}.pbl ${D}/boot/atf/bl2_${d}${secext}.pbl - fi - done - if [ ${MACHINE} = ls1012afrwy ]; then - cp -r ${S}/fip_512mb.bin ${D}/boot/atf/fip_512mb.bin - cp -r ${S}/bl2_qspi${secext}_512mb.pbl ${D}/boot/atf/bl2_qspi${secext}_512mb.pbl - if [ -f "${S}/fuse_fip_512mb.bin" ]; then - cp -r ${S}/fuse_fip_512mb.bin ${D}/boot/atf/fuse_fip_512mb.bin - fi - fi - chown -R root:root ${D} - if [ -f "${S}/fip_ddr_sec.bin" ]; then - cp -r ${S}/fip_ddr_sec.bin ${D}/boot/atf/fip_ddr_sec.bin - fi -} - -do_deploy() { - install -d ${DEPLOYDIR}/atf - cp -r ${D}/boot/atf/srk.pri ${DEPLOYDIR}/atf - cp -r ${D}/boot/atf/srk.pub ${DEPLOYDIR}/atf - if [ "${BUILD_SECURE}" = "true" ]; then - secext="_sec" - fi - - if [ -f "${S}/fuse_fip.bin" ]; then - cp -r ${D}/boot/atf/fuse_fip.bin ${DEPLOYDIR}/atf/fuse_fip${secext}.bin - fi - - if [ -e ${D}/boot/atf/fip_uefi.bin ]; then - cp -r ${D}/boot/atf/fip_uefi.bin ${DEPLOYDIR}/atf/fip_uefi.bin - fi - cp -r ${D}/boot/atf/fip.bin ${DEPLOYDIR}/atf/fip_uboot${secext}.bin - for d in ${BOOTTYPE}; do - if [ -e ${D}/boot/atf/bl2_${d}${secext}.pbl ]; then - cp -r ${D}/boot/atf/bl2_${d}${secext}.pbl ${DEPLOYDIR}/atf/bl2_${d}${secext}.pbl - fi - done - if [ ${MACHINE} = ls1012afrwy ]; then - cp -r ${S}/bl2_qspi${secext}_512mb.pbl ${DEPLOYDIR}/atf/ - cp -r ${S}/fip_512mb.bin ${DEPLOYDIR}/atf/fip_uboot${secext}_512mb.bin - if [ -f "${S}/fuse_fip_512mb.bin" ]; then - cp -r ${S}/fuse_fip_512mb.bin ${D}/boot/atf/fuse_fip_512mb${secext}.bin - fi - fi - if [ -f "${S}/fip_ddr_sec.bin" ]; then - cp -r ${D}/boot/atf/fip_ddr_sec.bin ${DEPLOYDIR}/atf/fip_ddr_sec.bin - fi -} -addtask deploy after do_install -FILES_${PN} += "/boot" -BBCLASSEXTEND = "native nativesdk" diff --git a/recipes-bsp/atf/qoriq-atf-2.6.inc b/recipes-bsp/atf/qoriq-atf-2.6.inc new file mode 100644 index 00000000..d5ef5e75 --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf-2.6.inc @@ -0,0 +1,12 @@ +DESCRIPTION = "ARM Trusted Firmware" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031" + +ATF_BRANCH ?= "lf_v2.6" +ATF_SRC ?= "git://github.com/nxp-qoriq/atf.git;protocol=https" +SRC_URI = "${ATF_SRC};branch=${ATF_BRANCH}" +SRCREV = "616a4588f333522d50a55bedd2b9a90a51474a75" + +S = "${WORKDIR}/git" + diff --git a/recipes-bsp/atf/qoriq-atf-tools_2.6.bb b/recipes-bsp/atf/qoriq-atf-tools_2.6.bb new file mode 100644 index 00000000..2c1db306 --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf-tools_2.6.bb @@ -0,0 +1,15 @@ +require qoriq-atf-${PV}.inc + +DEPENDS += "openssl" + +PV:append = "+${SRCPV}" + +EXTRA_OEMAKE = "fiptool V=1 PLAT=lx2162aqds HOSTCC='${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}'" + +do_install () { + install -m 0755 -d ${D}/${bindir} + install -m 0755 ${S}/tools/fiptool/fiptool ${D}/${bindir}/ +} + +BBCLASSEXTEND = "native" + diff --git a/recipes-bsp/atf/qoriq-atf/tf-a-tests-no-warn-rwx-segments.patch b/recipes-bsp/atf/qoriq-atf/tf-a-tests-no-warn-rwx-segments.patch new file mode 100644 index 00000000..a8801082 --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf/tf-a-tests-no-warn-rwx-segments.patch @@ -0,0 +1,35 @@ +From 9ceeb0cadffee1b1476718795d0568f6b244bf44 Mon Sep 17 00:00:00 2001 +From: Jun Zhu <junzhu@nxp.com> +Date: Mon, 31 Oct 2022 21:24:15 +0800 +Subject: [PATCH] tf-a-tests-no-warn-rwx-segments + +Binutils 2.39 now warns when a segment has RXW permissions[1]: + +aarch64-poky-linux-musl-ld: tftf.elf has a LOAD segment with RWX permissions + +There is a ticket filed upstream[2], so until that is resolved just disable the warning +[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 +[2] https://developer.trustedfirmware.org/T996 + +Upstream-Status: Backport [https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19401] +Signed-off-by: Jun Zhu <junzhu@nxp.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index dccf0121d..0d082344b 100644 +--- a/Makefile ++++ b/Makefile +@@ -445,7 +445,7 @@ TF_LDFLAGS += --gc-sections + # ld.lld doesn't recognize the errata flags, + # therefore don't add those in that case + ifeq ($(findstring ld.lld,$(notdir $(LD))),) +-TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) ++TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) --no-warn-rwx-segments + endif + endif + +-- +2.25.1 + diff --git a/recipes-bsp/atf/qoriq-atf_2.6.bb b/recipes-bsp/atf/qoriq-atf_2.6.bb new file mode 100644 index 00000000..5ae2ed9d --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf_2.6.bb @@ -0,0 +1,189 @@ +require qoriq-atf-${PV}.inc + +inherit deploy + +DEPENDS += "u-boot-mkimage-native u-boot openssl openssl-native rcw qoriq-cst-native bc-native" +do_compile[depends] += "u-boot:do_deploy rcw:do_deploy uefi:do_deploy" + +PV:append = "+${SRCPV}" + +SRC_URI += "git://github.com/ARMmbed/mbedtls;protocol=https;nobranch=1;destsuffix=git/mbedtls;name=mbedtls \ + git://github.com/nxp/ddr-phy-binary;protocol=https;nobranch=1;destsuffix=git/ddr-phy-binary;name=ddr \ + file://tf-a-tests-no-warn-rwx-segments.patch \ +" +SRCREV_mbedtls = "0795874acdf887290b2571b193cafd3c4041a708" +SRCREV_ddr = "fbc036b88acb6c06ffed02c898cbae9856ec75ba" +SRCREV_FORMAT = "atf" + +COMPATIBLE_MACHINE = "(qoriq)" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +PLATFORM = "${MACHINE}" +PLATFORM:ls1088ardb-pb = "ls1088ardb" +PLATFORM:lx2160ardb-rev2 = "lx2160ardb" +PLATFORM_ADDITIONAL_TARGET ??= "" +PLATFORM_ADDITIONAL_TARGET:ls1012afrwy = "ls1012afrwy_512mb" + +RCW_FOLDER ?= "${MACHINE}" +RCW_FOLDER:ls1088ardb-pb = "ls1088ardb" +RCW_FOLDER:lx2160ardb = "lx2160ardb_rev2" +RCW_FOLDER:lx2160ardb-rev2 = "lx2160ardb_rev2" + +RCW_SUFFIX ?= ".bin" +RCW_SUFFIX:ls1012a = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', '_sben.bin', '_default.bin', d)}" +RCW_SUFFIX:ls1043a = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', '_sben.bin', '.bin', d)}" +RCW_SUFFIX:ls1046a = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', '_sben.bin', '.bin', d)}" + +UBOOT_BINARY ?= "${@bb.utils.contains('DISTRO_FEATURES', 'secure', '${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot', '${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa', d)}" + +SECURE_EXTENTION ?= "${@bb.utils.contains('DISTRO_FEATURES', 'secure', '_sec', '', d)}" + +BOOTTYPE ?= "nor nand qspi flexspi_nor sd emmc" + +chassistype ?= "ls2088_1088" +chassistype:ls1012a = "ls104x_1012" +chassistype:ls1043a = "ls104x_1012" +chassistype:ls1046a = "ls104x_1012" + +FIP_DDR ?= "" +FIP_DDR:lx2160a = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'fip_ddr', '', d)}" +FIP_DDR:lx2162a = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'fip_ddr', '', d)}" + +# requires CROSS_COMPILE set by hand as there is no configure script +export CROSS_COMPILE="${TARGET_PREFIX}" +export ARCH="arm64" + +# Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is +# a standalone application +CFLAGS[unexport] = "1" +LDFLAGS[unexport] = "1" +AS[unexport] = "1" +LD[unexport] = "1" + +EXTRA_OEMAKE += "HOSTCC='${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}'" +EXTRA_OEMAKE += "\ + ${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'BL32=${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin SPD=opteed', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'TRUSTED_BOARD_BOOT=1 CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'arm-cot', 'GENERATE_COT=1 MBEDTLS_DIR=${S}/mbedtls', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'fuse', 'fip_fuse FUSE_PROG=1 FUSE_PROV_FILE=fuse_scr.bin', '', d)} \ +" + +PACKAGECONFIG ??= " \ + ${@bb.utils.filter('COMBINED_FEATURES', 'optee', d)} \ +" +PACKAGECONFIG[optee] = ",,optee-os-qoriq" + +python() { + if bb.utils.contains("DISTRO_FEATURES", "arm-cot", True, False, d): + if not bb.utils.contains("DISTRO_FEATURES", "secure", True, False, d): + bb.fatal("arm-cot needs 'secure' being set in DISTRO_FEATURES") +} + +do_configure[noexec] = "1" + +do_compile() { + if [ ! -f ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pri ]; then + ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_keys 1024 + else + cp ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pri . + cp ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/srk.pub . + fi + + ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/gen_fusescr \ + ${RECIPE_SYSROOT_NATIVE}/usr/bin/cst/input_files/gen_fusescr/${chassistype}/input_fuse_file + + for d in ${BOOTTYPE}; do + case $d in + nor) + rcwimg="${RCWNOR}${RCW_SUFFIX}" + uefiboot="${UEFI_NORBOOT}" + ;; + nand) + rcwimg="${RCWNAND}${RCW_SUFFIX}" + ;; + qspi) + rcwimg="${RCWQSPI}${RCW_SUFFIX}" + uefiboot="${UEFI_QSPIBOOT}" + if [ -n "${SECURE_EXTENTION}" ] && [ "${MACHINE}" = ls1046ardb ]; then + rcwimg="RR_FFSSPPPH_1133_5559/rcw_1600_qspiboot_sben.bin" + fi + ;; + auto) + rcwimg="${RCWAUTO}${RCW_SUFFIX}" + ;; + sd) + rcwimg="${RCWSD}${RCW_SUFFIX}" + ;; + emmc) + rcwimg="${RCWEMMC}${RCW_SUFFIX}" + ;; + flexspi_nor) + rcwimg="${RCWXSPI}${RCW_SUFFIX}" + uefiboot="${UEFI_XSPIBOOT}" + ;; + esac + + if [ -f ${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/$rcwimg ]; then + make V=1 realclean + if [ -f rot_key.pem ];then + mkdir -p build/${PLATFORM}/release/ + cp *.pem build/${PLATFORM}/release/ + fi + + oe_runmake V=1 all fip pbl ${FIP_DDR} PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${UBOOT_BINARY} + cp build/${PLATFORM}/release/bl2_${d}${SECURE_EXTENTION}.pbl . + cp build/${PLATFORM}/release/fip.bin fip_uboot${SECURE_EXTENTION}.bin + if [ -e build/${PLATFORM}/release/fuse_fip.bin ]; then + cp build/${PLATFORM}/release/fuse_fip.bin . + fi + + if [ -e build/${PLATFORM}/release/ddr_fip_sec.bin ] && [ ! -f ddr_fip_sec.bin ]; then + cp build/${PLATFORM}/release/ddr_fip_sec.bin . + fi + + if [ -e build/${PLATFORM}/release/rot_key.pem ] && [ ! -f rot_key.pem ]; then + cp build/${PLATFORM}/release/*.pem . + fi + + if [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then + make V=1 realclean + oe_runmake V=1 all fip pbl PLAT=${PLATFORM_ADDITIONAL_TARGET} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${UBOOT_BINARY} + cp build/${PLATFORM_ADDITIONAL_TARGET}/release/bl2_${d}${SECURE_EXTENTION}.pbl bl2_${d}${SECURE_EXTENTION}_${PLATFORM_ADDITIONAL_TARGET}.pbl + cp build/${PLATFORM_ADDITIONAL_TARGET}/release/fip.bin fip_uboot${SECURE_EXTENTION}_${PLATFORM_ADDITIONAL_TARGET}.bin + if [ -e build/${PLATFORM_ADDITIONAL_TARGET}/release/fuse_fip.bin ]; then + cp build/${PLATFORM_ADDITIONAL_TARGET}/release/fuse_fip.bin fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin + fi + fi + + if [ -z "${SECURE_EXTENTION}" -a -f "${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot}" ]; then + make V=1 realclean + oe_runmake V=1 all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${DEPLOY_DIR_IMAGE}/uefi/${PLATFORM}/${uefiboot} + cp build/${PLATFORM}/release/fip.bin fip_uefi.bin + fi + fi + rcwimg="" + uefiboot="" + done +} + +do_install() { + install -d ${D}/boot/atf/ + cp srk.pri ${D}/boot/atf/ + cp srk.pub ${D}/boot/atf/ + cp *.pbl ${D}/boot/atf/ + if [ ! -e fuse_fip.bin ]; then + rm -f fuse_scr.bin + fi + cp *.bin ${D}/boot/atf/ + chown -R root:root ${D} +} + +do_deploy() { + install -d ${DEPLOYDIR}/atf/ + cp ${D}/boot/atf/* ${DEPLOYDIR}/atf/ +} +addtask deploy after do_install + +FILES:${PN} += "/boot" +BBCLASSEXTEND = "native nativesdk" |