From c2c933a93af06c6e9c02919630247d65f832173b Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 27 Mar 2025 17:02:54 +0100 Subject: [PATCH] imx-atf,imx-boot: refresh ccimx8m patches for release lf-6.6.52-2.2.0 https://onedigi.atlassian.net/browse/DEL-9537 https://onedigi.atlassian.net/browse/DEL-9541 Signed-off-by: Javier Viguera --- ...fine-UART1-as-console-for-boot-stage.patch | 4 +- ...fine-UART1-as-console-for-boot-stage.patch | 4 +- ...8m-soc.mak-preserve-dtbs-after-build.patch | 48 ------------------ ...pture-commands-output-into-a-log-fil.patch | 12 ++--- ...-imx8m-print_fit_hab-follow-symlinks.patch | 49 +++++++++++++++++++ .../imx-mkimage/imx-boot_1.0.bbappend | 2 +- 6 files changed, 59 insertions(+), 60 deletions(-) delete mode 100644 meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch create mode 100644 meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0003-imx8m-print_fit_hab-follow-symlinks.patch diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-imx8mm-Define-UART1-as-console-for-boot-stage.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-imx8mm-Define-UART1-as-console-for-boot-stage.patch index 708ec7821..a65a1d6c4 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-imx8mm-Define-UART1-as-console-for-boot-stage.patch +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0001-imx8mm-Define-UART1-as-console-for-boot-stage.patch @@ -13,10 +13,10 @@ Signed-off-by: Gabriel Valcazar 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/imx/imx8m/imx8mm/platform.mk b/plat/imx/imx8m/imx8mm/platform.mk -index 0a8f12a26..55f83f462 100644 +index 41fc3507f..1de30f40f 100644 --- a/plat/imx/imx8m/imx8mm/platform.mk +++ b/plat/imx/imx8m/imx8mm/platform.mk -@@ -159,7 +159,7 @@ $(eval $(call add_define,BL32_BASE)) +@@ -172,7 +172,7 @@ $(eval $(call add_define,BL32_BASE)) BL32_SIZE ?= 0x2000000 $(eval $(call add_define,BL32_SIZE)) diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0003-imx8mn-Define-UART1-as-console-for-boot-stage.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0003-imx8mn-Define-UART1-as-console-for-boot-stage.patch index dddee0012..ca6f033ae 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0003-imx8mn-Define-UART1-as-console-for-boot-stage.patch +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-atf/imx-atf/0003-imx8mn-Define-UART1-as-console-for-boot-stage.patch @@ -27,10 +27,10 @@ index 312eb32d1..9a82be010 100644 /* memory region */ diff --git a/plat/imx/imx8m/imx8mn/platform.mk b/plat/imx/imx8m/imx8mn/platform.mk -index da4e40aa3..0e38cfa0b 100644 +index 84519426c..964ed9e5c 100644 --- a/plat/imx/imx8m/imx8mn/platform.mk +++ b/plat/imx/imx8m/imx8mn/platform.mk -@@ -65,7 +65,7 @@ $(eval $(call add_define,BL32_BASE)) +@@ -77,7 +77,7 @@ $(eval $(call add_define,BL32_BASE)) BL32_SIZE ?= 0x2000000 $(eval $(call add_define,BL32_SIZE)) diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch deleted file mode 100644 index c65c7859d..000000000 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0001-imx8m-soc.mak-preserve-dtbs-after-build.patch +++ /dev/null @@ -1,48 +0,0 @@ -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. - -Upstream-Status: Inappropriate [DEY specific] - -Signed-off-by: Gonzalo Ruiz -Signed-off-by: Gabriel Valcazar -Signed-off-by: Javier Viguera ---- - iMX8M/soc.mak | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak -index 6751759..5a96614 100644 ---- a/iMX8M/soc.mak -+++ b/iMX8M/soc.mak -@@ -161,7 +161,7 @@ u-boot.itb: $(dtb) $(supp_dtbs) - ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs) - BL32=$(TEE) DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ../$(SOC_DIR)/mkimage_fit_atf.sh $(dtb) $(supp_dtbs) > u-boot.its - mkimage -E -p $(FIT_EXTERNAL_POSITION) -f u-boot.its u-boot.itb -- @rm -f u-boot.its $(dtb) -+ @rm -f u-boot.its - - dtb_ddr3l = valddr3l.dtb - $(dtb_ddr3l): -@@ -329,7 +329,8 @@ print_fit_hab: u-boot-nodtb.bin bl31.bin $(dtb) $(supp_dtbs) - ./$(PAD_IMAGE) bl31.bin - ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs) - FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) $(supp_dtbs) -- @rm -f $(dtb) -+ ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) -+ TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) - - print_fit_hab_ddr4: u-boot-nodtb.bin bl31.bin $(dtb_ddr4_evk) $(supp_dtbs) - ./$(PAD_IMAGE) $(TEE) diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch index 0f58f0c42..c519ee55f 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch @@ -13,7 +13,7 @@ Signed-off-by: Javier Viguera 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak -index 5a96614..5901d5e 100644 +index f1b37a4f425a..ffd70af8ac7d 100644 --- a/iMX8M/soc.mak +++ b/iMX8M/soc.mak @@ -1,5 +1,6 @@ @@ -32,7 +32,7 @@ index 5a96614..5901d5e 100644 flash_evk_no_hdmi_dual_bootloader: $(MKIMG) u-boot-spl-ddr.bin u-boot.itb ./mkimage_imx8 -version $(VERSION) -fit -loader u-boot-spl-ddr.bin $(SPL_LOAD_ADDR) -out $(OUTIMG) -@@ -325,12 +326,12 @@ flash_dp_spl_uboot: flash_dp_evk +@@ -325,10 +326,10 @@ flash_dp_spl_uboot: flash_dp_evk flash_spl_uboot: flash_evk_no_hdmi print_fit_hab: u-boot-nodtb.bin bl31.bin $(dtb) $(supp_dtbs) @@ -40,10 +40,8 @@ index 5a96614..5901d5e 100644 + ./$(PAD_IMAGE) $(TEE) 2>&1 | tee $(MKIMAGE_LOG) ./$(PAD_IMAGE) bl31.bin ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs) - FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) $(supp_dtbs) - ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) -- TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) -+ { echo $@; TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) 2>&1; } | tee -a $(MKIMAGE_LOG) +- FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) $(supp_dtbs) ++ { echo $@; FIT_DATA_POS=$(FIT_EXTERNAL_POSITION) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) VERSION=$(VERSION) ../$(SOC_DIR)/print_fit_hab.sh $(PRINT_FIT_HAB_OFFSET) $(dtb) $(supp_dtbs) 2>&1; } | tee -a $(MKIMAGE_LOG) + @rm -f $(dtb) print_fit_hab_ddr4: u-boot-nodtb.bin bl31.bin $(dtb_ddr4_evk) $(supp_dtbs) - ./$(PAD_IMAGE) $(TEE) diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0003-imx8m-print_fit_hab-follow-symlinks.patch b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0003-imx8m-print_fit_hab-follow-symlinks.patch new file mode 100644 index 000000000..7f3a2c7f2 --- /dev/null +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/files/0003-imx8m-print_fit_hab-follow-symlinks.patch @@ -0,0 +1,49 @@ +From: Javier Viguera +Date: Tue, 5 Dec 2023 18:10:43 +0100 +Subject: [PATCH] imx8m: print_fit_hab: follow symlinks + +Upstream-Status: Inappropriate [DEY specific] + +Signed-off-by: Javier Viguera +--- + iMX8M/print_fit_hab.sh | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/iMX8M/print_fit_hab.sh b/iMX8M/print_fit_hab.sh +index 06fca5f88554..a65f78c07a0f 100755 +--- a/iMX8M/print_fit_hab.sh ++++ b/iMX8M/print_fit_hab.sh +@@ -33,7 +33,7 @@ else + let uboot_sign_off=$((fit_off - 0x8000 - ivt_off + $FIT_DATA_POS)) + fi + +-let uboot_size=$(stat --printf="%s" $BL33) ++let uboot_size=$(stat -L --printf="%s" $BL33) + let uboot_load_addr=0x40200000 + + let last_sign_off=$(((uboot_sign_off + uboot_size + 3) & ~3)) +@@ -50,7 +50,7 @@ for dtname in $* + do + if [ ${cnt} != 0 ] + then +- let fdt${cnt}_size=$(stat --printf="%s" $dtname) ++ let fdt${cnt}_size=$(stat -L --printf="%s" $dtname) + + let fdt${cnt}_sign_off=$((last_sign_off)) + let fdt${cnt}_load_addr=$((last_load_addr)) +@@ -71,13 +71,13 @@ done + + let atf_sign_off=$((last_sign_off)) + let atf_load_addr=$ATF_LOAD_ADDR +-let atf_size=$(stat --printf="%s" $BL31) ++let atf_size=$(stat -L --printf="%s" $BL31) + + if [ ! -f $BL32 ]; then + let tee_size=0x0 + let tee_sign_off=$((atf_sign_off + atf_size)) + else +- let tee_size=$(stat --printf="%s" $BL32) ++ let tee_size=$(stat -L --printf="%s" $BL32) + + let tee_sign_off=$(((atf_sign_off + atf_size + 3) & ~3)) + let tee_load_addr=$TEE_LOAD_ADDR diff --git a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend index e31bfd85d..67b8e2981 100644 --- a/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend +++ b/meta-digi-arm/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_1.0.bbappend @@ -3,8 +3,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI:append:ccimx8m = " \ - file://0001-imx8m-soc.mak-preserve-dtbs-after-build.patch \ file://0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch \ + file://0003-imx8m-print_fit_hab-follow-symlinks.patch \ " SRC_URI:append:ccimx8x = " \ file://0001-iMX8QX-soc.mak-capture-commands-output-into-a-log-fi.patch \