diff options
| author | Rodrigo M. Duarte <rodrigo.duarte@ossystems.com.br> | 2026-10-28 16:26:25 -0300 |
|---|---|---|
| committer | Rodrigo M. Duarte <rodrigo.duarte@ossystems.com.br> | 2026-10-28 16:26:25 -0300 |
| commit | a70d4f595a8c1ab0fb7b5e942b00a576a01eaed3 (patch) | |
| tree | 498e1d9ad4ce7254b9c023159c789852e750655e | |
| parent | 5923d9a4201a1d5472b98b1406b58bfb9173b383 (diff) | |
| download | meta-freescale-a70d4f595a8c1ab0fb7b5e942b00a576a01eaed3.tar.gz | |
imx-atf: Build out of tree and from a clean directory
imx-atf built in the source tree, into ${S}/build, and do_compile never
cleaned it. The TF-A Makefile does not track build options such as SPD
or LOG_LEVEL, so after a PACKAGECONFIG change make finds every object
up to date and relinks nothing. do_unpack does not depend on
PACKAGECONFIG, so it does not rerun either, and do_deploy then ships
the bl31.bin from the previous configuration.
On imx8mq-evk this showed up after switching from the NXP BSP to the
mainline BSP, which drops the optee PACKAGECONFIG. The deployed BL31
was still the SPD=opteed build. Its imx8mq setup sets the BL32 entry to
BL32_BASE unconditionally, and the mainline boot container carries no
OP-TEE, so the board hung right after the "BL31: Built" banner. The
stale binary was reproduced byte for byte by building with SPD=opteed
and then without it in the same build directory.
Build into ${WORKDIR}/build through BUILD_BASE, clean it before every
compile, and deploy from there. The Makefile stays in ${S}, so
do_compile runs make with -C ${S}; the default do_compile would skip
make, as ${B} has no Makefile.
Tested on imx8mq-evk with the mainline BSP by building imx-atf with the
optee PACKAGECONFIG and then without it. Each build recompiles
everything, the optee bl31 carries the opteed service and the plain
one does not. With u-boot-fslc 2026.10, core-image-weston then boots on
an imx8mq-evk board through BL31, U-Boot and Linux to Weston.
Signed-off-by: Rodrigo M. Duarte <rodrigo.duarte@ossystems.com.br>
| -rw-r--r-- | recipes-bsp/imx-atf/imx-atf_2.14.bb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/recipes-bsp/imx-atf/imx-atf_2.14.bb b/recipes-bsp/imx-atf/imx-atf_2.14.bb index 407808b40..daf74d016 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.14.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.14.bb | |||
| @@ -29,6 +29,12 @@ ATF_SRC ?= "git://github.com/nxp-imx/imx-atf.git;protocol=https" | |||
| 29 | SRCBRANCH = "lf_v2.14" | 29 | SRCBRANCH = "lf_v2.14" |
| 30 | SRCREV = "af9eb2c1748ee3abc0ead7dc76e462f50c573036" | 30 | SRCREV = "af9eb2c1748ee3abc0ead7dc76e462f50c573036" |
| 31 | 31 | ||
| 32 | # Build out of tree and from scratch: the TF-A Makefile does not track | ||
| 33 | # build options such as SPD, so an incremental build after a | ||
| 34 | # PACKAGECONFIG change would relink nothing and deploy a stale bl31.bin. | ||
| 35 | B = "${WORKDIR}/build" | ||
| 36 | do_compile[cleandirs] = "${B}" | ||
| 37 | |||
| 32 | inherit deploy | 38 | inherit deploy |
| 33 | 39 | ||
| 34 | PACKAGECONFIG ??= "\ | 40 | PACKAGECONFIG ??= "\ |
| @@ -52,6 +58,7 @@ ATF_SYS_PWR_FULL_CTRL ?= "0" | |||
| 52 | EXTRA_OEMAKE += "\ | 58 | EXTRA_OEMAKE += "\ |
| 53 | CROSS_COMPILE=${TARGET_PREFIX} \ | 59 | CROSS_COMPILE=${TARGET_PREFIX} \ |
| 54 | PLAT=${ATF_PLATFORM} \ | 60 | PLAT=${ATF_PLATFORM} \ |
| 61 | BUILD_BASE=${B} \ | ||
| 55 | ${PACKAGECONFIG_CONFARGS} \ | 62 | ${PACKAGECONFIG_CONFARGS} \ |
| 56 | bl31 \ | 63 | bl31 \ |
| 57 | " | 64 | " |
| @@ -81,6 +88,11 @@ EXTRA_OEMAKE += 'SYS_PWR_FULL_CTRL=${ATF_SYS_PWR_FULL_CTRL}' | |||
| 81 | 88 | ||
| 82 | do_configure[noexec] = "1" | 89 | do_configure[noexec] = "1" |
| 83 | 90 | ||
| 91 | # The Makefile is in ${S}, while the build output goes to ${B}. | ||
| 92 | do_compile() { | ||
| 93 | oe_runmake -C ${S} | ||
| 94 | } | ||
| 95 | |||
| 84 | do_install[noexec] = "1" | 96 | do_install[noexec] = "1" |
| 85 | 97 | ||
| 86 | # The appends join without a leading space to build the contiguous bl31 | 98 | # The appends join without a leading space to build the contiguous bl31 |
| @@ -97,7 +109,7 @@ addtask deploy after do_compile | |||
| 97 | do_deploy() { | 109 | do_deploy() { |
| 98 | OUTPUT_FOLDER="${@bb.utils.contains('PACKAGECONFIG', 'debug', 'debug', 'release', d)}" | 110 | OUTPUT_FOLDER="${@bb.utils.contains('PACKAGECONFIG', 'debug', 'debug', 'release', d)}" |
| 99 | for deploydir in ${DEPLOYDIR} ${DEPLOYDIR}/imx-boot-tools; do | 111 | for deploydir in ${DEPLOYDIR} ${DEPLOYDIR}/imx-boot-tools; do |
| 100 | install -Dm 0644 ${S}/build/${ATF_PLATFORM}/${OUTPUT_FOLDER}/bl31.bin $deploydir/${ANNOTATED_NAME} | 112 | install -Dm 0644 ${B}/${ATF_PLATFORM}/${OUTPUT_FOLDER}/bl31.bin $deploydir/${ANNOTATED_NAME} |
| 101 | done | 113 | done |
| 102 | ln -sf ${ANNOTATED_NAME} ${DEPLOYDIR}/bl31.bin | 114 | ln -sf ${ANNOTATED_NAME} ${DEPLOYDIR}/bl31.bin |
| 103 | } | 115 | } |
