diff options
Diffstat (limited to 'recipes-bsp/imx-atf/imx-atf_2.6.bb')
-rw-r--r-- | recipes-bsp/imx-atf/imx-atf_2.6.bb | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb new file mode 100644 index 00000000..b0cd4d3d --- /dev/null +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb | |||
@@ -0,0 +1,72 @@ | |||
1 | # Copyright (C) 2017-2021 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 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
9 | |||
10 | PV .= "+git${SRCPV}" | ||
11 | |||
12 | SRCBRANCH = "lf_v2.6" | ||
13 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https;branch=${SRCBRANCH} \ | ||
14 | file://0001-Makefile-Suppress-array-bounds-error.patch" | ||
15 | SRCREV = "c6a19b1a351308cc73443283f6aa56b2eff791b8" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | inherit deploy | ||
20 | |||
21 | BOOT_TOOLS = "imx-boot-tools" | ||
22 | |||
23 | ATF_PLATFORM ??= "INVALID" | ||
24 | |||
25 | EXTRA_OEMAKE += " \ | ||
26 | CROSS_COMPILE="${TARGET_PREFIX}" \ | ||
27 | PLAT=${ATF_PLATFORM} \ | ||
28 | " | ||
29 | |||
30 | # Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application | ||
31 | CFLAGS[unexport] = "1" | ||
32 | LDFLAGS[unexport] = "1" | ||
33 | AS[unexport] = "1" | ||
34 | LD[unexport] = "1" | ||
35 | |||
36 | # Baremetal, just need a compiler | ||
37 | DEPENDS:remove = "virtual/${TARGET_PREFIX}compilerlibs virtual/libc" | ||
38 | |||
39 | BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" | ||
40 | |||
41 | # CC and LD introduce arguments which conflict with those otherwise provided by | ||
42 | # this recipe. The heads of these variables excluding those arguments | ||
43 | # are therefore used instead. | ||
44 | def remove_options_tail (in_string): | ||
45 | from itertools import takewhile | ||
46 | return ' '.join(takewhile(lambda x: not x.startswith('-'), in_string.split(' '))) | ||
47 | |||
48 | EXTRA_OEMAKE += 'LD="${@remove_options_tail(d.getVar('LD'))}"' | ||
49 | |||
50 | EXTRA_OEMAKE += 'CC="${@remove_options_tail(d.getVar('CC'))}"' | ||
51 | |||
52 | do_compile() { | ||
53 | # Clear LDFLAGS to avoid the option -Wl recognize issue | ||
54 | oe_runmake bl31 | ||
55 | if ${BUILD_OPTEE}; then | ||
56 | oe_runmake clean BUILD_BASE=build-optee | ||
57 | oe_runmake BUILD_BASE=build-optee SPD=opteed bl31 | ||
58 | fi | ||
59 | } | ||
60 | |||
61 | do_install[noexec] = "1" | ||
62 | |||
63 | do_deploy() { | ||
64 | install -Dm 0644 ${S}/build/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}.bin | ||
65 | if ${BUILD_OPTEE}; then | ||
66 | install -m 0644 ${S}/build-optee/${ATF_PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${ATF_PLATFORM}.bin-optee | ||
67 | fi | ||
68 | } | ||
69 | addtask deploy after do_compile | ||
70 | |||
71 | PACKAGE_ARCH = "${MACHINE_SOCARCH}" | ||
72 | COMPATIBLE_MACHINE = "(mx8-generic-bsp)" | ||