Skip to contentSkip to conversation

ARM: imx: imx8mn-evk: generate a single bootable flash.bin

PATCH Superseded Heiko Thiery 5 participants 11 messages Feb 24, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: imx: imx8mn-evk: generate a single bootable flash.bin

To have a flash.bin file that also contains the U-Boot and TF-A/ATF create this like already done for other imx8 boards.

---
 arch/arm/dts/imx8mn-evk-u-boot.dtsi | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/dts/imx8mn-evk-u-boot.dtsi +18 -1
index 3db46d4cbc..d1427941eb 100644
@@ -58,7 +58,9 @@
 	};
 
 
-	flash {
+	spl {
+		filename = "spl.bin";
+
 		mkimage {
 			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
 
@@ -125,4 +127,19 @@
 			};
 		};
 	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			offset = <0x0>;
+			filename = "spl.bin";
+		};
+
+		uboot: blob-ext@2 {
+			offset = <0x58000>;
+			filename = "u-boot.itb";
+		};
+	};
 };
Signature · 1 line
2.30.2
#1 lore raw

PATCH 2/2 ARM: imx: imx8mn-evk: use one common u-boot.dtsi for the evk boards

To have only one place to describe the binman images us the imx8mn-u-boot.dtsi. To have support for different DDR firmwares this nodes are included dependent on the used DDR config option.

---
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 125 +-----------------
 arch/arm/dts/imx8mn-evk-u-boot.dtsi      | 120 +----------------
 arch/arm/dts/imx8mn-u-boot.dtsi          | 156 +++++++++++++++++++++++
 3 files changed, 159 insertions(+), 242 deletions(-)
 create mode 100644 arch/arm/dts/imx8mn-u-boot.dtsi
arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +2 -123
index 2e39790766..ce06e7d797 100644
@@ -3,11 +3,9 @@
  * Copyright 2019 NXP
  */
 
-/ {
-	binman: binman {
-		multiple-images;
-	};
+#include "imx8mn-u-boot.dtsi"
 
+/ {
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -123,122 +121,3 @@
 &wdog1 {
 	u-boot,dm-spl;
 };
-
-&binman {
-	 u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "ddr4_imem_1d_201810.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "ddr4_dmem_1d_201810.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "ddr4_imem_2d_201810.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "ddr4_dmem_2d_201810.bin";
-			size = <0x4000>;
-		};
-	};
-
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x960000>;
-					entry = <0x960000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			offset = <0x0>;
-			filename = "spl.bin";
-		};
-
-		uboot: blob-ext@2 {
-			offset = <0x58000>;
-			filename = "u-boot.itb";
-		};
-	};
-};
arch/arm/dts/imx8mn-evk-u-boot.dtsi +1 -119

129 lines not on this page · raw message

arch/arm/dts/imx8mn-u-boot.dtsi new file +156 -0

156 lines not on this page · raw message

Signature · 1 line
2.30.2
Reviewed-by Peng Fan on v1 1/2
#7 lore raw
In reply to Heiko Thiery
Quoted 7 lines

Subject: [PATCH 1/2] ARM: imx: imx8mn-evk: generate a single bootable flash.bin

To have a flash.bin file that also contains the U-Boot and TF-A/ATF create this like already done for other imx8 boards.

Quoted 42 lines
---
 arch/arm/dts/imx8mn-evk-u-boot.dtsi | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/dts/imx8mn-evk-u-boot.dtsi +18 -2
index 3db46d4cbc..d1427941eb 100644
@@ -58,7 +58,9 @@
 	};
 
 
-	flash {
+	spl {
+		filename = "spl.bin";
+
 		mkimage {
 			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
 
@@ -125,4 +127,19 @@
 			};
 		};
 	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			offset = <0x0>;
+			filename = "spl.bin";
+		};
+
+		uboot: blob-ext@2 {
+			offset = <0x58000>;
+			filename = "u-boot.itb";
+		};
+	};
 };
--

2.30.2

#3 lore raw

RE: [PATCH 2/2] ARM: imx: imx8mn-evk: use one common u-boot.dtsi for the evk boards

In reply to Heiko Thiery
Quoted 8 lines

Subject: [PATCH 2/2] ARM: imx: imx8mn-evk: use one common u-boot.dtsi for the evk boards

To have only one place to describe the binman images us the imx8mn-u-boot.dtsi. To have support for different DDR firmwares this nodes are included dependent on the used DDR config option.

