imx-boot: add ccimx95 support and rework patch handling

Add support for the ccimx95 and reorganize the recipe so that all machine
patches are applied for the DEY distribution, regardless of the build
target.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2025-09-26 15:17:00 +02:00
parent 1e225bb3f9
commit 87673b6299
8 changed files with 96 additions and 23 deletions

View File

@ -1,3 +1,4 @@
From 3e0f78a4efeac4ea0651ac763099d780447a18b4 Mon Sep 17 00:00:00 2001
From: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Date: Wed, 19 Jul 2023 18:34:32 +0300
Subject: [PATCH] iMX8M: soc.mak: use native mkimage from sysroot
@ -17,13 +18,14 @@ Reinjected the original patch from Andrey Zhizhikin <andrey.z@gmail.com>
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
---
iMX8M/soc.mak | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak
index e7c762b748a1..f1b37a4f425a 100644
--- a/iMX8M/soc.mak
+++ b/iMX8M/soc.mak
Index: git/iMX8M/soc.mak
===================================================================
--- git.orig/iMX8M/soc.mak
+++ git/iMX8M/soc.mak
@@ -160,7 +160,7 @@ u-boot.itb: $(dtb) $(supp_dtbs)
./$(PAD_IMAGE) bl31.bin
./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb) $(supp_dtbs)
@ -33,7 +35,7 @@ index e7c762b748a1..f1b37a4f425a 100644
@rm -f u-boot.its $(dtb)
dtb_ddr3l = valddr3l.dtb
@@ -172,7 +172,7 @@ u-boot-ddr3l.itb: $(dtb_ddr3l) $(supp_dtbs)
@@ -172,7 +172,7 @@ u-boot-ddr3l.itb: $(dtb_ddr3l) $(supp_dt
./$(PAD_IMAGE) bl31.bin
./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr3l) $(supp_dtbs)
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_ddr3l) $(supp_dtbs) > u-boot-ddr3l.its
@ -42,7 +44,7 @@ index e7c762b748a1..f1b37a4f425a 100644
@rm -f u-boot.its $(dtb_ddr3l)
dtb_ddr3l_evk = evkddr3l.dtb
@@ -184,7 +184,7 @@ u-boot-ddr3l-evk.itb: $(dtb_ddr3l_evk) $(supp_dtbs)
@@ -184,7 +184,7 @@ u-boot-ddr3l-evk.itb: $(dtb_ddr3l_evk) $
./$(PAD_IMAGE) bl31.bin
./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr3l_evk) $(supp_dtbs)
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_ddr3l_evk) $(supp_dtbs) > u-boot-ddr3l-evk.its
@ -51,7 +53,7 @@ index e7c762b748a1..f1b37a4f425a 100644
@rm -f u-boot.its $(dtb_ddr3l_evk)
dtb_ddr4 = valddr4.dtb
@@ -196,7 +196,7 @@ u-boot-ddr4.itb: $(dtb_ddr4) $(supp_dtbs)
@@ -196,7 +196,7 @@ u-boot-ddr4.itb: $(dtb_ddr4) $(supp_dtbs
./$(PAD_IMAGE) bl31.bin
./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr4) $(supp_dtbs)
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_ddr4) $(supp_dtbs) > u-boot-ddr4.its
@ -60,7 +62,7 @@ index e7c762b748a1..f1b37a4f425a 100644
@rm -f u-boot.its $(dtb_ddr4)
dtb_ddr4_evk = evkddr4.dtb
@@ -208,7 +208,7 @@ u-boot-ddr4-evk.itb: $(dtb_ddr4_evk) $(supp_dtbs)
@@ -208,7 +208,7 @@ u-boot-ddr4-evk.itb: $(dtb_ddr4_evk) $(s
./$(PAD_IMAGE) bl31.bin
./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr4_evk) $(supp_dtbs)
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_ddr4_evk) $(supp_dtbs) > u-boot-ddr4-evk.its

View File

@ -13,7 +13,7 @@ Signed-off-by: Javier Viguera <javier.viguera@digi.com>
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak
index f1b37a4f425a..ffd70af8ac7d 100644
index e7c762b748a1..3b0b6b603cd5 100644
--- a/iMX8M/soc.mak
+++ b/iMX8M/soc.mak
@@ -1,5 +1,6 @@

View File

@ -12,7 +12,7 @@ Signed-off-by: Javier Viguera <javier.viguera@digi.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak
index ffd70af8ac7d..7ab1ea099894 100644
index 3b0b6b603cd5..aea1dbef3f85 100644
--- a/iMX8M/soc.mak
+++ b/iMX8M/soc.mak
@@ -35,7 +35,7 @@ PLAT = imx8mm

View File

