diff options
Diffstat (limited to 'recipes-bsp/imx-atf/imx-atf_2.10.bb')
| -rw-r--r-- | recipes-bsp/imx-atf/imx-atf_2.10.bb | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/recipes-bsp/imx-atf/imx-atf_2.10.bb b/recipes-bsp/imx-atf/imx-atf_2.10.bb new file mode 100644 index 000000000..14ed12523 --- /dev/null +++ b/recipes-bsp/imx-atf/imx-atf_2.10.bb | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | # Copyright (C) 2017-2024 NXP | ||
| 2 | |||
| 3 | DESCRIPTION = "i.MX ARM Trusted Firmware" | ||
| 4 | SECTION = "BSP" | ||
| 5 | LICENSE = "BSD-3-Clause" | ||
| 6 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9" | ||
| 7 | |||
| 8 | PV .= "+git${SRCPV}" | ||
| 9 | |||
| 10 | SRC_URI = "git://github.com/nxp-imx/imx-atf.git;protocol=https;branch=${SRCBRANCH}" | ||
| 11 | SRCBRANCH = "lf_v2.10" | ||
| 12 | SRCREV = "49143a1701d9ccd3239e3f95f3042897ca889ea8" | ||
| 13 | |||
| 14 | S = "${WORKDIR}/git" | ||
| 15 | |||
| 16 | inherit deploy | ||
| 17 | |||
| 18 | ATF_PLATFORM ??= "INVALID" | ||
| 19 | |||
| 20 | # FIXME: We should return INVALID here but currently only i.MX8M has support to override the UART | ||
| 21 | # base address in source code. | ||
| 22 | ATF_BOOT_UART_BASE ?= "" | ||
| 23 | |||
| 24 | EXTRA_OEMAKE += " \ | ||
| 25 | CROSS_COMPILE=${TARGET_PREFIX} \ | ||
| 26 | PLAT=${ATF_PLATFORM} \ | ||
| 27 | " | ||
| 28 | |||
| 29 | # Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application | ||
| 30 | CFLAGS[unexport] = "1" | ||
| 31 | LDFLAGS[unexport] = "1" | ||
| 32 | AS[unexport] = "1" | ||
| 33 | LD[unexport] = "1" | ||
| 34 | |||
| 35 | # Baremetal, just need a compiler | ||
| 36 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 37 | DEPENDS = "virtual/${HOST_PREFIX}gcc" | ||
| 38 | |||
| 39 | # Bring in clang compiler if using clang as default | ||
| 40 | DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}" | ||
| 41 | |||
| 42 | BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" | ||
| 43 | |||
| 44 | # CC and LD introduce arguments which conflict with those otherwise provided by | ||
| 45 | # this recipe. The heads of these variables excluding those arguments | ||
| 46 | # are therefore used instead. | ||
| 47 | def remove_options_tail (in_string): | ||
| 48 | from itertools import takewhile | ||
| 49 | return ' '.join(takewhile(lambda x: not x.startswith('-'), in_string.split(' '))) | ||
| 50 | |||
| 51 | EXTRA_OEMAKE += 'LD="${@remove_options_tail(d.getVar('LD'))}.bfd"' | ||
| 52 | |||
| 53 | EXTRA_OEMAKE += 'CC="${@remove_options_tail(d.getVar('CC'))}"' | ||
| 54 | |||
| 55 | # Set the UART to use during the boot. | ||
| 56 | EXTRA_OEMAKE += 'IMX_BOOT_UART_BASE=${ATF_BOOT_UART_BASE}' | ||
| 57 | |||
| 58 | do_configure[noexec] = "1" | ||
| 59 | |||
| 60 | do_compile() { | ||
| 61 | # Clear LDFLAGS to avoid the option -Wl recognize issue | ||
| 62 | oe_runmake bl31 | ||
| 63 | if ${BUILD_OPTEE}; then | ||
| 64 | oe_runmake clean BUILD_BASE=build-optee | ||
| 65 | oe_runmake BUILD_BASE=build-optee SPD=opteed bl31 | ||
| 66 | fi | ||
| 67 | } | ||
| 68 | |||
| 69 | do_install[noexec] = "1" | ||
| 70 | |||
| 71 | addtask deploy after do_compile | ||
| 72 | do_deploy() { | ||
| 73 | install -Dm 0644 ${S}/build/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}.bin | ||
| 74 | if ${BUILD_OPTEE}; then | ||
| 75 | install -m 0644 ${S}/build-optee/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}.bin-optee | ||
| 76 | fi | ||
| 77 | } | ||
| 78 | |||
| 79 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 80 | COMPATIBLE_MACHINE = "(mx8-generic-bsp|mx9-generic-bsp)" | ||