Good cleanup. Reviewed-by: Peng Fan <[email protected]>

Quoted 450 lines
---
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 125 +-----------------
 arch/arm/dts/imx8mn-evk-u-boot.dtsi      | 120 +----------------
 arch/arm/dts/imx8mn-u-boot.dtsi          | 156
+++++++++++++++++++++++
 3 files changed, 159 insertions(+), 242 deletions(-)  create mode 100644

arch/arm/dts/imx8mn-u-boot.dtsi

arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +2 -123
index 2e39790766..ce06e7d797 100644
@@ -3,11 +3,9 @@
  * Copyright 2019 NXP
  */
 
-/ {
-	binman: binman {
-		multiple-images;
-	};
+#include "imx8mn-u-boot.dtsi"
 
+/ {
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -123,122 +121,3 @@
 &wdog1 {
 	u-boot,dm-spl;
 };
-
-&binman {
-	 u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "ddr4_imem_1d_201810.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "ddr4_dmem_1d_201810.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "ddr4_imem_2d_201810.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "ddr4_dmem_2d_201810.bin";
-			size = <0x4000>;
-		};
-	};
-
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x960000>;
-					entry = <0x960000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			offset = <0x0>;
-			filename = "spl.bin";
-		};
-
-		uboot: blob-ext@2 {
-			offset = <0x58000>;
-			filename = "u-boot.itb";
-		};
-	};
-};
arch/arm/dts/imx8mn-evk-u-boot.dtsi +1 -119
index d1427941eb..339c3dd681 100644
@@ -3,6 +3,7 @@
  * Copyright 2019 NXP
  */
 
+#include "imx8mn-u-boot.dtsi"
 #include "imx8mn-ddr4-evk-u-boot.dtsi"
 
 &i2c1 {
@@ -24,122 +25,3 @@
 &pinctrl_pmic {
 	u-boot,dm-spl;
 };
-
-&binman {
-	 u-boot-spl-ddr {
-		filename = "u-boot-spl-ddr.bin";
-		pad-byte = <0xff>;
-		align-size = <4>;
-		align = <4>;
-
-		u-boot-spl {
-			align-end = <4>;
-		};
-
-		blob_1: blob-ext@1 {
-			filename = "lpddr4_pmu_train_1d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_2: blob-ext@2 {
-			filename = "lpddr4_pmu_train_1d_dmem.bin";
-			size = <0x4000>;
-		};
-
-		blob_3: blob-ext@3 {
-			filename = "lpddr4_pmu_train_2d_imem.bin";
-			size = <0x8000>;
-		};
-
-		blob_4: blob-ext@4 {
-			filename = "lpddr4_pmu_train_2d_dmem.bin";
-			size = <0x4000>;
-		};
-	};
-
-
-	spl {
-		filename = "spl.bin";
-
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
-
-			blob {
-				filename = "u-boot-spl-ddr.bin";
-			};
-		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
-
-		fit {
-			description = "Configuration to load ATF before U-Boot";
-			#address-cells = <1>;
-			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-			images {
-				uboot {
-					description = "U-Boot (64-bit)";
-					type = "standalone";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SYS_TEXT_BASE>;
-
-					uboot_blob: blob-ext {
-						filename = "u-boot-nodtb.bin";
-					};
-				};
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					load = <0x960000>;
-					entry = <0x960000>;
-
-					atf_blob: blob-ext {
-						filename = "bl31.bin";
-					};
-				};
-
-				fdt {
-					description = "NAME";
-					type = "flat_dt";
-					compression = "none";
-
-					uboot_fdt_blob: blob-ext {
-						filename = "u-boot.dtb";
-					};
-				};
-			};
-
-			configurations {
-				default = "conf";
-
-				conf {
-					description = "NAME";
-					firmware = "uboot";
-					loadables = "atf";
-					fdt = "fdt";
-				};
-			};
-		};
-	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl: blob-ext@1 {
-			offset = <0x0>;
-			filename = "spl.bin";
-		};
-
-		uboot: blob-ext@2 {
-			offset = <0x58000>;
-			filename = "u-boot.itb";
-		};
-	};
-};
(quoted diff) +0 -0

b/arch/arm/dts/imx8mn-u-boot.dtsi new file mode 100644 index 0000000000..7b591085a0

