diff options
author | Philippe Schenker <philippe.schenker@toradex.com> | 2022-07-13 19:01:24 +0200 |
---|---|---|
committer | Philippe Schenker <philippe.schenker@toradex.com> | 2022-07-13 19:56:15 +0200 |
commit | 3a4ea6511b12c4f68f9479bf83651fbc086d0885 (patch) | |
tree | 5a546f979d02e3a4b98fc35823f755e2086fe0e4 | |
parent | 97eebca39d33227e784020198908009f36f8cb93 (diff) |
backports: imx-atf: backport recipe from meta-imx
[ Backported from
https://source.codeaurora.org/external/imx/meta-imx/tree/meta-bsp/recipes-bsp/imx-atf/imx-atf_2.6.bb?h=kirkstone-5.15.32-2.0.0 ]
Copy the recipe for imx-atf on v2.6 which is needed for the NXP release
LF5.15.32_2.0.0.
Related-to: ELB-4586
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
[ps: do not deploy inside ${BOOT_TOOLS}]
-rw-r--r-- | backports/recipes-bsp/imx-atf/imx-atf_2.6.bb | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/backports/recipes-bsp/imx-atf/imx-atf_2.6.bb b/backports/recipes-bsp/imx-atf/imx-atf_2.6.bb new file mode 100644 index 0000000..d134e43 --- /dev/null +++ b/backports/recipes-bsp/imx-atf/imx-atf_2.6.bb @@ -0,0 +1,70 @@ +# Copyright (C) 2017-2022 NXP + +DESCRIPTION = "i.MX ARM Trusted Firmware" +SECTION = "BSP" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9" + +PV .= "+git${SRCPV}" + +SRCBRANCH = "lf_v2.6" +ATF_SRC ?= "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https" +SRC_URI = "${ATF_SRC};branch=${SRCBRANCH}" +SRCREV = "c6a19b1a351308cc73443283f6aa56b2eff791b8" + +S = "${WORKDIR}/git" + +inherit deploy + +BOOT_TOOLS = "imx-boot-tools" + +ATF_PLATFORM ??= "INVALID" + +EXTRA_OEMAKE += " \ + CROSS_COMPILE="${TARGET_PREFIX}" \ + PLAT=${ATF_PLATFORM} \ +" + +# 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" + +# Baremetal, just need a compiler +DEPENDS:remove = "virtual/${TARGET_PREFIX}compilerlibs virtual/libc" + +BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" + +# CC and LD introduce arguments which conflict with those otherwise provided by +# this recipe. The heads of these variables excluding those arguments +# are therefore used instead. +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 += 'CC="${@remove_options_tail(d.getVar('CC'))}"' + +do_compile() { + # Clear LDFLAGS to avoid the option -Wl recognize issue + oe_runmake bl31 + if ${BUILD_OPTEE}; then + oe_runmake clean BUILD_BASE=build-optee + oe_runmake BUILD_BASE=build-optee SPD=opteed bl31 + fi +} + +do_install[noexec] = "1" + +do_deploy() { + install -Dm 0644 ${S}/build/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}.bin + if ${BUILD_OPTEE}; then + install -m 0644 ${S}/build-optee/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}.bin-optee + fi +} +addtask deploy after do_compile + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" +COMPATIBLE_MACHINE = "(mx8-generic-bsp)" |