@ -0,0 +1,60 @@
From: Javier Viguera <javier.viguera@digi.com>
Date: Wed, 24 Sep 2025 18:27:36 +0200
Subject: [PATCH] imx95: soc.mak: capture commands output into a log file
This is later used to get the needed information for the signing of the
boot artifacts.
Upstream-Status: Inappropriate [DEY specific]
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
---
iMX95/soc.mak | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/iMX95/soc.mak b/iMX95/soc.mak
index a3eaa2e93b98..a7cf6c4363a3 100644
--- a/iMX95/soc.mak
+++ b/iMX95/soc.mak
@@ -1,4 +1,5 @@
MKIMG = ../mkimage_imx8
+MKIMAGE_LOG = "mkimage-$(firstword $(MAKECMDGOALS)).log"
CC ?= gcc
REV ?= A1
@@ -182,7 +183,7 @@ define append_container
@flashbin_size=`wc -c flash.bin | awk '{print $$1}'`; \
psize=$$((0x400 * $(2))); \
pad_cnt=$$(((flashbin_size + psize - 1) / psize)); \
- echo "append $(1) at $$((pad_cnt * $(2))) KB, psize=$$psize"; \
+ echo "append $(1) at $$((pad_cnt * $(2))) KB, psize=$$psize" | tee -a $(MKIMAGE_LOG); \
dd if=$(1) of=flash.bin bs=1K seek=$$((pad_cnt * $(2)));
endef
@@ -271,7 +272,7 @@ u-boot-atf-container.img: bl31.bin u-boot-hash.bin
-ap bl31.bin a55 $(ATF_LOAD_ADDR) \
-ap u-boot-hash.bin a55 $(UBOOT_LOAD_ADDR) \
-out u-boot-atf-container.img; \
- fi
+ fi | tee $(MKIMAGE_LOG)
u-boot-atf-container-spinand.img: bl31.bin u-boot-hash.bin
if [ -f $(TEE) ]; then \
@@ -335,7 +336,7 @@ flash_lpboot_flexspi_xip: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) $(OEI_IMG_M33)
flash_a55: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) u-boot-atf-container.img $(SPL_A55_IMG) $(OEI_IMG_M33) $(OEI_M33_DDR_IMG)
./$(MKIMG) -soc IMX9 -cntr_version $(CTNR_VERSION) $(MMC_FAST_HASH) -append $(AHAB_IMG) -c $(OEI_OPT_M33) -msel $(MSEL) \
-m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) \
- -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) $(V2X_DUMMY) -out flash.bin
+ -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) $(V2X_DUMMY) -out flash.bin | tee -a $(MKIMAGE_LOG)
$(call append_container,u-boot-atf-container.img,1)
flash_a55_no_ahabfw: $(MKIMG) $(MCU_IMG) u-boot-atf-container.img $(SPL_A55_IMG) $(OEI_IMG_M33)
@@ -386,7 +387,7 @@ flash_all: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) $(M7_IMG) u-boot-atf-container.img $(
./$(MKIMG) -soc IMX9 -cntr_version $(CTNR_VERSION) $(MMC_FAST_HASH) -append $(AHAB_IMG) -c $(OEI_OPT_M33) -msel $(MSEL) \
-m33 $(MCU_IMG) 0 $(MCU_TCM_ADDR) \
-m7 $(M7_IMG) 0 $(M7_TCM_ADDR) $(M7_TCM_ADDR_ALIAS) \
- -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) $(V2X_DUMMY) -out flash.bin
+ -ap $(SPL_A55_IMG) a55 $(SPL_LOAD_ADDR_M33_VIEW) $(V2X_DUMMY) -out flash.bin | tee -a $(MKIMAGE_LOG)
$(call append_container,u-boot-atf-container.img,1)
flash_all_ddr: $(MKIMG) $(AHAB_IMG) $(MCU_IMG) $(M7_IMG) u-boot-atf-container.img $(SPL_A55_IMG) $(OEI_IMG_M33)

View File

@ -2,28 +2,32 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI:append:ccimx8m = " \
DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-tools-native', '', d)}"
SRC_URI:append:dey = " \
file://0001-iMX8QX-soc.mak-capture-commands-output-into-a-log-fi.patch \
file://0002-imx8m-soc.mak-capture-commands-output-into-a-log-fil.patch \
file://0003-imx8m-print_fit_hab-follow-symlinks.patch \
file://0004-imx8mm-adjust-TEE_LOAD_ADDR-for-ccimx8mm.patch \
file://0005-imx93-soc.mak-capture-commands-output-into-a-log-fil.patch \
file://0006-imx93-soc.mak-add-makefile-target-to-build-A0-revisi.patch \
file://0007-imx91-soc.mak-capture-commands-output-into-a-log-fil.patch \
file://0008-imx95-soc.mak-capture-commands-output-into-a-log-fil.patch \
"
SRC_URI:append:ccimx8x = " \
file://0001-iMX8QX-soc.mak-capture-commands-output-into-a-log-fi.patch \
"
SRC_URI:append:ccimx91 = " \
file://0001-imx91-soc.mak-capture-commands-output-into-a-log-fil.patch \
"
SRC_URI:append:ccimx93 = " \
file://0001-imx93-soc.mak-capture-commands-output-into-a-log-fil.patch \
file://0002-imx93-soc.mak-add-makefile-target-to-build-A0-revisi.patch \
"
DEPENDS += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'trustfence-sign-tools-native', '', d)}"
# Do not tag imx-boot
UUU_BOOTLOADER:mx8-generic-bsp = ""
UUU_BOOTLOADER:mx9-generic-bsp = ""
IMX_CORTEXM_DEMOS = ""
IMX_CORTEXM_DEMOS:ccimx95 = "imx-m7-demos:do_deploy"
do_compile[depends] += "${IMX_CORTEXM_DEMOS}"
compile_mx95:append:ccimx95() {
cp ${DEPLOY_DIR_IMAGE}/mcore-demos/imx95-19x19-evk_m7_TCM_power_mode_switch.bin ${BOOT_STAGING}/m7_image.bin
}
# Revert compile_mx8m() to how it was in kirkstone branch of meta-freescale,
# otherwise, a dead symlink is created in place of the dtb
compile_mx8m() {
@ -154,6 +158,13 @@ do_deploy:append:ccimx93() {
fi
}
do_deploy:append:ccimx95() {
generate_symlinks
for target in ${IMXBOOT_TARGETS}; do
install -m 0644 ${BOOT_STAGING}/mkimage-${target}.log ${DEPLOYDIR}/${BOOT_TOOLS}
done
}
do_deploy:ccimx8x () {
deploy_${SOC_FAMILY}
# copy tee.bin to deploy path