summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/imx-atf/imx-atf_2.10.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/imx-atf/imx-atf_2.10.bb')
-rw-r--r--recipes-bsp/imx-atf/imx-atf_2.10.bb80
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
3DESCRIPTION = "i.MX ARM Trusted Firmware"
4SECTION = "BSP"
5LICENSE = "BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;md5=550794465ba0ec5312d6919e203a55f9"
7
8PV .= "+git${SRCPV}"
9
10SRC_URI = "git://github.com/nxp-imx/imx-atf.git;protocol=https;branch=${SRCBRANCH}"
11SRCBRANCH = "lf_v2.10"
12SRCREV = "49143a1701d9ccd3239e3f95f3042897ca889ea8"
13
14S = "${WORKDIR}/git"
15
16inherit deploy
17
18ATF_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.
22ATF_BOOT_UART_BASE ?= ""
23
24EXTRA_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
30CFLAGS[unexport] = "1"
31LDFLAGS[unexport] = "1"
32AS[unexport] = "1"
33LD[unexport] = "1"
34
35# Baremetal, just need a compiler
36INHIBIT_DEFAULT_DEPS = "1"
37DEPENDS = "virtual/${HOST_PREFIX}gcc"
38
39# Bring in clang compiler if using clang as default
40DEPENDS:append:toolchain-clang = " clang-cross-${TARGET_ARCH}"
41
42BUILD_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.
47def remove_options_tail (in_string):
48 from itertools import takewhile
49 return ' '.join(takewhile(lambda x: not x.startswith('-'), in_string.split(' ')))
50
51EXTRA_OEMAKE += 'LD="${@remove_options_tail(d.getVar('LD'))}.bfd"'
52
53EXTRA_OEMAKE += 'CC="${@remove_options_tail(d.getVar('CC'))}"'
54
55# Set the UART to use during the boot.
56EXTRA_OEMAKE += 'IMX_BOOT_UART_BASE=${ATF_BOOT_UART_BASE}'
57
58do_configure[noexec] = "1"
59
60do_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
69do_install[noexec] = "1"
70
71addtask deploy after do_compile
72do_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
79PACKAGE_ARCH = "${MACHINE_ARCH}"
80COMPATIBLE_MACHINE = "(mx8-generic-bsp|mx9-generic-bsp)"