arch/arm/dts/imx8mn-u-boot.dtsi new file +156 -1
@@ -0,0 +1,156 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ */
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	 u_boot_spl_ddr: u-boot-spl-ddr {
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+		align-size = <4>;
+		align = <4>;
+
+		u-boot-spl {
+			align-end = <4>;
+		};
+	};
+
+	spl {
+		filename = "spl.bin";
+
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
+
+			blob {
+				filename = "u-boot-spl-ddr.bin";
+			};
+		};
+	};
+
+	itb {
+		filename = "u-boot.itb";
+
+		fit {
+			description = "Configuration to load ATF before U-Boot";
+			#address-cells = <1>;
+			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+
+			images {
+				uboot {
+					description = "U-Boot (64-bit)";
+					type = "standalone";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_SYS_TEXT_BASE>;
+
+					uboot_blob: blob-ext {
+						filename = "u-boot-nodtb.bin";
+					};
+				};
+
+				atf {
+					description = "ARM Trusted Firmware";
+					type = "firmware";
+					arch = "arm64";
+					compression = "none";
+					load = <0x960000>;
+					entry = <0x960000>;
+
+					atf_blob: blob-ext {
+						filename = "bl31.bin";
+					};
+				};
+
+				fdt {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					uboot_fdt_blob: blob-ext {
+						filename = "u-boot.dtb";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				conf {
+					description = "NAME";
+					firmware = "uboot";
+					loadables = "atf";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			offset = <0x0>;
+			filename = "spl.bin";
+		};
+
+		uboot: blob-ext@2 {
+			offset = <0x58000>;
+			filename = "u-boot.itb";
+		};
+	};
+};
+
+#ifdef CONFIG_IMX8M_DDR4
+&u_boot_spl_ddr {
+	blob_1: blob-ext@1 {
+		filename = "ddr4_imem_1d_201810.bin";
+		size = <0x8000>;
+	};
+
+	blob_2: blob-ext@2 {
+		filename = "ddr4_dmem_1d_201810.bin";
+		size = <0x4000>;
+	};
+
+	blob_3: blob-ext@3 {
+		filename = "ddr4_imem_2d_201810.bin";
+		size = <0x8000>;
+	};
+
+	blob_4: blob-ext@4 {
+		filename = "ddr4_dmem_2d_201810.bin";
+		size = <0x4000>;
+	};
+};
+#elif CONFIG_IMX8M_LPDDR4
+&u_boot_spl_ddr {
+	blob_1: blob-ext@1 {
+		filename = "lpddr4_pmu_train_1d_imem.bin";
+		size = <0x8000>;
+	};
+
+	blob_2: blob-ext@2 {
+		filename = "lpddr4_pmu_train_1d_dmem.bin";
+		size = <0x4000>;
+	};
+
+	blob_3: blob-ext@3 {
+		filename = "lpddr4_pmu_train_2d_imem.bin";
+		size = <0x8000>;
+	};
+
+	blob_4: blob-ext@4 {
+		filename = "lpddr4_pmu_train_2d_dmem.bin";
+		size = <0x4000>;
+	};
+};
+#else
+	#error "no valid ddr config selected"
+#endif
--

2.30.2

#8 lore raw
In reply to Heiko Thiery
Quoted 13 lines · Heiko Thiery

To have a flash.bin file that also contains the U-Boot and TF-A/ATF create this like already done for other imx8 boards.

---
  arch/arm/dts/imx8mn-evk-u-boot.dtsi | 19 ++++++++++++++++++-
  1 file changed, 18 insertions(+), 1 deletion(-)
arch/arm/dts/imx8mn-evk-u-boot.dtsi +0 -0
index 3db46d4cbc..d1427941eb 100644

arch/arm/dts/imx8mn-evk-u-boot.dtsi line 58

Quoted 1 line
arch/arm/dts/imx8mn-evk-u-boot.dtsi +0 -0
@@ -58,7 +58,9 @@
  	};

Isn't there imx8mn-u-boot.dtsi you can include instead ? There is one for 8mp and 8mm .

#9 lore raw

Hi Marek,

Am Do., 24. Feb. 2022 um 15:13 Uhr schrieb Marek Vasut <[email protected]>:

Quoted 10 lines · Heiko Thiery
Quoted 8 lines

To have a flash.bin file that also contains the U-Boot and TF-A/ATF create this like already done for other imx8 boards.

---
  arch/arm/dts/imx8mn-evk-u-boot.dtsi | 19 ++++++++++++++++++-
  1 file changed, 18 insertions(+), 1 deletion(-)
Quoted 9 lines

arch/arm/dts/imx8mn-evk-u-boot.dtsi line 58

Quoted 6 lines
arch/arm/dts/imx8mn-evk-u-boot.dtsi +0 -0
index 3db46d4cbc..d1427941eb 100644
@@ -58,7 +58,9 @@
      };

Isn't there imx8mn-u-boot.dtsi you can include instead ? There is one for 8mp and 8mm .

This is what I've done in the second patch. The first one only enables the complete flash.bin for this board and the second one creates a common imx8mn-u-boot.dtsi.

Signature · 1 line
Heiko
#10 lore raw
Quoted 23 lines · Heiko Thiery

Hi Marek,

Am Do., 24. Feb. 2022 um 15:13 Uhr schrieb Marek Vasut <[email protected]>:

Quoted 10 lines · Heiko Thiery
Quoted 8 lines

To have a flash.bin file that also contains the U-Boot and TF-A/ATF create this like already done for other imx8 boards.

---
   arch/arm/dts/imx8mn-evk-u-boot.dtsi | 19 ++++++++++++++++++-
   1 file changed, 18 insertions(+), 1 deletion(-)
Quoted 9 lines

arch/arm/dts/imx8mn-evk-u-boot.dtsi line 58

Quoted 6 lines
arch/arm/dts/imx8mn-evk-u-boot.dtsi +0 -0
index 3db46d4cbc..d1427941eb 100644
@@ -58,7 +58,9 @@
       };

