aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/imx-mkimage/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/imx-mkimage/files')
-rw-r--r--recipes-bsp/imx-mkimage/files/0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch75
-rw-r--r--recipes-bsp/imx-mkimage/files/0001-mkimage_fit_atf-fix-fit-generator-node-naming.patch166
2 files changed, 37 insertions, 204 deletions
diff --git a/recipes-bsp/imx-mkimage/files/0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch b/recipes-bsp/imx-mkimage/files/0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch
index a879208c..f182a2f1 100644
--- a/recipes-bsp/imx-mkimage/files/0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch
+++ b/recipes-bsp/imx-mkimage/files/0001-iMX8M-soc.mak-use-native-mkimage-from-sysroot.patch
@@ -1,6 +1,6 @@
-From a4af3747abd88247bf4498ec0cf67a4151e64d41 Mon Sep 17 00:00:00 2001
-From: Andrey Zhizhikin <andrey.z@gmail.com>
-Date: Thu, 21 Oct 2021 08:53:38 +0000
+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
mkimage tool is provided as a part of sysroot from Yocto build. Current
@@ -13,63 +13,65 @@ build.
Use it from the build sysroot, and do not pull the local version of it.
-Upstream-Status: Inappropriate [OE-specific]
+Reinjected the original patch from Andrey Zhizhikin <andrey.z@gmail.com>
-Signed-off-by: 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 4bfdc37..03b05f7 100644
---- a/iMX8M/soc.mak
-+++ b/iMX8M/soc.mak
-@@ -148,7 +148,7 @@ u-boot.itb: $(dtb)
+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)
- DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb) > u-boot.its
-- ./mkimage_uboot -E -p 0x3000 -f u-boot.its u-boot.itb
-+ mkimage -E -p 0x3000 -f u-boot.its u-boot.itb
+ ./$(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_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot.its u-boot.itb
++ mkimage -E -p $(FIT_EXTERNAL_POSITION) -f u-boot.its u-boot.itb
@rm -f u-boot.its $(dtb)
dtb_ddr3l = valddr3l.dtb
-@@ -160,7 +160,7 @@ u-boot-ddr3l.itb: $(dtb_ddr3l)
+@@ -172,7 +172,7 @@ u-boot-ddr3l.itb: $(dtb_ddr3l) $(supp_dt
./$(PAD_IMAGE) bl31.bin
- ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr3l)
- DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb_ddr3l) > u-boot-ddr3l.its
-- ./mkimage_uboot -E -p 0x3000 -f u-boot-ddr3l.its u-boot-ddr3l.itb
-+ mkimage -E -p 0x3000 -f u-boot-ddr3l.its u-boot-ddr3l.itb
+ ./$(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
+- ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr3l.its u-boot-ddr3l.itb
++ mkimage -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr3l.its u-boot-ddr3l.itb
@rm -f u-boot.its $(dtb_ddr3l)
dtb_ddr3l_evk = evkddr3l.dtb
-@@ -172,7 +172,7 @@ u-boot-ddr3l-evk.itb: $(dtb_ddr3l_evk)
+@@ -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)
- DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb_ddr3l_evk) > u-boot-ddr3l-evk.its
-- ./mkimage_uboot -E -p 0x3000 -f u-boot-ddr3l-evk.its u-boot-ddr3l-evk.itb
-+ mkimage -E -p 0x3000 -f u-boot-ddr3l-evk.its u-boot-ddr3l-evk.itb
+ ./$(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
+- ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr3l-evk.its u-boot-ddr3l-evk.itb
++ mkimage -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr3l-evk.its u-boot-ddr3l-evk.itb
@rm -f u-boot.its $(dtb_ddr3l_evk)
dtb_ddr4 = valddr4.dtb
-@@ -184,7 +184,7 @@ u-boot-ddr4.itb: $(dtb_ddr4)
+@@ -196,7 +196,7 @@ u-boot-ddr4.itb: $(dtb_ddr4) $(supp_dtbs
./$(PAD_IMAGE) bl31.bin
- ./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb_ddr4)
- DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb_ddr4) > u-boot-ddr4.its
-- ./mkimage_uboot -E -p 0x3000 -f u-boot-ddr4.its u-boot-ddr4.itb
-+ mkimage -E -p 0x3000 -f u-boot-ddr4.its u-boot-ddr4.itb
+ ./$(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
+- ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr4.its u-boot-ddr4.itb
++ mkimage -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr4.its u-boot-ddr4.itb
@rm -f u-boot.its $(dtb_ddr4)
dtb_ddr4_evk = evkddr4.dtb
-@@ -196,7 +196,7 @@ u-boot-ddr4-evk.itb: $(dtb_ddr4_evk)
+@@ -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)
- DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb_ddr4_evk) > u-boot-ddr4-evk.its
-- ./mkimage_uboot -E -p 0x3000 -f u-boot-ddr4-evk.its u-boot-ddr4-evk.itb
-+ mkimage -E -p 0x3000 -f u-boot-ddr4-evk.its u-boot-ddr4-evk.itb
+ ./$(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
+- ./mkimage_uboot -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr4-evk.its u-boot-ddr4-evk.itb
++ mkimage -E -p $(FIT_EXTERNAL_POSITION) -f u-boot-ddr4-evk.its u-boot-ddr4-evk.itb
@rm -f u-boot.its $(dtb_ddr4_evk)
ifeq ($(HDMI),yes)
-@@ -312,7 +312,6 @@ nightly :
+@@ -358,7 +358,6 @@ nightly :
@$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/fsl-$(PLAT)-evk.dtb -O fsl-$(PLAT)-evk.dtb
@$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/signed_hdmi_imx8m.bin -O signed_hdmi_imx8m.bin
@$(WGET) -q $(SERVER)/$(DIR)/$(FW_DIR)/signed_dp_imx8m.bin -O signed_dp_imx8m.bin
@@ -77,6 +79,3 @@ index 4bfdc37..03b05f7 100644
archive :
git ls-files --others --exclude-standard -z | xargs -0 tar rvf $(ARCHIVE_PATH)/$(ARCHIVE_NAME)
---
-2.17.1
-
diff --git a/recipes-bsp/imx-mkimage/files/0001-mkimage_fit_atf-fix-fit-generator-node-naming.patch b/recipes-bsp/imx-mkimage/files/0001-mkimage_fit_atf-fix-fit-generator-node-naming.patch
deleted file mode 100644
index 3c2842af..00000000
--- a/recipes-bsp/imx-mkimage/files/0001-mkimage_fit_atf-fix-fit-generator-node-naming.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-From 9cf936493388897379f33b511ec869c6fa5409ce Mon Sep 17 00:00:00 2001
-From: Andrey Zhizhikin <andrey.z@gmail.com>
-Date: Thu, 22 Apr 2021 12:20:28 +0000
-Subject: [PATCH] mkimage_fit_atf: fix fit generator node naming
-
-Since upstream commit 79af75f777 ("fit: Don't allow verification of images
-with @ nodes") [1], unit addresses on the nodes are prohibited and nodes
-that do contain those addresses are ignored during the ITS parsing. This
-is done in an effort to cover the CVE-2021-27138, where nodes with unit
-addresses can be mis-interpreted by libfdt.
-
-Correct FIT generator script and replace nodes with unit addresses to
-plain node names with "-" instead of "@" to create a unique naming.
-
-In addition, extend sections which contains "firmware" in their types
-with "os" parameter to conform to the latest FIT specification.
-
-Indicate that load and entry addresses are covered by one 32-bit value
-by adding "address-cells" in the root node of the generated ITS.
-
-Upstream-Status: Inappropriate [script is imx-boot specific]
-Link: [1] https://github.com/u-boot/u-boot/commit/79af75f7776fc20b0d7eb6afe1e27c00fdb4b9b4
-Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
-Cc: Tom Hochstein <tom.hochstein@nxp.com>
----
- iMX8M/mkimage_fit_atf.sh | 40 ++++++++++++++++++++++------------------
- 1 file changed, 22 insertions(+), 18 deletions(-)
-
-diff --git a/iMX8M/mkimage_fit_atf.sh b/iMX8M/mkimage_fit_atf.sh
-index 95749b1..10903ea 100755
---- a/iMX8M/mkimage_fit_atf.sh
-+++ b/iMX8M/mkimage_fit_atf.sh
-@@ -23,7 +23,7 @@ else
- fi
-
- BL32="tee.bin"
--LOADABLES="\"atf@1\""
-+LOADABLES="\"atf-1\""
-
- if [ ! -f $BL32 ]; then
- BL32=/dev/null
-@@ -31,7 +31,7 @@ else
- echo "Building with TEE support, make sure your bl31 is compiled with spd. If you do not want tee, please delete tee.bin" >&2
- echo "tee.bin size: " >&2
- ls -lct tee.bin | awk '{print $5}' >&2
-- LOADABLES="$LOADABLES, \"tee@1\""
-+ LOADABLES="$LOADABLES, \"tee-1\""
- fi
-
- BL33="u-boot-nodtb.bin"
-@@ -41,7 +41,7 @@ if [ ! -f $DEK_BLOB ]; then
- DEK_BLOB=/dev/null
- else
- echo "Building with encrypted boot support, make sure to replace DEK Blob in final image." >&2
-- LOADABLES="\"dek_blob@1\", $LOADABLES"
-+ LOADABLES="\"dek_blob-1\", $LOADABLES"
- fi
-
- if [ ! -f $BL33 ]; then
-@@ -64,10 +64,12 @@ cat << __HEADER_EOF
-
- / {
- description = "Configuration to load ATF before U-Boot";
-+ #address-cells = <1>;
-
- images {
-- uboot@1 {
-+ uboot-1 {
- description = "U-Boot (64-bit)";
-+ os = "u-boot";
- data = /incbin/("$BL33");
- type = "standalone";
- arch = "arm64";
-@@ -80,7 +82,7 @@ cnt=1
- for dtname in $*
- do
- cat << __FDT_IMAGE_EOF
-- fdt@$cnt {
-+ fdt-$cnt {
- description = "$(basename $dtname .dtb)";
- data = /incbin/("$dtname");
- type = "flat_dt";
-@@ -91,8 +93,9 @@ cnt=$((cnt+1))
- done
-
- cat << __HEADER_EOF
-- atf@1 {
-+ atf-1 {
- description = "ARM Trusted Firmware";
-+ os = "arm-trusted-firmware";
- data = /incbin/("$BL31");
- type = "firmware";
- arch = "arm64";
-@@ -104,8 +107,9 @@ __HEADER_EOF
-
- if [ -f $BL32 ]; then
- cat << __HEADER_EOF
-- tee@1 {
-+ tee-1 {
- description = "TEE firmware";
-+ os = "op-tee-firmware";
- data = /incbin/("$BL32");
- type = "firmware";
- arch = "arm64";
-@@ -118,7 +122,7 @@ fi
-
- if [ -f $DEK_BLOB ]; then
- cat << __HEADER_EOF
-- dek_blob@1 {
-+ dek_blob-1 {
- description = "dek_blob";
- data = /incbin/("$DEK_BLOB");
- type = "script";
-@@ -131,7 +135,7 @@ fi
- cat << __CONF_HEADER_EOF
- };
- configurations {
-- default = "config@1";
-+ default = "config-1";
-
- __CONF_HEADER_EOF
-
-@@ -141,31 +145,31 @@ do
- if [ -f $BL32 ]; then
- if [ $ROLLBACK_INDEX_IN_FIT ]; then
- cat << __CONF_SECTION_EOF
-- config@$cnt {
-+ config-$cnt {
- description = "$(basename $dtname .dtb)";
-- firmware = "uboot@1";
-+ firmware = "uboot-1";
- loadables = $LOADABLES;
-- fdt = "fdt@$cnt";
-+ fdt = "fdt-$cnt";
- rbindex = "$ROLLBACK_INDEX_IN_FIT";
- };
- __CONF_SECTION_EOF
- else
- cat << __CONF_SECTION_EOF
-- config@$cnt {
-+ config-$cnt {
- description = "$(basename $dtname .dtb)";
-- firmware = "uboot@1";
-+ firmware = "uboot-1";
- loadables = $LOADABLES;
-- fdt = "fdt@$cnt";
-+ fdt = "fdt-$cnt";
- };
- __CONF_SECTION_EOF
- fi
- else
- cat << __CONF_SECTION1_EOF
-- config@$cnt {
-+ config-$cnt {
- description = "$(basename $dtname .dtb)";
-- firmware = "uboot@1";
-+ firmware = "uboot-1";
- loadables = $LOADABLES;
-- fdt = "fdt@$cnt";
-+ fdt = "fdt-$cnt";
- };
- __CONF_SECTION1_EOF
- fi
---
-2.17.1
-