ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman

Rework the flash.bin image generation such that it uses the new binman
nxp_imx8mimage etype. This way, the flash.bin is assembled in correct
order using plain binman, without any workarounds or sections assembled
in special DT node order.

Reviewed-By: Tim Harvey <tharvey@gateworks.com>
Tested-By: Tim Harvey <tharvey@gateworks.com> # imx8mm_venice
Tested-by: Fabio Estevam <festevam@gmail.com> # imx8mm-evk and imx8mn-evk
Signed-off-by: Marek Vasut <marex@denx.de>
diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi b/arch/arm/dts/imx8mp-u-boot.dtsi
index 4fadcae..c4c1a17 100644
--- a/arch/arm/dts/imx8mp-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-u-boot.dtsi
@@ -6,7 +6,6 @@
 
 / {
 	binman: binman {
-		multiple-images;
 	};
 
 #ifdef CONFIG_OPTEE
@@ -83,55 +82,52 @@
 #endif
 
 &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>;
-		};
+	filename = "flash.bin";
+	section {
+		pad-byte = <0x00>;
 
-		ddr-1d-imem-fw {
-			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
-			type = "blob-ext";
-			align-end = <4>;
-		};
+		nxp-imx8mimage {
+			filename = "u-boot-spl-mkimage.bin";
+			nxp,boot-from = "sd";
+			nxp,rom-version = <2>;
+			nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
+			args;	/* Needed by mkimage etype superclass */
 
-		ddr-1d-dmem-fw {
-			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
-			type = "blob-ext";
-			align-end = <4>;
-		};
+			section {
+				filename = "u-boot-spl-ddr.bin";
+				pad-byte = <0xff>;
+				align-size = <4>;
+				align = <4>;
 
-		ddr-2d-imem-fw {
-			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
-			type = "blob-ext";
-			align-end = <4>;
-		};
+				u-boot-spl {
+					align-end = <4>;
+				};
 
-		ddr-2d-dmem-fw {
-			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
-			type = "blob-ext";
-			align-end = <4>;
-		};
-	};
+				ddr-1d-imem-fw {
+					filename = "lpddr4_pmu_train_1d_imem_202006.bin";
+					type = "blob-ext";
+					align-end = <4>;
+				};
 
-	spl {
-		filename = "spl.bin";
+				ddr-1d-dmem-fw {
+					filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
+					type = "blob-ext";
+					align-end = <4>;
+				};
 
-		mkimage {
-			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x920000";
+				ddr-2d-imem-fw {
+					filename = "lpddr4_pmu_train_2d_imem_202006.bin";
+					type = "blob-ext";
+					align-end = <4>;
+				};
 
-			blob {
-				filename = "u-boot-spl-ddr.bin";
+				ddr-2d-dmem-fw {
+					filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
+					type = "blob-ext";
+					align-end = <4>;
+				};
 			};
 		};
-	};
-
-	itb {
-		filename = "u-boot.itb";
 
 		fit {
 			description = "Configuration to load ATF before U-Boot";
@@ -140,6 +136,7 @@
 #endif
 			fit,fdt-list = "of-list";
 			#address-cells = <1>;
+			offset = <0x58000>;
 
 			images {
 				uboot {
@@ -195,21 +192,4 @@
 			};
 		};
 	};
-
-	imx-boot {
-		filename = "flash.bin";
-		pad-byte = <0x00>;
-
-		spl {
-			filename = "spl.bin";
-			offset = <0x0>;
-			type = "blob-ext";
-		};
-
-		binman_uboot: uboot {
-			filename = "u-boot.itb";
-			offset = <0x58000>;
-			type = "blob-ext";
-		};
-	};
 };