Isn't there imx8mn-u-boot.dtsi you can include instead ? There is one for 8mp and 8mm .

Quoted 3 lines

This is what I've done in the second patch. The first one only enables the complete flash.bin for this board and the second one creates a common imx8mn-u-boot.dtsi.

Ah, OK.

#4 lore raw

Re: [PATCH 2/2] ARM: imx: imx8mn-evk: use one common u-boot.dtsi for the evk boards

In reply to Heiko Thiery
Quoted 378 lines · Heiko Thiery

To have only one place to describe the binman images us the imx8mn-u-boot.dtsi. To have support for different DDR firmwares this nodes are included dependent on the used DDR config option.

---
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi | 125 +-----------------
 arch/arm/dts/imx8mn-evk-u-boot.dtsi      | 120 +----------------
 arch/arm/dts/imx8mn-u-boot.dtsi          | 156 +++++++++++++++++++++++
 3 files changed, 159 insertions(+), 242 deletions(-)
 create mode 100644 arch/arm/dts/imx8mn-u-boot.dtsi
arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi +2 -123
index 2e39790766..ce06e7d797 100644
@@ -3,11 +3,9 @@
  * Copyright 2019 NXP
  */
 
-/ {
-       binman: binman {
-               multiple-images;
-       };
+#include "imx8mn-u-boot.dtsi"
 
+/ {
        wdt-reboot {
                compatible = "wdt-reboot";
                wdt = <&wdog1>;
@@ -123,122 +121,3 @@
 &wdog1 {
        u-boot,dm-spl;
 };
-
-&binman {
-        u-boot-spl-ddr {
-               filename = "u-boot-spl-ddr.bin";
-               pad-byte = <0xff>;
-               align-size = <4>;
-               align = <4>;
-
-               u-boot-spl {
-                       align-end = <4>;
-               };
-
-               blob_1: blob-ext@1 {
-                       filename = "ddr4_imem_1d_201810.bin";
-                       size = <0x8000>;
-               };
-
-               blob_2: blob-ext@2 {
-                       filename = "ddr4_dmem_1d_201810.bin";
-                       size = <0x4000>;
-               };
-
-               blob_3: blob-ext@3 {
-                       filename = "ddr4_imem_2d_201810.bin";
-                       size = <0x8000>;
-               };
-
-               blob_4: blob-ext@4 {
-                       filename = "ddr4_dmem_2d_201810.bin";
-                       size = <0x4000>;
-               };
-       };
-
-
-       spl {
-               filename = "spl.bin";
-
-               mkimage {
-                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
-
-                       blob {
-                               filename = "u-boot-spl-ddr.bin";
-                       };
-               };
-       };
-
-       itb {
-               filename = "u-boot.itb";
-
-               fit {
-                       description = "Configuration to load ATF before U-Boot";
-                       #address-cells = <1>;
-                       fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-                       images {
-                               uboot {
-                                       description = "U-Boot (64-bit)";
-                                       type = "standalone";
-                                       arch = "arm64";
-                                       compression = "none";
-                                       load = <CONFIG_SYS_TEXT_BASE>;
-
-                                       uboot_blob: blob-ext {
-                                               filename = "u-boot-nodtb.bin";
-                                       };
-                               };
-
-                               atf {
-                                       description = "ARM Trusted Firmware";
-                                       type = "firmware";
-                                       arch = "arm64";
-                                       compression = "none";
-                                       load = <0x960000>;
-                                       entry = <0x960000>;
-
-                                       atf_blob: blob-ext {
-                                               filename = "bl31.bin";
-                                       };
-                               };
-
-                               fdt {
-                                       description = "NAME";
-                                       type = "flat_dt";
-                                       compression = "none";
-
-                                       uboot_fdt_blob: blob-ext {
-                                               filename = "u-boot.dtb";
-                                       };
-                               };
-                       };
-
-                       configurations {
-                               default = "conf";
-
-                               conf {
-                                       description = "NAME";
-                                       firmware = "uboot";
-                                       loadables = "atf";
-                                       fdt = "fdt";
-                               };
-                       };
-               };
-       };
-
-       imx-boot {
-               filename = "flash.bin";
-               pad-byte = <0x00>;
-
-               spl: blob-ext@1 {
-                       offset = <0x0>;
-                       filename = "spl.bin";
-               };
-
-               uboot: blob-ext@2 {
-                       offset = <0x58000>;
-                       filename = "u-boot.itb";
-               };
-       };
-};
arch/arm/dts/imx8mn-evk-u-boot.dtsi +1 -119
index d1427941eb..339c3dd681 100644
@@ -3,6 +3,7 @@
  * Copyright 2019 NXP
  */
 
+#include "imx8mn-u-boot.dtsi"
 #include "imx8mn-ddr4-evk-u-boot.dtsi"
 
 &i2c1 {
@@ -24,122 +25,3 @@
 &pinctrl_pmic {
        u-boot,dm-spl;
 };
-
-&binman {
-        u-boot-spl-ddr {
-               filename = "u-boot-spl-ddr.bin";
-               pad-byte = <0xff>;
-               align-size = <4>;
-               align = <4>;
-
-               u-boot-spl {
-                       align-end = <4>;
-               };
-
-               blob_1: blob-ext@1 {
-                       filename = "lpddr4_pmu_train_1d_imem.bin";
-                       size = <0x8000>;
-               };
-
-               blob_2: blob-ext@2 {
-                       filename = "lpddr4_pmu_train_1d_dmem.bin";
-                       size = <0x4000>;
-               };
-
-               blob_3: blob-ext@3 {
-                       filename = "lpddr4_pmu_train_2d_imem.bin";
-                       size = <0x8000>;
-               };
-
-               blob_4: blob-ext@4 {
-                       filename = "lpddr4_pmu_train_2d_dmem.bin";
-                       size = <0x4000>;
-               };
-       };
-
-
-       spl {
-               filename = "spl.bin";
-
-               mkimage {
-                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
-
-                       blob {
-                               filename = "u-boot-spl-ddr.bin";
-                       };
-               };
-       };
-
-       itb {
-               filename = "u-boot.itb";
-
-               fit {
-                       description = "Configuration to load ATF before U-Boot";
-                       #address-cells = <1>;
-                       fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
-
-                       images {
-                               uboot {
-                                       description = "U-Boot (64-bit)";
-                                       type = "standalone";
-                                       arch = "arm64";
-                                       compression = "none";
-                                       load = <CONFIG_SYS_TEXT_BASE>;
-
-                                       uboot_blob: blob-ext {
-                                               filename = "u-boot-nodtb.bin";
-                                       };
-                               };
-
-                               atf {
-                                       description = "ARM Trusted Firmware";
-                                       type = "firmware";
-                                       arch = "arm64";
-                                       compression = "none";
-                                       load = <0x960000>;
-                                       entry = <0x960000>;
-
-                                       atf_blob: blob-ext {
-                                               filename = "bl31.bin";
-                                       };
-                               };
-
-                               fdt {
-                                       description = "NAME";
-                                       type = "flat_dt";
-                                       compression = "none";
-
-                                       uboot_fdt_blob: blob-ext {
-                                               filename = "u-boot.dtb";
-                                       };
-                               };
-                       };
-
-                       configurations {
-                               default = "conf";
-
-                               conf {
-                                       description = "NAME";
-                                       firmware = "uboot";
-                                       loadables = "atf";
-                                       fdt = "fdt";
-                               };
-                       };
-               };
-       };
-
-       imx-boot {
-               filename = "flash.bin";
-               pad-byte = <0x00>;
-
-               spl: blob-ext@1 {
-                       offset = <0x0>;
-                       filename = "spl.bin";
-               };
-
-               uboot: blob-ext@2 {
-                       offset = <0x58000>;
-                       filename = "u-boot.itb";
-               };
-       };
-};
arch/arm/dts/imx8mn-u-boot.dtsi new file +83 -0
new file mode 100644
index 0000000000..7b591085a0
@@ -0,0 +1,156 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ */
+
+/ {
+       binman: binman {
+               multiple-images;
+       };
+};
+
+&binman {
+        u_boot_spl_ddr: u-boot-spl-ddr {
+               filename = "u-boot-spl-ddr.bin";
+               pad-byte = <0xff>;
+               align-size = <4>;
+               align = <4>;
+
+               u-boot-spl {
+                       align-end = <4>;
+               };
+       };
+
+       spl {
+               filename = "spl.bin";
+
+               mkimage {
+                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
+
+                       blob {
+                               filename = "u-boot-spl-ddr.bin";
+                       };
+               };
+       };
+
+       itb {
+               filename = "u-boot.itb";
+
+               fit {
+                       description = "Configuration to load ATF before U-Boot";
+                       #address-cells = <1>;
+                       fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+
+                       images {
+                               uboot {
+                                       description = "U-Boot (64-bit)";
+                                       type = "standalone";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       load = <CONFIG_SYS_TEXT_BASE>;
+
+                                       uboot_blob: blob-ext {
+                                               filename = "u-boot-nodtb.bin";
+                                       };
+                               };
+
+                               atf {
+                                       description = "ARM Trusted Firmware";
+                                       type = "firmware";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       load = <0x960000>;
+                                       entry = <0x960000>;
+
+                                       atf_blob: blob-ext {
+                                               filename = "bl31.bin";
+                                       };
+                               };
+
+                               fdt {
+                                       description = "NAME";
+                                       type = "flat_dt";
+                                       compression = "none";
+
+                                       uboot_fdt_blob: blob-ext {
+                                               filename = "u-boot.dtb";
+                                       };
+                               };
+                       };
+
+                       configurations {
+                               default = "conf";
+

arch/arm/dts/imx8mn-u-boot.dtsi line 93

Quoted 10 lines
arch/arm/dts/imx8mn-u-boot.dtsi new file +10 -0
+                               conf {
+                                       description = "NAME";
+                                       firmware = "uboot";
+                                       loadables = "atf";
+                                       fdt = "fdt";
+                               };
+                       };
+               };
+       };
+

Heiko,

Thanks for doing this.

If we can add multi-fdt support by adding 'fit,fdt-list = "of-list"' and @fdt-SEQ this would work for the recently merged imx8mn-venice-gw7902 support as well.

I could do that as a follow-up if needed.

Best Regards,

Tim

#5 lore raw

Re: [PATCH 2/2] ARM: imx: imx8mn-evk: use one common u-boot.dtsi for the evk boards

Hi Tim and all,

[...]

Quoted 9 lines
Quoted 1 line

+

Heiko,

Thanks for doing this.

If we can add multi-fdt support by adding 'fit,fdt-list = "of-list"' and @fdt-SEQ this would work for the recently merged imx8mn-venice-gw7902 support as well.

Maybe it would be a good idea to have one binman file for all imx8 boards? Currently every imx8 platform has its own stuff in the corresponding imx8{mn,mq,mn,mm}-u-boot.dtsi although the image creation is always the same. I think about something like imx8-image-u-boot.dtsi or imx8-binman-u-boot.dtsi that holds one common image generation definition. But I saw that there are some boards that have e.g. fip/optee nodes and currently I do not know if we can include that in a common way.

Quoted 5 lines

I could do that as a follow-up if needed.

Best Regards,

Tim