From 7ce1aadc64d39a467527d905a274e1dad388512d Mon Sep 17 00:00:00 2001 From: Ting Liu Date: Wed, 16 Dec 2020 19:27:38 +0530 Subject: atf: rename to qoriq-atf Signed-off-by: Ting Liu --- conf/machine/ls1012afrwy.conf | 2 +- conf/machine/ls1012ardb.conf | 2 +- conf/machine/ls1028ardb.conf | 2 +- conf/machine/ls1043ardb.conf | 2 +- conf/machine/ls1046afrwy.conf | 2 +- conf/machine/ls1046ardb.conf | 2 +- conf/machine/ls1088ardb-pb.conf | 2 +- conf/machine/ls1088ardb.conf | 2 +- conf/machine/ls2088ardb.conf | 2 +- conf/machine/lx2160ardb.conf | 2 +- conf/machine/lx2162aqds.conf | 2 +- recipes-bsp/atf/atf-2.3.inc | 13 -- recipes-bsp/atf/atf-tools_2.3.bb | 14 -- recipes-bsp/atf/atf_1.5.bb | 249 --------------------------------- recipes-bsp/atf/atf_2.3.bb | 175 ----------------------- recipes-bsp/atf/qoriq-atf-2.3.inc | 13 ++ recipes-bsp/atf/qoriq-atf-tools_2.3.bb | 14 ++ recipes-bsp/atf/qoriq-atf_1.5.bb | 249 +++++++++++++++++++++++++++++++++ recipes-bsp/atf/qoriq-atf_2.3.bb | 175 +++++++++++++++++++++++ recipes-bsp/ddr-phy/ddr-phy_git.bb | 2 +- 20 files changed, 463 insertions(+), 463 deletions(-) delete mode 100644 recipes-bsp/atf/atf-2.3.inc delete mode 100644 recipes-bsp/atf/atf-tools_2.3.bb delete mode 100644 recipes-bsp/atf/atf_1.5.bb delete mode 100644 recipes-bsp/atf/atf_2.3.bb create mode 100644 recipes-bsp/atf/qoriq-atf-2.3.inc create mode 100644 recipes-bsp/atf/qoriq-atf-tools_2.3.bb create mode 100644 recipes-bsp/atf/qoriq-atf_1.5.bb create mode 100644 recipes-bsp/atf/qoriq-atf_2.3.bb diff --git a/conf/machine/ls1012afrwy.conf b/conf/machine/ls1012afrwy.conf index 449e518c..72605cc1 100644 --- a/conf/machine/ls1012afrwy.conf +++ b/conf/machine/ls1012afrwy.conf @@ -27,5 +27,5 @@ RCWQSPI ?= "N_SSNP_3305/rcw_1000" KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-frwy.dtb" KERNEL_DEFCONFIG ?= "defconfig" -EXTRA_IMAGEDEPENDS += "ppfe-firmware rcw atf" +EXTRA_IMAGEDEPENDS += "ppfe-firmware rcw qoriq-atf" USE_VT = "0" diff --git a/conf/machine/ls1012ardb.conf b/conf/machine/ls1012ardb.conf index 6efd6b3d..b4bfc571 100644 --- a/conf/machine/ls1012ardb.conf +++ b/conf/machine/ls1012ardb.conf @@ -28,5 +28,5 @@ RCWQSPISEC ?= "R_SPNH_3508/rcw_1000" KERNEL_DEVICETREE ?= "freescale/fsl-ls1012a-rdb.dtb freescale/fsl-ls1012a-qds.dtb" KERNEL_DEFCONFIG ?= "defconfig" -EXTRA_IMAGEDEPENDS += "ppfe-firmware rcw atf" +EXTRA_IMAGEDEPENDS += "ppfe-firmware rcw qoriq-atf" USE_VT = "0" diff --git a/conf/machine/ls1028ardb.conf b/conf/machine/ls1028ardb.conf index b0bbc5b8..7647bf41 100644 --- a/conf/machine/ls1028ardb.conf +++ b/conf/machine/ls1028ardb.conf @@ -34,5 +34,5 @@ RCWSD ?= "R_SQPP_0x85bb/rcw_1500_gpu600" RCWXSPI ?= "R_SQPP_0x85bb/rcw_1500_gpu600" RCWEMMC ?= "R_SQPP_0x85bb/rcw_1500_gpu600" -EXTRA_IMAGEDEPENDS += "rcw atf dp-firmware-cadence" +EXTRA_IMAGEDEPENDS += "rcw qoriq-atf dp-firmware-cadence" USE_VT = "0" diff --git a/conf/machine/ls1043ardb.conf b/conf/machine/ls1043ardb.conf index 6f1f7ea4..369abdcf 100644 --- a/conf/machine/ls1043ardb.conf +++ b/conf/machine/ls1043ardb.conf @@ -40,5 +40,5 @@ RCWSD ?= "RR_FQPP_1455/rcw_1600_sdboot" RCWNAND ?= "RR_FQPP_1455/rcw_1600_nandboot" QE_UCODE = "iram_Type_A_LS1021a_r1.0.bin" -EXTRA_IMAGEDEPENDS += "fm-ucode rcw qe-ucode uefi atf ls2-phy" +EXTRA_IMAGEDEPENDS += "fm-ucode rcw qe-ucode uefi qoriq-atf ls2-phy" USE_VT = "0" diff --git a/conf/machine/ls1046afrwy.conf b/conf/machine/ls1046afrwy.conf index 884f7666..f6854a0c 100644 --- a/conf/machine/ls1046afrwy.conf +++ b/conf/machine/ls1046afrwy.conf @@ -37,5 +37,5 @@ SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}" RCWQSPI ?= "NN_NNQNNPNP_3040_0506/rcw_1600_qspiboot" RCWSD ?= "NN_NNQNNPNP_3040_0506/rcw_1600_sdboot" -EXTRA_IMAGEDEPENDS += "fm-ucode rcw atf ls2-phy qe-ucode" +EXTRA_IMAGEDEPENDS += "fm-ucode rcw qoriq-atf ls2-phy qe-ucode" USE_VT = "0" diff --git a/conf/machine/ls1046ardb.conf b/conf/machine/ls1046ardb.conf index e8773366..64f26792 100644 --- a/conf/machine/ls1046ardb.conf +++ b/conf/machine/ls1046ardb.conf @@ -40,5 +40,5 @@ UEFI_QSPIBOOT ?= "LS1046ARDB_EFI_QSPIBOOT.fd" RCWQSPI ?= "RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot" RCWSD ?= "RR_FFSSPPPH_1133_5559/rcw_1800_sdboot" -EXTRA_IMAGEDEPENDS += "fm-ucode rcw uefi atf qe-ucode ls2-phy" +EXTRA_IMAGEDEPENDS += "fm-ucode rcw uefi qoriq-atf qe-ucode ls2-phy" USE_VT = "0" diff --git a/conf/machine/ls1088ardb-pb.conf b/conf/machine/ls1088ardb-pb.conf index 2e456f1b..1ae5693b 100644 --- a/conf/machine/ls1088ardb-pb.conf +++ b/conf/machine/ls1088ardb-pb.conf @@ -31,5 +31,5 @@ RCWSD ?= "FCSSRR_PPPP_0x1d_0x13/rcw_1600_sd" RCWQSPI ?= "FCSSRR_PPPP_0x1d_0x13/rcw_1600_qspi" -EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex atf" +EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex qoriq-atf" USE_VT = "0" diff --git a/conf/machine/ls1088ardb.conf b/conf/machine/ls1088ardb.conf index 8f47f284..9922248f 100644 --- a/conf/machine/ls1088ardb.conf +++ b/conf/machine/ls1088ardb.conf @@ -30,5 +30,5 @@ SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}" RCWSD ?= "FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd" RCWQSPI ?= "FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi" -EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex atf" +EXTRA_IMAGEDEPENDS += "mc-utils rcw management-complex qoriq-atf" USE_VT = "0" diff --git a/conf/machine/ls2088ardb.conf b/conf/machine/ls2088ardb.conf index f920d601..92c99326 100644 --- a/conf/machine/ls2088ardb.conf +++ b/conf/machine/ls2088ardb.conf @@ -31,5 +31,5 @@ KERNEL_DEFCONFIG ?= "defconfig" SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1 115200;ttyAMA0" SERIAL_CONSOLES_CHECK ?= "${SERIAL_CONSOLES}" -EXTRA_IMAGEDEPENDS += "mc-utils ls2-phy rcw management-complex uefi atf" +EXTRA_IMAGEDEPENDS += "mc-utils ls2-phy rcw management-complex uefi qoriq-atf" USE_VT = "0" diff --git a/conf/machine/lx2160ardb.conf b/conf/machine/lx2160ardb.conf index a8bbdbda..5e68a9fd 100644 --- a/conf/machine/lx2160ardb.conf +++ b/conf/machine/lx2160ardb.conf @@ -32,5 +32,5 @@ RCWXSPI ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2" RCWSD ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2" RCWEMMC ?= "XGGFF_PP_HHHH_RR_19_5_2/rcw_2000_700_2900_19_5_2" -EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy uefi atf inphi" +EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy uefi qoriq-atf inphi" USE_VT = "0" diff --git a/conf/machine/lx2162aqds.conf b/conf/machine/lx2162aqds.conf index 33f1b99d..c7ab95fb 100644 --- a/conf/machine/lx2162aqds.conf +++ b/conf/machine/lx2162aqds.conf @@ -32,5 +32,5 @@ RCWXSPI ?= "GGGG_NNNN_PPPP_PPPP_RR_17_2/rcw_2000_650_2900_17_2" RCWSD ?= "GGGG_NNNN_PPPP_PPPP_RR_17_2/rcw_2000_650_2900_17_2" RCWEMMC ?= "GGGG_NNNN_PPPP_PPPP_RR_17_2/rcw_2000_650_2900_17_2" -EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy atf inphi" +EXTRA_IMAGEDEPENDS += "management-complex mc-utils rcw ls2-phy ddr-phy qoriq-atf inphi" USE_VT = "0" diff --git a/recipes-bsp/atf/atf-2.3.inc b/recipes-bsp/atf/atf-2.3.inc deleted file mode 100644 index bc8b912a..00000000 --- a/recipes-bsp/atf/atf-2.3.inc +++ /dev/null @@ -1,13 +0,0 @@ -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031" - -PV = "2.3+git${SRCPV}" - -SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/atf;nobranch=1 \ - git://github.com/ARMmbed/mbedtls;nobranch=1;destsuffix=git/mbedtls;name=mbedtls \ -" -SRCREV = "4e40e24590ab908773ef842cd0e17faf233767d4" -SRCREV_mbedtls = "85da85555e5b086b0250780693c3ee584f63e79f" -SRCREV_FORMAT = "atf" - -S = "${WORKDIR}/git" diff --git a/recipes-bsp/atf/atf-tools_2.3.bb b/recipes-bsp/atf/atf-tools_2.3.bb deleted file mode 100644 index 57f53168..00000000 --- a/recipes-bsp/atf/atf-tools_2.3.bb +++ /dev/null @@ -1,14 +0,0 @@ -require atf-${PV}.inc - -SUMMARY = "Tools for ARM Trusted Firmware, e.g. FIP image creation tool" - -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_1.5.bb b/recipes-bsp/atf/atf_1.5.bb deleted file mode 100644 index 650acc3b..00000000 --- a/recipes-bsp/atf/atf_1.5.bb +++ /dev/null @@ -1,249 +0,0 @@ -DESCRIPTION = "ARM Trusted Firmware" - -LICENSE = "BSD" -LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443" - -PV = "1.5+git${SRCPV}" - -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 = "9225ad51f026975fa6b86db800f43c55db11fa4d" - -COMPATIBLE_MACHINE = "(qoriq)" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -PLATFORM = "${MACHINE}" -PLATFORM_ls1088ardb-pb = "ls1088ardb" -PLATFORM_ADDITIONAL_TARGET ??= "" -PLATFORM_ADDITIONAL_TARGET_ls1012afrwy = "ls1012afrwy_512mb" - -RCW_FOLDER ?= "${MACHINE}" -RCW_FOLDER_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="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/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 - ;; - auto) - rcwimg="${RCWAUTO}${rcwtemp}.bin" - ;; - 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/${RCW_FOLDER}/${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/${RCW_FOLDER}/${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 [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then - oe_runmake V=1 -C ${S} realclean - oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM_ADDITIONAL_TARGET} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt} - cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/bl2_qspi${secext}.pbl ${S}/bl2_${d}${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl - cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/fip.bin ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin - if [ "${BUILD_FUSE}" = "true" ]; then - cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/fuse_fip.bin ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.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/${RCW_FOLDER}/${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 [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then - cp -r ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fip_${PLATFORM_ADDITIONAL_TARGET}.bin - cp -r ${S}/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl ${D}/boot/atf/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl - if [ -f "${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin" ]; then - cp -r ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.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 [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then - cp -r ${S}/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl ${DEPLOYDIR}/atf/ - cp -r ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${DEPLOYDIR}/atf/fip_uboot${secext}_${PLATFORM_ADDITIONAL_TARGET}.bin - if [ -f "${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin" ]; then - cp -r ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}${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/atf_2.3.bb b/recipes-bsp/atf/atf_2.3.bb deleted file mode 100644 index ff83bbc8..00000000 --- a/recipes-bsp/atf/atf_2.3.bb +++ /dev/null @@ -1,175 +0,0 @@ -require atf-${PV}.inc - -DESCRIPTION = "ARM Trusted Firmware" - -inherit deploy - -DEPENDS += "cst-native" -do_compile[depends] += "u-boot:do_deploy rcw:do_deploy ddr-phy:do_deploy" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -PLATFORM = "${MACHINE}" -MBEDTLS_FOLDER ?= "${S}/mbedtls" -RCW_FOLDER ?= "${MACHINE}" - -# 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 ?= "flexspi_nor sd emmc" -ARM_COT = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-cot', 'true', 'false', d)}" -NXP_COT = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'true', 'false', d)}" -BUILD_OPTEE = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'true', 'false', d)}" - -PACKAGECONFIG ??= " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'arm-cot', 'optee', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'optee', '', d)} \ - ${@bb.utils.filter('COMBINED_FEATURES', 'optee', d)} \ -" -PACKAGECONFIG[optee] = ",,optee-os-qoriq" - -uboot_sec ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot" -uboot ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa" - -do_configure[noexec] = "1" - -do_compile() { - if [ "${NXP_COT}" = "true" -a "${ARM_COT}" = "true" ]; then - bbfatal " \ - Error!, Both ARM CoT and NXP CoT are enabled. Only one CoT is built in a yocto build, \ - Don't add nxp-cot and arm-cot into DISTRO_FEATURES_append at the same time." - fi - - if [ "${NXP_COT}" = "true" ]; then - rm -fr ${S}/nxp-cot - mkdir -p ${S}/nxp-cot - outputdir="${S}/nxp-cot" - elif [ "${ARM_COT}" = "true" ]; then - rm -fr ${S}/arm-cot - mkdir -p ${S}/arm-cot - outputdir="${S}/arm-cot" - else - outputdir="${S}" - fi - - if [ "${NXP_COT}" = "true" -o "${ARM_COT}" = "true" ]; then - 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 - - bl32="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin" - bl33="${uboot_sec}" - secext="_sec" - else - bl33="${uboot}" - fi - - for d in ${BOOTTYPE}; do - case $d in - sd) - rcwimg="${RCWSD}.bin" - ;; - emmc) - rcwimg="${RCWEMMC}.bin" - ;; - flexspi_nor) - rcwimg="${RCWXSPI}.bin" - ;; - esac - - if [ -f "${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg}" ]; then - oe_runmake V=1 -C ${S} realclean - if [ "${ARM_COT}" = "true" ]; then - mkdir -p ${S}/build/${PLATFORM}/release - if [ -f ${outputdir}/rot_key.pem ]; then - cp -fr ${outputdir}/*.pem ${S}/build/${PLATFORM}/release - fi - oe_runmake V=1 -C ${S} fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} SPD=opteed BL32=${bl32} \ - BL33=${bl33} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} TRUSTED_BOARD_BOOT=1 \ - GENERATE_COT=1 MBEDTLS_DIR=${MBEDTLS_FOLDER} CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst - - if [ ! -f ${outputdir}/ddr_fip_sec.bin ]; then - oe_runmake V=1 -C ${S} fip_ddr PLAT=${PLATFORM} TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 \ - MBEDTLS_DIR=${MBEDTLS_FOLDER} DDR_PHY_BIN_PATH=${DEPLOY_DIR_IMAGE}/ddr-phy - cp -r ${S}/build/${PLATFORM}/release/ddr_fip_sec.bin ${outputdir} - cp -r ${S}/build/${PLATFORM}/release/*.pem ${outputdir} - fi - elif [ "${NXP_COT}" = "true" ]; then - oe_runmake V=1 -C ${S} fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} SPD=opteed BL32=${bl32} \ - BL33=${bl33} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} TRUSTED_BOARD_BOOT=1 \ - CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst - - if [ ! -f ${outputdir}/ddr_fip_sec.bin ]; then - oe_runmake V=1 -C ${S} fip_ddr PLAT=${PLATFORM} TRUSTED_BOARD_BOOT=1 \ - CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst DDR_PHY_BIN_PATH=${DEPLOY_DIR_IMAGE}/ddr-phy - cp -r ${S}/build/${PLATFORM}/release/ddr_fip_sec.bin ${outputdir} - fi - elif [ "${BUILD_OPTEE}" = "true" ]; then - bl32="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin" - oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} SPD=opteed BL32=${bl32} \ - RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} - else - oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} \ - RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} - fi - - cp -r ${S}/build/${PLATFORM}/release/bl2_${d}${secext}.pbl ${outputdir} - cp -r ${S}/build/${PLATFORM}/release/fip.bin ${outputdir} - fi - rcwimg="" - done -} - -do_install() { - install -d ${D}/boot/atf - if [ "${ARM_COT}" = "true" ]; then - outputdir="${S}/arm-cot" - secext="_sec" - elif [ "${NXP_COT}" = "true" ]; then - outputdir="${S}/nxp-cot" - secext="_sec" - else - outputdir="${S}" - fi - if [ -f "${outputdir}/fip.bin" ]; then - cp -r ${outputdir}/fip.bin ${D}/boot/atf/fip_uboot${secext}.bin - fi - if [ -f "${outputdir}/ddr_fip_sec.bin" ]; then - cp -r ${outputdir}/ddr_fip_sec.bin ${D}/boot/atf/ - fi - for d in ${BOOTTYPE}; do - if [ -e ${outputdir}/bl2_${d}${secext}.pbl ]; then - cp -r ${outputdir}/bl2_${d}${secext}.pbl ${D}/boot/atf/bl2_${d}${secext}.pbl - fi - done - chown -R root:root ${D} -} - -do_deploy() { - if [ "${ARM_COT}" = "true" ]; then - outputdir="atf_arm-cot" - elif [ "${NXP_COT}" = "true" ]; then - outputdir="atf_nxp-cot" - else - outputdir="atf" - fi - - install -d ${DEPLOYDIR}/${outputdir} - cp -fr ${D}/boot/atf/* ${DEPLOYDIR}/${outputdir}/ -} -addtask deploy after do_install -FILES_${PN} += "/boot" -COMPATIBLE_MACHINE = "(lx2160a|lx2162a)" diff --git a/recipes-bsp/atf/qoriq-atf-2.3.inc b/recipes-bsp/atf/qoriq-atf-2.3.inc new file mode 100644 index 00000000..bc8b912a --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf-2.3.inc @@ -0,0 +1,13 @@ +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031" + +PV = "2.3+git${SRCPV}" + +SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/atf;nobranch=1 \ + git://github.com/ARMmbed/mbedtls;nobranch=1;destsuffix=git/mbedtls;name=mbedtls \ +" +SRCREV = "4e40e24590ab908773ef842cd0e17faf233767d4" +SRCREV_mbedtls = "85da85555e5b086b0250780693c3ee584f63e79f" +SRCREV_FORMAT = "atf" + +S = "${WORKDIR}/git" diff --git a/recipes-bsp/atf/qoriq-atf-tools_2.3.bb b/recipes-bsp/atf/qoriq-atf-tools_2.3.bb new file mode 100644 index 00000000..d4be32be --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf-tools_2.3.bb @@ -0,0 +1,14 @@ +require qoriq-atf-${PV}.inc + +SUMMARY = "Tools for ARM Trusted Firmware, e.g. FIP image creation tool" + +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/qoriq-atf_1.5.bb b/recipes-bsp/atf/qoriq-atf_1.5.bb new file mode 100644 index 00000000..650acc3b --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf_1.5.bb @@ -0,0 +1,249 @@ +DESCRIPTION = "ARM Trusted Firmware" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443" + +PV = "1.5+git${SRCPV}" + +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 = "9225ad51f026975fa6b86db800f43c55db11fa4d" + +COMPATIBLE_MACHINE = "(qoriq)" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +PLATFORM = "${MACHINE}" +PLATFORM_ls1088ardb-pb = "ls1088ardb" +PLATFORM_ADDITIONAL_TARGET ??= "" +PLATFORM_ADDITIONAL_TARGET_ls1012afrwy = "ls1012afrwy_512mb" + +RCW_FOLDER ?= "${MACHINE}" +RCW_FOLDER_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="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/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 + ;; + auto) + rcwimg="${RCWAUTO}${rcwtemp}.bin" + ;; + 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/${RCW_FOLDER}/${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/${RCW_FOLDER}/${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 [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then + oe_runmake V=1 -C ${S} realclean + oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM_ADDITIONAL_TARGET} BOOT_MODE=${d} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} ${bl32opt} ${spdopt} ${secureopt} ${fuseopt} ${otaopt} + cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/bl2_qspi${secext}.pbl ${S}/bl2_${d}${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl + cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/fip.bin ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin + if [ "${BUILD_FUSE}" = "true" ]; then + cp -r ${S}/build/${PLATFORM_ADDITIONAL_TARGET}/release/fuse_fip.bin ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.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/${RCW_FOLDER}/${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 [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then + cp -r ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fip_${PLATFORM_ADDITIONAL_TARGET}.bin + cp -r ${S}/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl ${D}/boot/atf/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl + if [ -f "${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin" ]; then + cp -r ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.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 [ -n "${PLATFORM_ADDITIONAL_TARGET}" ]; then + cp -r ${S}/bl2_qspi${secext}_${PLATFORM_ADDITIONAL_TARGET}.pbl ${DEPLOYDIR}/atf/ + cp -r ${S}/fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${DEPLOYDIR}/atf/fip_uboot${secext}_${PLATFORM_ADDITIONAL_TARGET}.bin + if [ -f "${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin" ]; then + cp -r ${S}/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}.bin ${D}/boot/atf/fuse_fip_${PLATFORM_ADDITIONAL_TARGET}${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.3.bb b/recipes-bsp/atf/qoriq-atf_2.3.bb new file mode 100644 index 00000000..aed32851 --- /dev/null +++ b/recipes-bsp/atf/qoriq-atf_2.3.bb @@ -0,0 +1,175 @@ +require qoriq-atf-${PV}.inc + +DESCRIPTION = "ARM Trusted Firmware" + +inherit deploy + +DEPENDS += "cst-native" +do_compile[depends] += "u-boot:do_deploy rcw:do_deploy ddr-phy:do_deploy" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +PLATFORM = "${MACHINE}" +MBEDTLS_FOLDER ?= "${S}/mbedtls" +RCW_FOLDER ?= "${MACHINE}" + +# 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 ?= "flexspi_nor sd emmc" +ARM_COT = "${@bb.utils.contains('DISTRO_FEATURES', 'arm-cot', 'true', 'false', d)}" +NXP_COT = "${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'true', 'false', d)}" +BUILD_OPTEE = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', 'true', 'false', d)}" + +PACKAGECONFIG ??= " \ + ${@bb.utils.contains('DISTRO_FEATURES', 'arm-cot', 'optee', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'secure', 'optee', '', d)} \ + ${@bb.utils.filter('COMBINED_FEATURES', 'optee', d)} \ +" +PACKAGECONFIG[optee] = ",,optee-os-qoriq" + +uboot_sec ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa-secure-boot" +uboot ?= "${DEPLOY_DIR_IMAGE}/u-boot.bin-tfa" + +do_configure[noexec] = "1" + +do_compile() { + if [ "${NXP_COT}" = "true" -a "${ARM_COT}" = "true" ]; then + bbfatal " \ + Error!, Both ARM CoT and NXP CoT are enabled. Only one CoT is built in a yocto build, \ + Don't add nxp-cot and arm-cot into DISTRO_FEATURES_append at the same time." + fi + + if [ "${NXP_COT}" = "true" ]; then + rm -fr ${S}/nxp-cot + mkdir -p ${S}/nxp-cot + outputdir="${S}/nxp-cot" + elif [ "${ARM_COT}" = "true" ]; then + rm -fr ${S}/arm-cot + mkdir -p ${S}/arm-cot + outputdir="${S}/arm-cot" + else + outputdir="${S}" + fi + + if [ "${NXP_COT}" = "true" -o "${ARM_COT}" = "true" ]; then + 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 + + bl32="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin" + bl33="${uboot_sec}" + secext="_sec" + else + bl33="${uboot}" + fi + + for d in ${BOOTTYPE}; do + case $d in + sd) + rcwimg="${RCWSD}.bin" + ;; + emmc) + rcwimg="${RCWEMMC}.bin" + ;; + flexspi_nor) + rcwimg="${RCWXSPI}.bin" + ;; + esac + + if [ -f "${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg}" ]; then + oe_runmake V=1 -C ${S} realclean + if [ "${ARM_COT}" = "true" ]; then + mkdir -p ${S}/build/${PLATFORM}/release + if [ -f ${outputdir}/rot_key.pem ]; then + cp -fr ${outputdir}/*.pem ${S}/build/${PLATFORM}/release + fi + oe_runmake V=1 -C ${S} fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} SPD=opteed BL32=${bl32} \ + BL33=${bl33} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} TRUSTED_BOARD_BOOT=1 \ + GENERATE_COT=1 MBEDTLS_DIR=${MBEDTLS_FOLDER} CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst + + if [ ! -f ${outputdir}/ddr_fip_sec.bin ]; then + oe_runmake V=1 -C ${S} fip_ddr PLAT=${PLATFORM} TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 \ + MBEDTLS_DIR=${MBEDTLS_FOLDER} DDR_PHY_BIN_PATH=${DEPLOY_DIR_IMAGE}/ddr-phy + cp -r ${S}/build/${PLATFORM}/release/ddr_fip_sec.bin ${outputdir} + cp -r ${S}/build/${PLATFORM}/release/*.pem ${outputdir} + fi + elif [ "${NXP_COT}" = "true" ]; then + oe_runmake V=1 -C ${S} fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} SPD=opteed BL32=${bl32} \ + BL33=${bl33} RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} TRUSTED_BOARD_BOOT=1 \ + CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst + + if [ ! -f ${outputdir}/ddr_fip_sec.bin ]; then + oe_runmake V=1 -C ${S} fip_ddr PLAT=${PLATFORM} TRUSTED_BOARD_BOOT=1 \ + CST_DIR=${RECIPE_SYSROOT_NATIVE}/usr/bin/cst DDR_PHY_BIN_PATH=${DEPLOY_DIR_IMAGE}/ddr-phy + cp -r ${S}/build/${PLATFORM}/release/ddr_fip_sec.bin ${outputdir} + fi + elif [ "${BUILD_OPTEE}" = "true" ]; then + bl32="${RECIPE_SYSROOT}${nonarch_base_libdir}/firmware/tee_${MACHINE}.bin" + oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} SPD=opteed BL32=${bl32} \ + RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} + else + oe_runmake V=1 -C ${S} all fip pbl PLAT=${PLATFORM} BOOT_MODE=${d} \ + RCW=${DEPLOY_DIR_IMAGE}/rcw/${RCW_FOLDER}/${rcwimg} BL33=${bl33} + fi + + cp -r ${S}/build/${PLATFORM}/release/bl2_${d}${secext}.pbl ${outputdir} + cp -r ${S}/build/${PLATFORM}/release/fip.bin ${outputdir} + fi + rcwimg="" + done +} + +do_install() { + install -d ${D}/boot/atf + if [ "${ARM_COT}" = "true" ]; then + outputdir="${S}/arm-cot" + secext="_sec" + elif [ "${NXP_COT}" = "true" ]; then + outputdir="${S}/nxp-cot" + secext="_sec" + else + outputdir="${S}" + fi + if [ -f "${outputdir}/fip.bin" ]; then + cp -r ${outputdir}/fip.bin ${D}/boot/atf/fip_uboot${secext}.bin + fi + if [ -f "${outputdir}/ddr_fip_sec.bin" ]; then + cp -r ${outputdir}/ddr_fip_sec.bin ${D}/boot/atf/ + fi + for d in ${BOOTTYPE}; do + if [ -e ${outputdir}/bl2_${d}${secext}.pbl ]; then + cp -r ${outputdir}/bl2_${d}${secext}.pbl ${D}/boot/atf/bl2_${d}${secext}.pbl + fi + done + chown -R root:root ${D} +} + +do_deploy() { + if [ "${ARM_COT}" = "true" ]; then + outputdir="atf_arm-cot" + elif [ "${NXP_COT}" = "true" ]; then + outputdir="atf_nxp-cot" + else + outputdir="atf" + fi + + install -d ${DEPLOYDIR}/${outputdir} + cp -fr ${D}/boot/atf/* ${DEPLOYDIR}/${outputdir}/ +} +addtask deploy after do_install +FILES_${PN} += "/boot" +COMPATIBLE_MACHINE = "(lx2160a|lx2162a)" diff --git a/recipes-bsp/ddr-phy/ddr-phy_git.bb b/recipes-bsp/ddr-phy/ddr-phy_git.bb index 17893733..fa8833fd 100644 --- a/recipes-bsp/ddr-phy/ddr-phy_git.bb +++ b/recipes-bsp/ddr-phy/ddr-phy_git.bb @@ -11,7 +11,7 @@ S = "${WORKDIR}/git" REGLEX = "lx2160a" -DEPENDS += "atf-tools-native" +DEPENDS += "qoriq-atf-tools-native" do_compile() { cd ${S}/${REGLEX} -- cgit v1.2.3-54-g00ecf