From 4db64974c1afebe472ca4055fdd7664b58fb77f4 Mon Sep 17 00:00:00 2001 From: Gonzalo Ruiz Date: Wed, 23 Sep 2020 13:44:19 +0200 Subject: [PATCH] imx-mkimage: ccimx8mn: preserve dtb file after running make With the latest version of imx-mkimage, the original dtb file is being removed at the end of the build. Add a patch to preserve it and be able to run several builds during the same compile run, like we do for imx-boot signing. Signed-off-by: Gonzalo Ruiz --- ...8m-soc.mak-preserve-dtbs-after-build.patch | 42 +++++++++++++++++++ .../imx-mkimage/imx-boot_1.0.bbappend | 2 + .../imx-mkimage/imx-mkimage_git.bb | 2 + 3 files changed, 46 insertions(+) create mode 100644 meta-digi-arm/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch b/meta-digi-arm/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch new file mode 100644 index 000000000..7c4fb2c82 --- /dev/null +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch @@ -0,0 +1,42 @@ +From: Gonzalo Ruiz +Date: Wed, 23 Sep 2020 10:15:08 +0200 +Subject: [PATCH] imx8m: soc.mak: preserve dtbs after build + +On commit ab433440269bbd5383b47ee60957e9906cda0b3b a dtb preprocess +was introduced to have compatibility with old U-Boots. + +As part of those changes, the content of variable $(dtbs) was deleted +at the end of the build. + +Since we added the dtbs variable as an argument, building is causing the +original dtb file to be removed, and a second build is failing since the +file pointed at by the dtbs variable does no longer exist. + +Remove the file removal to avoid this. + +Signed-off-by: Gonzalo Ruiz +--- + iMX8M/soc.mak | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak +index b7b3986..fa84c6a 100644 +--- a/iMX8M/soc.mak ++++ b/iMX8M/soc.mak +@@ -143,7 +143,7 @@ u-boot.itb: $(dtbs) + ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtbs) + DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtbs) > u-boot.its + ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot.itb +- @rm -f u-boot.its $(dtbs) ++ @rm -f u-boot.its + + dtbs_ddr3l = valddr3l.dtb + $(dtbs_ddr3l): +@@ -256,7 +256,6 @@ print_fit_hab: u-boot-nodtb.bin bl31.bin $(dtbs) + ./$(PAD_IMAGE) bl31.bin + ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtbs) + TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ./print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtbs) +- @rm -f $(dtbs) + + print_fit_hab_ddr4: u-boot-nodtb.bin bl31.bin $(dtbs_ddr4_evk) + ./$(PAD_IMAGE) tee.bin diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend index 918378d8d..53440c60c 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend @@ -1,6 +1,8 @@ # Copyright 2019,2020 Digi International, Inc. inherit boot-artifacts +SRC_URI_append_ccimx8mn = " file://0001-imx8m-soc.mak-preserve-dtbs-after-build.patch" + IMX_EXTRA_FIRMWARE_ccimx8x = "digi-sc-firmware imx-seco" DEPENDS_append_ccimx8x = " coreutils-native" diff --git a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-mkimage_git.bb b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-mkimage_git.bb index 511bb6195..1b80cfd32 100644 --- a/meta-digi-arm/recipes-bsp/imx-mkimage/imx-mkimage_git.bb +++ b/meta-digi-arm/recipes-bsp/imx-mkimage/imx-mkimage_git.bb @@ -8,6 +8,8 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" SECTION = "BSP" +SRC_URI_append_ccimx8mn = " file://0001-imx8m-soc.mak-preserve-dtbs-after-build.patch" + # Beware: applied last to first DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ -fdebug-prefix-map=${STAGING_DIR_HOST}= \