]> code.ossystems Code Review - meta-freescale.git/commitdiff
imx-boot: allow for additional/different u-boot device-tree
authorMax Krummenacher <max.krummenacher@toradex.com>
Mon, 31 Aug 2020 14:28:57 +0000 (16:28 +0200)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 2 Oct 2020 12:37:37 +0000 (09:37 -0300)
With the current call to imx-mkimage and SOC_TARGET = "iMX8M" the u-boot
device tree file name is set to $(PLAT)-evk.dtb in iMX8M/soc.mak which
happens to match ${UBOOT_DTB_NAME} if building for an NXP machine.

Setting the dtbs environment variable to ${UBOOT_DTB_NAME} makes the build
succeed also for other machines.

In the hardcoded version $(dtbs) is an intermediate file and gets delete
as the last step of make. Thus for several make targets we have to redo
the copy step before each make invocation or the second one will fail as
the device tree file is then missing.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
(cherry picked from commit f607eb8734af83a3667bb4581c1b93307e06d337)

recipes-bsp/imx-mkimage/imx-boot_1.0.bb

index 4b6ef699c6c515a31b2e30e8285308749a73d891..a54b439d9e7afe18ddc00f7e3a69fb6c78479876 100644 (file)
@@ -126,20 +126,20 @@ compile_mx8x() {
     fi
 }
 do_compile() {
-    compile_${SOC_FAMILY}
     # mkimage for i.MX8
     # Copy TEE binary to SoC target folder to mkimage
     if ${DEPLOY_OPTEE}; then
         cp ${DEPLOY_DIR_IMAGE}/tee.bin ${BOOT_STAGING}
     fi
     for target in ${IMXBOOT_TARGETS}; do
+        compile_${SOC_FAMILY}
         if [ "$target" = "flash_linux_m4_no_v2x" ]; then
            # Special target build for i.MX 8DXL with V2X off
            bbnote "building ${SOC_TARGET} - ${REV_OPTION} V2X=NO ${target}"
-           make SOC=${SOC_TARGET} ${REV_OPTION} V2X=NO  flash_linux_m4
+           make SOC=${SOC_TARGET} ${REV_OPTION} V2X=NO dtbs=${UBOOT_DTB_NAME} flash_linux_m4
         else
            bbnote "building ${SOC_TARGET} - ${REV_OPTION} ${target}"
-           make SOC=${SOC_TARGET} ${REV_OPTION} ${target}
+           make SOC=${SOC_TARGET} ${REV_OPTION} dtbs=${UBOOT_DTB_NAME} ${target}
         fi
         if [ -e "${BOOT_STAGING}/flash.bin" ]; then
             cp ${BOOT_STAGING}/flash.bin ${S}/${BOOT_CONFIG_MACHINE}-${target}