U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Cleanup K3 binman FIT images
@ 2023-11-15 10:10 Neha Malcom Francis
  2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-15 10:10 UTC (permalink / raw)
  To: sjg, marcel.ziswiler
  Cc: u-boot, vigneshr, nm, u-kumar1, kamlesh, m-chawdhry, afd,
	mkorpershoek, n-francis

Instead of duplicating the same FIT formats over and over again for
different K3 devices, make use of the templating support to have FIT
templates for the same. 

Note: I purposely did not add the trial to template out the non-FIT
bootloader image (tiboot3.bin) as it reduces the readibility and
understandability of how the image is packaged because of the various
different boot flows.

Boot logs:
https://gist.github.com/nehamalcom/9abe7955ebb4a251923e76412834c886

Neha Malcom Francis (2):
  arm: dts: k3-binman: Add support for FIT templates
  arm: dts: k3-*-binman: Move to using templated FITs

 arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
 arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
 arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
 arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
 arch/arm/dts/k3-binman.dtsi                   | 327 +++++++++++++++++
 arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
 arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
 arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
 9 files changed, 381 insertions(+), 1488 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates
  2023-11-15 10:10 [PATCH 0/2] Cleanup K3 binman FIT images Neha Malcom Francis
@ 2023-11-15 10:10 ` Neha Malcom Francis
  2023-11-16 16:03   ` Simon Glass
  2023-11-22 20:50   ` Tom Rini
  2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
  2023-11-15 17:33 ` [PATCH 0/2] Cleanup K3 binman FIT images Marcel Ziswiler
  2 siblings, 2 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-15 10:10 UTC (permalink / raw)
  To: sjg, marcel.ziswiler
  Cc: u-boot, vigneshr, nm, u-kumar1, kamlesh, m-chawdhry, afd,
	mkorpershoek, n-francis

Add templates for FIT images used extensively across K3 boards with most
of the code common. This includes the FIT portions of:
	- tispl.bin
	- u-boot.img
	- sysfw.itb (in case of legacy boot flow)

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
---
 arch/arm/dts/k3-binman.dtsi | 327 ++++++++++++++++++++++++++++++++++++
 1 file changed, 327 insertions(+)

diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
index 2ea2dd18a1..677a017403 100644
--- a/arch/arm/dts/k3-binman.dtsi
+++ b/arch/arm/dts/k3-binman.dtsi
@@ -113,4 +113,331 @@
 	};
 };
 
+&binman {
+	itb_template: template-5 {
+		fit {
+			description = "SYSFW and Config fragments";
+			#address-cells = <1>;
+			images {
+				sysfw.bin {
+					description = "sysfw";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					blob-ext {
+					    filename = "sysfw.bin";
+					};
+				};
+				board-cfg.bin {
+					description = "board-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					ti-secure {
+						content = <&board_cfg>;
+						keyfile = "custMpk.pem";
+					};
+					board_cfg: board-cfg {
+						filename = "board-cfg.bin";
+						type = "blob-ext";
+					};
+
+				};
+				pm-cfg.bin {
+					description = "pm-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					ti-secure {
+						content = <&pm_cfg>;
+						keyfile = "custMpk.pem";
+					};
+					pm_cfg: pm-cfg {
+						filename = "pm-cfg.bin";
+						type = "blob-ext";
+					};
+				};
+				rm-cfg.bin {
+					description = "rm-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					ti-secure {
+						content = <&rm_cfg>;
+						keyfile = "custMpk.pem";
+					};
+					rm_cfg: rm-cfg {
+						filename = "rm-cfg.bin";
+						type = "blob-ext";
+					};
+				};
+				sec-cfg.bin {
+					description = "sec-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					ti-secure {
+						content = <&sec_cfg>;
+						keyfile = "custMpk.pem";
+					};
+					sec_cfg: sec-cfg {
+						filename = "sec-cfg.bin";
+						type = "blob-ext";
+					};
+				};
+			};
+		};
+	};
+
+	itb_unsigned_template: template-6 {
+		fit {
+			description = "SYSFW and Config fragments";
+			#address-cells = <1>;
+			images {
+				sysfw.bin {
+					description = "sysfw";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					blob-ext {
+					    filename = "sysfw.bin_fs";
+					};
+				};
+				board-cfg.bin {
+					description = "board-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					board-cfg {
+						filename = "board-cfg.bin";
+						type = "blob-ext";
+					};
+
+				};
+				pm-cfg.bin {
+					description = "pm-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					pm-cfg {
+						filename = "pm-cfg.bin";
+						type = "blob-ext";
+					};
+				};
+				rm-cfg.bin {
+					description = "rm-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					rm-cfg {
+						filename = "rm-cfg.bin";
+						type = "blob-ext";
+					};
+				};
+				sec-cfg.bin {
+					description = "sec-cfg";
+					type = "firmware";
+					arch = "arm";
+					compression = "none";
+					sec-cfg {
+						filename = "sec-cfg.bin";
+						type = "blob-ext";
+					};
+				};
+			};
+		};
+	};
+};
+
+#else
+
+&binman {
+	ti_spl_template: template-1 {
+		filename = "tispl.bin";
+		pad-byte = <0xff>;
+
+		fit {
+			description = "Configuration to load ATF and SPL";
+			#address-cells = <1>;
+
+			images {
+
+				atf {
+					description = "ARM Trusted Firmware";
+					type = "firmware";
+					arch = "arm64";
+					compression = "none";
+					os = "arm-trusted-firmware";
+					load = <CONFIG_K3_ATF_LOAD_ADDR>;
+					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
+					ti-secure {
+						content = <&atf>;
+						keyfile = "custMpk.pem";
+					};
+					atf: atf-bl31 {
+					};
+				};
+
+				tee {
+					description = "OP-TEE";
+					type = "tee";
+					arch = "arm64";
+					compression = "none";
+					os = "tee";
+					load = <0x9e800000>;
+					entry = <0x9e800000>;
+					ti-secure {
+						content = <&tee>;
+						keyfile = "custMpk.pem";
+					};
+					tee: tee-os {
+					};
+				};
+
+				dm {
+					description = "DM binary";
+					type = "firmware";
+					arch = "arm32";
+					compression = "none";
+					os = "DM";
+					load = <0x89000000>;
+					entry = <0x89000000>;
+				};
+
+				spl {
+					description = "SPL (64-bit)";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_SPL_TEXT_BASE>;
+					entry = <CONFIG_SPL_TEXT_BASE>;
+					ti-secure {
+						content = <&u_boot_spl_nodtb>;
+						keyfile = "custMpk.pem";
+
+					};
+					u_boot_spl_nodtb: blob-ext {
+						filename = "spl/u-boot-spl-nodtb.bin";
+					};
+				};
+
+			};
+		};
+	};
+	ti_spl_unsigned_template: template-2 {
+		filename = "tispl.bin_unsigned";
+		pad-byte = <0xff>;
+
+		fit {
+			description = "Configuration to load ATF and SPL";
+			#address-cells = <1>;
+
+			images {
+
+				atf {
+					description = "ARM Trusted Firmware";
+					type = "firmware";
+					arch = "arm64";
+					compression = "none";
+					os = "arm-trusted-firmware";
+					load = <CONFIG_K3_ATF_LOAD_ADDR>;
+					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
+					atf-bl31 {
+						filename = "bl31.bin";
+					};
+				};
+
+				tee {
+					description = "OP-TEE";
+					type = "tee";
+					arch = "arm64";
+					compression = "none";
+					os = "tee";
+					load = <0x9e800000>;
+					entry = <0x9e800000>;
+					tee-os {
+						filename = "tee-raw.bin";
+					};
+				};
+
+				dm {
+					description = "DM binary";
+					type = "firmware";
+					arch = "arm32";
+					compression = "none";
+					os = "DM";
+					load = <0x89000000>;
+					entry = <0x89000000>;
+				};
+
+				spl {
+					description = "SPL (64-bit)";
+					type = "standalone";
+					os = "U-Boot";
+					arch = "arm64";
+					compression = "none";
+					load = <CONFIG_SPL_TEXT_BASE>;
+					entry = <CONFIG_SPL_TEXT_BASE>;
+					blob-ext {
+						filename = "spl/u-boot-spl-nodtb.bin";
+					};
+				};
+			};
+		};
+	};
+	u_boot_template: template-3 {
+		filename = "u-boot.img";
+		pad-byte = <0xff>;
+
+		fit {
+			description = "FIT image with multiple configurations";
+
+			images {
+				uboot {
+					type = "firmware";
+					os = "u-boot";
+					arch = "arm";
+					compression = "none";
+					load = <CONFIG_TEXT_BASE>;
+					ti-secure {
+						content = <&u_boot_nodtb>;
+						keyfile = "custMpk.pem";
+					};
+					u_boot_nodtb: u-boot-nodtb {
+					};
+					hash {
+						algo = "crc32";
+					};
+				};
+			};
+		};
+	};
+	u_boot_unsigned_template: template-4 {
+		filename = "u-boot.img_unsigned";
+		pad-byte = <0xff>;
+
+		fit {
+			description = "FIT image with multiple configurations";
+
+			images {
+				uboot {
+					type = "firmware";
+					os = "u-boot";
+					arch = "arm";
+					compression = "none";
+					load = <CONFIG_TEXT_BASE>;
+					blob {
+						filename = "u-boot-nodtb.bin";
+					};
+					hash {
+						algo = "crc32";
+					};
+				};
+			};
+		};
+	};
+
+};
+
 #endif
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-15 10:10 [PATCH 0/2] Cleanup K3 binman FIT images Neha Malcom Francis
  2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
@ 2023-11-15 10:10 ` Neha Malcom Francis
  2023-11-15 15:52   ` Andrew Davis
                     ` (3 more replies)
  2023-11-15 17:33 ` [PATCH 0/2] Cleanup K3 binman FIT images Marcel Ziswiler
  2 siblings, 4 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-15 10:10 UTC (permalink / raw)
  To: sjg, marcel.ziswiler
  Cc: u-boot, vigneshr, nm, u-kumar1, kamlesh, m-chawdhry, afd,
	mkorpershoek, n-francis

Reduce redundancy in code by using templates to generate the A72 boot
binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
(for legacy boot following devices J721E and AM65x).

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
---
 arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
 arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
 arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
 arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
 arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
 arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
 arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
 8 files changed, 54 insertions(+), 1488 deletions(-)

diff --git a/arch/arm/dts/k3-am625-sk-binman.dtsi b/arch/arm/dts/k3-am625-sk-binman.dtsi
index 41277bf4bf..b7b5368886 100644
--- a/arch/arm/dts/k3-am625-sk-binman.dtsi
+++ b/arch/arm/dts/k3-am625-sk-binman.dtsi
@@ -141,10 +141,7 @@
 
 #ifdef CONFIG_TARGET_AM625_A53_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_AM625_SK_DTB "spl/dts/k3-am625-sk.dtb"
-
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define AM625_SK_DTB "u-boot.dtb"
 
 &binman {
@@ -155,55 +152,11 @@
 		};
 	};
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					ti-secure {
 						content = <&dm>;
 						keyfile = "custMpk.pem";
@@ -213,23 +166,6 @@
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am625-sk";
 					type = "flat_dt";
@@ -263,29 +199,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM625 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM625 Board";
 				};
 
 				fdt-0 {
@@ -323,67 +242,17 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
 
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob {
-						filename = "spl/u-boot-spl-nodtb.bin";
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am625-sk";
 					type = "flat_dt";
@@ -411,26 +280,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM625 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM625 Board";
 				};
 
 				fdt-0 {
diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi b/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
index 089b2a5f5c..eafd3310bb 100644
--- a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
+++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
@@ -214,10 +214,7 @@
 
 #ifdef CONFIG_TARGET_VERDIN_AM62_A53
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_VERDIN_AM62_DTB "spl/dts/k3-am625-verdin-wifi-dev.dtb"
-
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define VERDIN_AM62_DTB "u-boot.dtb"
 
 &binman {
@@ -228,54 +225,12 @@
 		};
 	};
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
 
 			images {
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					ti-secure {
 						content = <&dm>;
 						keyfile = "custMpk.pem";
@@ -285,23 +240,6 @@
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am625-verdin-wifi-dev";
 					type = "flat_dt";
@@ -333,29 +271,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM625 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot fot AM625 Verdin Board";
 				};
 
 				fdt-0 {
@@ -392,66 +313,16 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob {
-						filename = "spl/u-boot-spl-nodtb.bin";
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am625-verdin-wifi-dev";
 					type = "flat_dt";
@@ -479,26 +350,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM625 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM625 Verdin Board";
 				};
 
 				fdt-0 {
diff --git a/arch/arm/dts/k3-am62a-sk-binman.dtsi b/arch/arm/dts/k3-am62a-sk-binman.dtsi
index de09430d93..c5e027d44d 100644
--- a/arch/arm/dts/k3-am62a-sk-binman.dtsi
+++ b/arch/arm/dts/k3-am62a-sk-binman.dtsi
@@ -144,10 +144,7 @@
 
 #ifdef CONFIG_TARGET_AM62A7_A53_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_AM62A7_SK_DTB "spl/dts/k3-am62a7-sk.dtb"
-
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define AM62A7_SK_DTB "u-boot.dtb"
 
 &binman {
@@ -158,55 +155,11 @@
 		};
 	};
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					ti-secure {
 						content = <&dm>;
 						keyfile = "custMpk.pem";
@@ -216,23 +169,6 @@
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am62a7-sk";
 					type = "flat_dt";
@@ -266,29 +202,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM62Ax board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM62Ax Board";
 				};
 
 				fdt-0 {
@@ -326,67 +245,16 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob {
-						filename = "spl/u-boot-spl-nodtb.bin";
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am62a7-sk";
 					type = "flat_dt";
@@ -414,26 +282,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM62Ax board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM62Ax Board";
 				};
 
 				fdt-0 {
diff --git a/arch/arm/dts/k3-am64x-binman.dtsi b/arch/arm/dts/k3-am64x-binman.dtsi
index a5e54006b4..88df214954 100644
--- a/arch/arm/dts/k3-am64x-binman.dtsi
+++ b/arch/arm/dts/k3-am64x-binman.dtsi
@@ -118,87 +118,27 @@
 
 #ifdef CONFIG_TARGET_AM642_A53_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_AM642_EVM_DTB "spl/dts/k3-am642-evm.dtb"
 #define SPL_AM642_SK_DTB "spl/dts/k3-am642-sk.dtb"
 
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define AM642_EVM_DTB "u-boot.dtb"
 #define AM642_SK_DTB "arch/arm/dts/k3-am642-sk.dtb"
 
 &binman {
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
 			description = "Configuration to load ATF and SPL";
 			#address-cells = <1>;
 
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "/dev/null";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
 
 				fdt-0 {
 					description = "k3-am642-evm";
@@ -254,29 +194,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM64 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM64 Board";
 				};
 
 				fdt-0 {
@@ -340,65 +263,17 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
 
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "/dev/null";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob {
-						filename = "spl/u-boot-spl-nodtb.bin";
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am642-evm";
 					type = "flat_dt";
@@ -443,26 +318,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM64 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM64 Board";
 				};
 
 				fdt-0 {
diff --git a/arch/arm/dts/k3-am65x-binman.dtsi b/arch/arm/dts/k3-am65x-binman.dtsi
index 59605ca597..8cc24da1f3 100644
--- a/arch/arm/dts/k3-am65x-binman.dtsi
+++ b/arch/arm/dts/k3-am65x-binman.dtsi
@@ -42,77 +42,7 @@
 	};
 	itb {
 		filename = "sysfw-am65x_sr2-hs-evm.itb";
-		fit {
-			description = "SYSFW and Config fragments";
-			#address-cells = <1>;
-			images {
-				sysfw.bin {
-					description = "sysfw";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-					    filename = "sysfw.bin";
-					};
-				};
-				board-cfg.bin {
-					description = "board-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&board_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					board_cfg: board-cfg {
-						filename = "board-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				pm-cfg.bin {
-					description = "pm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&pm_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					pm_cfg: pm-cfg {
-						filename = "pm-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				rm-cfg.bin {
-					description = "rm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&rm_cfg>;
-						keyfile = "custMpk.pem";\
-					};
-					rm_cfg: rm-cfg {
-						filename = "rm-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				sec-cfg.bin {
-					description = "sec-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&sec_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					sec_cfg: sec-cfg {
-						filename = "sec-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-			};
-		};
+		insert-template = <&itb_template>;
 	};
 };
 
@@ -149,55 +79,14 @@
 	itb_gp {
 		filename = "sysfw-am65x_sr2-gp-evm.itb";
 		symlink = "sysfw.itb";
+		insert-template = <&itb_unsigned_template>;
 		fit {
-			description = "SYSFW and Config fragments";
-			#address-cells = <1>;
 			images {
 				sysfw.bin {
-					description = "sysfw";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
 					blob-ext {
 					    filename = "sysfw.bin_gp";
 					};
 				};
-				board-cfg.bin {
-					description = "board-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "board-cfg.bin";
-					};
-				};
-				pm-cfg.bin {
-					description = "pm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "pm-cfg.bin";
-					};
-				};
-				rm-cfg.bin {
-					description = "rm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "rm-cfg.bin";
-					};
-				};
-				sec-cfg.bin {
-					description = "sec-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "sec-cfg.bin";
-					};
-				};
 			};
 		};
 	};
@@ -206,86 +95,22 @@
 
 #ifdef CONFIG_TARGET_AM654_A53_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_AM654_EVM_DTB "spl/dts/k3-am654-base-board.dtb"
-
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define AM654_EVM_DTB "u-boot.dtb"
 
 &binman {
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
 
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "/dev/null";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-am654-base-board";
 					type = "flat_dt";
@@ -317,29 +142,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM65 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM65 Board";
 				};
 
 				fdt-0 {
@@ -378,67 +186,16 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "/dev/null";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-j721e-common-proc-board";
 					type = "flat_dt";
@@ -466,26 +223,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for AM65 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for AM65 Board";
 				};
 
 				fdt-0 {
diff --git a/arch/arm/dts/k3-j7200-binman.dtsi b/arch/arm/dts/k3-j7200-binman.dtsi
index 14f7dea65e..10c9d6cba7 100644
--- a/arch/arm/dts/k3-j7200-binman.dtsi
+++ b/arch/arm/dts/k3-j7200-binman.dtsi
@@ -180,10 +180,7 @@
 
 #ifdef CONFIG_TARGET_J7200_A72_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_J7200_EVM_DTB "spl/dts/k3-j7200-common-proc-board.dtb"
-
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define J7200_EVM_DTB "u-boot.dtb"
 
 &binman {
@@ -194,82 +191,20 @@
 		};
 	};
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					ti-secure {
 						content = <&dm>;
 						keyfile = "custMpk.pem";
 					};
-
 					dm: blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-j7200-common-proc-board";
 					type = "flat_dt";
@@ -302,29 +237,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for J7200 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for J7200 Board";
 				};
 
 				fdt-0 {
@@ -362,67 +280,16 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-1 {
 					description = "k3-j7200-common-proc-board";
 					type = "flat_dt";
@@ -450,26 +317,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for J7200 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for J7200 Board";
 				};
 
 				fdt-1 {
diff --git a/arch/arm/dts/k3-j721e-binman.dtsi b/arch/arm/dts/k3-j721e-binman.dtsi
index 4f566c21a9..5ddb474e3a 100644
--- a/arch/arm/dts/k3-j721e-binman.dtsi
+++ b/arch/arm/dts/k3-j721e-binman.dtsi
@@ -42,78 +42,7 @@
 	};
 	itb {
 		filename = "sysfw-j721e_sr1_1-hs-evm.itb";
-		fit {
-			description = "SYSFW and Config fragments";
-			#address-cells = <1>;
-			images {
-				sysfw.bin {
-					description = "sysfw";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-					    filename = "sysfw.bin";
-					};
-				};
-				board-cfg.bin {
-					description = "board-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&board_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					board_cfg: board-cfg {
-						filename = "board-cfg.bin";
-						type = "blob-ext";
-					};
-
-				};
-				pm-cfg.bin {
-					description = "pm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&pm_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					pm_cfg: pm-cfg {
-						filename = "pm-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				rm-cfg.bin {
-					description = "rm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&rm_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					rm_cfg: rm-cfg {
-						filename = "rm-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				sec-cfg.bin {
-					description = "sec-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					ti-secure {
-						content = <&sec_cfg>;
-						keyfile = "custMpk.pem";
-					};
-					sec_cfg: sec-cfg {
-						filename = "sec-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-			};
-		};
+		insert-template = <&itb_template>;
 	};
 };
 
@@ -145,62 +74,7 @@
 	};
 	itb_fs {
 		filename = "sysfw-j721e_sr2-hs-fs-evm.itb";
-		fit {
-			description = "SYSFW and Config fragments";
-			#address-cells = <1>;
-			images {
-				sysfw.bin {
-					description = "sysfw";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-					    filename = "sysfw.bin_fs";
-					};
-				};
-				board-cfg.bin {
-					description = "board-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					board-cfg {
-						filename = "board-cfg.bin";
-						type = "blob-ext";
-					};
-
-				};
-				pm-cfg.bin {
-					description = "pm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					pm-cfg {
-						filename = "pm-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				rm-cfg.bin {
-					description = "rm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					rm-cfg {
-						filename = "rm-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-				sec-cfg.bin {
-					description = "sec-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					sec-cfg {
-						filename = "sec-cfg.bin";
-						type = "blob-ext";
-					};
-				};
-			};
-		};
+		insert-template = <&itb_unsigned_template>;
 	};
 };
 
@@ -237,55 +111,15 @@
 	itb_gp {
 		filename = "sysfw-j721e-gp-evm.itb";
 		symlink = "sysfw.itb";
+		insert-template = <&itb_unsigned_template>;
+
 		fit {
-			description = "SYSFW and Config fragments";
-			#address-cells = <1>;
 			images {
 				sysfw.bin {
-					description = "sysfw";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
 					blob-ext {
 					    filename = "sysfw.bin_gp";
 					};
 				};
-				board-cfg.bin {
-					description = "board-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "board-cfg.bin";
-					};
-				};
-				pm-cfg.bin {
-					description = "pm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "pm-cfg.bin";
-					};
-				};
-				rm-cfg.bin {
-					description = "rm-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "rm-cfg.bin";
-					};
-				};
-				sec-cfg.bin {
-					description = "sec-cfg";
-					type = "firmware";
-					arch = "arm";
-					compression = "none";
-					blob-ext {
-						filename = "sec-cfg.bin";
-					};
-				};
 			};
 		};
 	};
@@ -294,11 +128,9 @@
 
 #ifdef CONFIG_TARGET_J721E_A72_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_J721E_EVM_DTB "spl/dts/k3-j721e-common-proc-board.dtb"
 #define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
 
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define J721E_EVM_DTB "u-boot.dtb"
 #define J721E_SK_DTB "arch/arm/dts/k3-j721e-sk.dtb"
 
@@ -310,55 +142,11 @@
 		};
 	};
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					ti-secure {
 						content = <&dm>;
 						keyfile = "custMpk.pem";
@@ -368,24 +156,6 @@
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-j721e-common-proc-board";
 					type = "flat_dt";
@@ -439,29 +209,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
-
+		insert-template = <&u_boot_template>;
 		fit {
-			description = "FIT image with multiple configurations";
 
 			images {
 				uboot {
-					description = "U-Boot for j721e board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for J721E Board";
 				};
 
 				fdt-0 {
@@ -524,67 +277,16 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-j721e-common-proc-board";
 					type = "flat_dt";
@@ -629,26 +331,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for j721e board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for J721E Board";
 				};
 
 				fdt-0 {
diff --git a/arch/arm/dts/k3-j721s2-binman.dtsi b/arch/arm/dts/k3-j721s2-binman.dtsi
index 5bca4e94ec..3922007b3b 100644
--- a/arch/arm/dts/k3-j721s2-binman.dtsi
+++ b/arch/arm/dts/k3-j721s2-binman.dtsi
@@ -141,11 +141,9 @@
 
 #ifdef CONFIG_TARGET_J721S2_A72_EVM
 
-#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_J721S2_EVM_DTB "spl/dts/k3-j721s2-common-proc-board.dtb"
 #define SPL_AM68_SK_DTB "spl/dts/k3-am68-sk-base-board.dtb"
 
-#define UBOOT_NODTB "u-boot-nodtb.bin"
 #define J721S2_EVM_DTB "u-boot.dtb"
 #define AM68_SK_DTB "arch/arm/dts/k3-am68-sk-base-board.dtb"
 
@@ -157,55 +155,11 @@
 		};
 	};
 	ti-spl {
-		filename = "tispl.bin";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					ti-secure {
-						content = <&atf>;
-						keyfile = "custMpk.pem";
-					};
-					atf: atf-bl31 {
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					ti-secure {
-						content = <&tee>;
-						keyfile = "custMpk.pem";
-					};
-					tee: tee-os {
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					ti-secure {
 						content = <&dm>;
 						keyfile = "custMpk.pem";
@@ -215,23 +169,6 @@
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_spl_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_spl_nodtb: blob-ext {
-						filename = SPL_NODTB;
-					};
-				};
-
 				fdt-0 {
 					description = "k3-j721s2-common-proc-board";
 					type = "flat_dt";
@@ -285,29 +222,12 @@
 
 &binman {
 	u-boot {
-		filename = "u-boot.img";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for J721S2 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					ti-secure {
-						content = <&u_boot_nodtb>;
-						keyfile = "custMpk.pem";
-					};
-					u_boot_nodtb: u-boot-nodtb {
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for J721S2 Board";
 				};
 
 				fdt-0 {
@@ -371,67 +291,16 @@
 
 &binman {
 	ti-spl_unsigned {
-		filename = "tispl.bin_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&ti_spl_unsigned_template>;
 
 		fit {
-			description = "Configuration to load ATF and SPL";
-			#address-cells = <1>;
-
 			images {
-
-				atf {
-					description = "ARM Trusted Firmware";
-					type = "firmware";
-					arch = "arm64";
-					compression = "none";
-					os = "arm-trusted-firmware";
-					load = <CONFIG_K3_ATF_LOAD_ADDR>;
-					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
-					atf-bl31 {
-						filename = "bl31.bin";
-					};
-				};
-
-				tee {
-					description = "OP-TEE";
-					type = "tee";
-					arch = "arm64";
-					compression = "none";
-					os = "tee";
-					load = <0x9e800000>;
-					entry = <0x9e800000>;
-					tee-os {
-						filename = "tee-raw.bin";
-					};
-				};
-
 				dm {
-					description = "DM binary";
-					type = "firmware";
-					arch = "arm32";
-					compression = "none";
-					os = "DM";
-					load = <0x89000000>;
-					entry = <0x89000000>;
 					blob-ext {
 						filename = "ti-dm.bin";
 					};
 				};
 
-				spl {
-					description = "SPL (64-bit)";
-					type = "standalone";
-					os = "U-Boot";
-					arch = "arm64";
-					compression = "none";
-					load = <CONFIG_SPL_TEXT_BASE>;
-					entry = <CONFIG_SPL_TEXT_BASE>;
-					blob {
-						filename = "spl/u-boot-spl-nodtb.bin";
-					};
-				};
-
 				fdt-0 {
 					description = "k3-j721s2-common-proc-board";
 					type = "flat_dt";
@@ -475,26 +344,12 @@
 
 &binman {
 	u-boot_unsigned {
-		filename = "u-boot.img_unsigned";
-		pad-byte = <0xff>;
+		insert-template = <&u_boot_unsigned_template>;
 
 		fit {
-			description = "FIT image with multiple configurations";
-
 			images {
 				uboot {
-					description = "U-Boot for J721S2 board";
-					type = "firmware";
-					os = "u-boot";
-					arch = "arm";
-					compression = "none";
-					load = <CONFIG_TEXT_BASE>;
-					blob {
-						filename = UBOOT_NODTB;
-					};
-					hash {
-						algo = "crc32";
-					};
+					description = "U-Boot for J721S2 Board";
 				};
 
 				fdt-0 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
@ 2023-11-15 15:52   ` Andrew Davis
  2023-11-16  5:08     ` Neha Malcom Francis
  2023-11-16 16:04   ` Simon Glass
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Andrew Davis @ 2023-11-15 15:52 UTC (permalink / raw)
  To: Neha Malcom Francis, sjg, marcel.ziswiler
  Cc: u-boot, vigneshr, nm, u-kumar1, kamlesh, m-chawdhry, mkorpershoek

On 11/15/23 4:10 AM, Neha Malcom Francis wrote:
> Reduce redundancy in code by using templates to generate the A72 boot
> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
> (for legacy boot following devices J721E and AM65x).
> 
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
>   arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>   .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>   arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>   arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>   arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>   arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>   arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>   arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>   8 files changed, 54 insertions(+), 1488 deletions(-)

1488 deletions, nice!

Minor question, why was `ti-secure` not factored out of `dm` nodes like
it was for `atf`/`tee` nodes? Guessing it has to do with not all SoCs
needing this blob and signing nothing results in something, which
messes up the 0 size check when loading it, but it wasn't clear to me.

Anyway,

Acked-by: Andrew Davis <afd@ti.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/2] Cleanup K3 binman FIT images
  2023-11-15 10:10 [PATCH 0/2] Cleanup K3 binman FIT images Neha Malcom Francis
  2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
  2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
@ 2023-11-15 17:33 ` Marcel Ziswiler
  2023-11-16  5:08   ` Neha Malcom Francis
  2 siblings, 1 reply; 15+ messages in thread
From: Marcel Ziswiler @ 2023-11-15 17:33 UTC (permalink / raw)
  To: n-francis@ti.com, sjg@chromium.org
  Cc: kamlesh@ti.com, u-kumar1@ti.com, m-chawdhry@ti.com, afd@ti.com,
	mkorpershoek@baylibre.com, nm@ti.com, vigneshr@ti.com,
	u-boot@lists.denx.de

Hi Neha

On Wed, 2023-11-15 at 15:40 +0530, Neha Malcom Francis wrote:
> Instead of duplicating the same FIT formats over and over again for
> different K3 devices, make use of the templating support to have FIT
> templates for the same. 
> 
> Note: I purposely did not add the trial to template out the non-FIT
> bootloader image (tiboot3.bin) as it reduces the readibility and
> understandability of how the image is packaged because of the various
> different boot flows.
> 
> Boot logs:
> https://gist.github.com/nehamalcom/9abe7955ebb4a251923e76412834c886

For the whole series:

Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

> Neha Malcom Francis (2):
>   arm: dts: k3-binman: Add support for FIT templates
>   arm: dts: k3-*-binman: Move to using templated FITs
> 
>  arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>  .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>  arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>  arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>  arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>  arch/arm/dts/k3-binman.dtsi                   | 327 +++++++++++++++++
>  arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>  arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>  arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>  9 files changed, 381 insertions(+), 1488 deletions(-)

Thanks!

Cheers

Marcel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-15 15:52   ` Andrew Davis
@ 2023-11-16  5:08     ` Neha Malcom Francis
  0 siblings, 0 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-16  5:08 UTC (permalink / raw)
  To: Andrew Davis, sjg, marcel.ziswiler
  Cc: u-boot, vigneshr, nm, u-kumar1, kamlesh, m-chawdhry, mkorpershoek

Hi Andrew,

On 15/11/23 21:22, Andrew Davis wrote:
> On 11/15/23 4:10 AM, Neha Malcom Francis wrote:
>> Reduce redundancy in code by using templates to generate the A72 boot
>> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
>> (for legacy boot following devices J721E and AM65x).
>>
>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>> ---
>>   arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>>   .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>>   arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>>   arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>>   arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>>   arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>>   arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>>   arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>>   8 files changed, 54 insertions(+), 1488 deletions(-)
> 
> 1488 deletions, nice!
> 
> Minor question, why was `ti-secure` not factored out of `dm` nodes like
> it was for `atf`/`tee` nodes? Guessing it has to do with not all SoCs
> needing this blob and signing nothing results in something, which
> messes up the 0 size check when loading it, but it wasn't clear to me.
> 

Yes that's right! It ends up being non-zero for devices that don't have DM and 
DM load fails.

> Anyway,
> 
> Acked-by: Andrew Davis <afd@ti.com>

-- 
Thanking You
Neha Malcom Francis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/2] Cleanup K3 binman FIT images
  2023-11-15 17:33 ` [PATCH 0/2] Cleanup K3 binman FIT images Marcel Ziswiler
@ 2023-11-16  5:08   ` Neha Malcom Francis
  0 siblings, 0 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-16  5:08 UTC (permalink / raw)
  To: Marcel Ziswiler, sjg@chromium.org
  Cc: kamlesh@ti.com, u-kumar1@ti.com, m-chawdhry@ti.com, afd@ti.com,
	mkorpershoek@baylibre.com, nm@ti.com, vigneshr@ti.com,
	u-boot@lists.denx.de

Hi Marcel,

On 15/11/23 23:03, Marcel Ziswiler wrote:
> Hi Neha
> 
> On Wed, 2023-11-15 at 15:40 +0530, Neha Malcom Francis wrote:
>> Instead of duplicating the same FIT formats over and over again for
>> different K3 devices, make use of the templating support to have FIT
>> templates for the same.
>>
>> Note: I purposely did not add the trial to template out the non-FIT
>> bootloader image (tiboot3.bin) as it reduces the readibility and
>> understandability of how the image is packaged because of the various
>> different boot flows.
>>
>> Boot logs:
>> https://gist.github.com/nehamalcom/9abe7955ebb4a251923e76412834c886
> 
> For the whole series:
> 
> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> 

Thanks for testing!

>> Neha Malcom Francis (2):
>>    arm: dts: k3-binman: Add support for FIT templates
>>    arm: dts: k3-*-binman: Move to using templated FITs
>>
>>   arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>>   .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>>   arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>>   arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>>   arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>>   arch/arm/dts/k3-binman.dtsi                   | 327 +++++++++++++++++
>>   arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>>   arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>>   arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>>   9 files changed, 381 insertions(+), 1488 deletions(-)
> 
> Thanks!
> 
> Cheers
> 
> Marcel

-- 
Thanking You
Neha Malcom Francis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates
  2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
@ 2023-11-16 16:03   ` Simon Glass
  2023-11-16 16:43     ` Marcel Ziswiler
  2023-11-22 20:50   ` Tom Rini
  1 sibling, 1 reply; 15+ messages in thread
From: Simon Glass @ 2023-11-16 16:03 UTC (permalink / raw)
  To: Neha Malcom Francis
  Cc: marcel.ziswiler, u-boot, vigneshr, nm, u-kumar1, kamlesh,
	m-chawdhry, afd, mkorpershoek

Hi Neha,

On Wed, 15 Nov 2023 at 03:10, Neha Malcom Francis <n-francis@ti.com> wrote:
>
> Add templates for FIT images used extensively across K3 boards with most
> of the code common. This includes the FIT portions of:
>         - tispl.bin
>         - u-boot.img
>         - sysfw.itb (in case of legacy boot flow)
>
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
>  arch/arm/dts/k3-binman.dtsi | 327 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 327 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

What is the DM binary?

Regards,
Simon

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
  2023-11-15 15:52   ` Andrew Davis
@ 2023-11-16 16:04   ` Simon Glass
  2023-11-22  5:20   ` Manorit Chawdhry
  2023-11-22 20:50   ` Tom Rini
  3 siblings, 0 replies; 15+ messages in thread
From: Simon Glass @ 2023-11-16 16:04 UTC (permalink / raw)
  To: Neha Malcom Francis
  Cc: marcel.ziswiler, u-boot, vigneshr, nm, u-kumar1, kamlesh,
	m-chawdhry, afd, mkorpershoek

Hi Neha,

On Wed, 15 Nov 2023 at 03:10, Neha Malcom Francis <n-francis@ti.com> wrote:
>
> Reduce redundancy in code by using templates to generate the A72 boot
> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
> (for legacy boot following devices J721E and AM65x).
>
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
>  arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>  .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>  arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>  arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>  arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>  arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>  arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>  arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>  8 files changed, 54 insertions(+), 1488 deletions(-)
>

Gosh that's a huge improvement!

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates
  2023-11-16 16:03   ` Simon Glass
@ 2023-11-16 16:43     ` Marcel Ziswiler
  2023-11-17  5:15       ` Neha Malcom Francis
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Ziswiler @ 2023-11-16 16:43 UTC (permalink / raw)
  To: sjg@chromium.org, n-francis@ti.com
  Cc: kamlesh@ti.com, u-kumar1@ti.com, m-chawdhry@ti.com, afd@ti.com,
	mkorpershoek@baylibre.com, nm@ti.com, vigneshr@ti.com,
	u-boot@lists.denx.de

Hi Simon

On Thu, 2023-11-16 at 09:03 -0700, Simon Glass wrote:
> Hi Neha,
> 
> On Wed, 15 Nov 2023 at 03:10, Neha Malcom Francis <n-francis@ti.com> wrote:
> > 
> > Add templates for FIT images used extensively across K3 boards with most
> > of the code common. This includes the FIT portions of:
> >         - tispl.bin
> >         - u-boot.img
> >         - sysfw.itb (in case of legacy boot flow)
> > 
> > Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> > ---
> >  arch/arm/dts/k3-binman.dtsi | 327 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 327 insertions(+)
> > 
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> What is the DM binary?

From [1]:

DM - Device Management firmware also called TI System Control Interface server (TISCI Server) - This component
purely plays the role of managing device resources such as power, clock, interrupts, dma etc. This firmware
runs on a dedicated or multi-use microcontroller outside the security enclave.

[1] https://docs.u-boot.org/en/latest/board/ti/am62x_sk.html

> Regards,
> Simon

Cheers

Marcel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates
  2023-11-16 16:43     ` Marcel Ziswiler
@ 2023-11-17  5:15       ` Neha Malcom Francis
  0 siblings, 0 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-17  5:15 UTC (permalink / raw)
  To: Marcel Ziswiler, sjg@chromium.org
  Cc: kamlesh@ti.com, u-kumar1@ti.com, m-chawdhry@ti.com, afd@ti.com,
	mkorpershoek@baylibre.com, nm@ti.com, vigneshr@ti.com,
	u-boot@lists.denx.de

Hi Marcel,

On 16/11/23 22:13, Marcel Ziswiler wrote:
> Hi Simon
> 
> On Thu, 2023-11-16 at 09:03 -0700, Simon Glass wrote:
>> Hi Neha,
>>
>> On Wed, 15 Nov 2023 at 03:10, Neha Malcom Francis <n-francis@ti.com> wrote:
>>>
>>> Add templates for FIT images used extensively across K3 boards with most
>>> of the code common. This includes the FIT portions of:
>>>          - tispl.bin
>>>          - u-boot.img
>>>          - sysfw.itb (in case of legacy boot flow)
>>>
>>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>>> ---
>>>   arch/arm/dts/k3-binman.dtsi | 327 ++++++++++++++++++++++++++++++++++++
>>>   1 file changed, 327 insertions(+)
>>>
>>
>> Reviewed-by: Simon Glass <sjg@chromium.org>
>>
>> What is the DM binary?
> 
>  From [1]:
> 
> DM - Device Management firmware also called TI System Control Interface server (TISCI Server) - This component
> purely plays the role of managing device resources such as power, clock, interrupts, dma etc. This firmware
> runs on a dedicated or multi-use microcontroller outside the security enclave.
> 
> [1] https://docs.u-boot.org/en/latest/board/ti/am62x_sk.html
> 
>> Regards,
>> Simon
> 
> Cheers
> 
> Marcel

Thanks for explaining!

-- 
Thanking You
Neha Malcom Francis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
  2023-11-15 15:52   ` Andrew Davis
  2023-11-16 16:04   ` Simon Glass
@ 2023-11-22  5:20   ` Manorit Chawdhry
  2023-11-22  5:52     ` Neha Malcom Francis
  2023-11-22 20:50   ` Tom Rini
  3 siblings, 1 reply; 15+ messages in thread
From: Manorit Chawdhry @ 2023-11-22  5:20 UTC (permalink / raw)
  To: Neha Malcom Francis
  Cc: sjg, marcel.ziswiler, u-boot, vigneshr, nm, u-kumar1, kamlesh,
	afd, mkorpershoek

Hi Neha,

On 15:40-20231115, Neha Malcom Francis wrote:
> Reduce redundancy in code by using templates to generate the A72 boot
> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
> (for legacy boot following devices J721E and AM65x).
> 
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
>  arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>  .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>  arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>  arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>  arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>  arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>  arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>  arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>  8 files changed, 54 insertions(+), 1488 deletions(-)
> 
> diff --git a/arch/arm/dts/k3-am625-sk-binman.dtsi b/arch/arm/dts/k3-am625-sk-binman.dtsi
> index 41277bf4bf..b7b5368886 100644
> --- a/arch/arm/dts/k3-am625-sk-binman.dtsi
> +++ b/arch/arm/dts/k3-am625-sk-binman.dtsi
> @@ -141,10 +141,7 @@
>  
>  #ifdef CONFIG_TARGET_AM625_A53_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_AM625_SK_DTB "spl/dts/k3-am625-sk.dtb"
> -
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define AM625_SK_DTB "u-boot.dtb"
>  
>  &binman {
> @@ -155,55 +152,11 @@
>  		};
>  	};
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};

For ATF/OP-TEE Firewalling, can you keep these nodes intact? Just keep
the ti-secure inside atf and tee nodes similar to how you have done that
for DM as all the ATF/OPTEE nodes in the tispl.bin would be different
for devices w.r.t certifications but we can still use templates for
other common stuff.

With this change,

Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>

Regards,
Manorit
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					ti-secure {
>  						content = <&dm>;
>  						keyfile = "custMpk.pem";
> @@ -213,23 +166,6 @@
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am625-sk";
>  					type = "flat_dt";
> @@ -263,29 +199,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM625 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM625 Board";
>  				};
>  
>  				fdt-0 {
> @@ -323,67 +242,17 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
>  
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob {
> -						filename = "spl/u-boot-spl-nodtb.bin";
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am625-sk";
>  					type = "flat_dt";
> @@ -411,26 +280,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM625 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM625 Board";
>  				};
>  
>  				fdt-0 {
> diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi b/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
> index 089b2a5f5c..eafd3310bb 100644
> --- a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
> +++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
> @@ -214,10 +214,7 @@
>  
>  #ifdef CONFIG_TARGET_VERDIN_AM62_A53
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_VERDIN_AM62_DTB "spl/dts/k3-am625-verdin-wifi-dev.dtb"
> -
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define VERDIN_AM62_DTB "u-boot.dtb"
>  
>  &binman {
> @@ -228,54 +225,12 @@
>  		};
>  	};
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
>  
>  			images {
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					ti-secure {
>  						content = <&dm>;
>  						keyfile = "custMpk.pem";
> @@ -285,23 +240,6 @@
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am625-verdin-wifi-dev";
>  					type = "flat_dt";
> @@ -333,29 +271,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM625 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot fot AM625 Verdin Board";
>  				};
>  
>  				fdt-0 {
> @@ -392,66 +313,16 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob {
> -						filename = "spl/u-boot-spl-nodtb.bin";
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am625-verdin-wifi-dev";
>  					type = "flat_dt";
> @@ -479,26 +350,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM625 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM625 Verdin Board";
>  				};
>  
>  				fdt-0 {
> diff --git a/arch/arm/dts/k3-am62a-sk-binman.dtsi b/arch/arm/dts/k3-am62a-sk-binman.dtsi
> index de09430d93..c5e027d44d 100644
> --- a/arch/arm/dts/k3-am62a-sk-binman.dtsi
> +++ b/arch/arm/dts/k3-am62a-sk-binman.dtsi
> @@ -144,10 +144,7 @@
>  
>  #ifdef CONFIG_TARGET_AM62A7_A53_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_AM62A7_SK_DTB "spl/dts/k3-am62a7-sk.dtb"
> -
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define AM62A7_SK_DTB "u-boot.dtb"
>  
>  &binman {
> @@ -158,55 +155,11 @@
>  		};
>  	};
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					ti-secure {
>  						content = <&dm>;
>  						keyfile = "custMpk.pem";
> @@ -216,23 +169,6 @@
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am62a7-sk";
>  					type = "flat_dt";
> @@ -266,29 +202,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM62Ax board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM62Ax Board";
>  				};
>  
>  				fdt-0 {
> @@ -326,67 +245,16 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob {
> -						filename = "spl/u-boot-spl-nodtb.bin";
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am62a7-sk";
>  					type = "flat_dt";
> @@ -414,26 +282,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM62Ax board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM62Ax Board";
>  				};
>  
>  				fdt-0 {
> diff --git a/arch/arm/dts/k3-am64x-binman.dtsi b/arch/arm/dts/k3-am64x-binman.dtsi
> index a5e54006b4..88df214954 100644
> --- a/arch/arm/dts/k3-am64x-binman.dtsi
> +++ b/arch/arm/dts/k3-am64x-binman.dtsi
> @@ -118,87 +118,27 @@
>  
>  #ifdef CONFIG_TARGET_AM642_A53_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_AM642_EVM_DTB "spl/dts/k3-am642-evm.dtb"
>  #define SPL_AM642_SK_DTB "spl/dts/k3-am642-sk.dtb"
>  
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define AM642_EVM_DTB "u-boot.dtb"
>  #define AM642_SK_DTB "arch/arm/dts/k3-am642-sk.dtb"
>  
>  &binman {
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
>  			description = "Configuration to load ATF and SPL";
>  			#address-cells = <1>;
>  
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "/dev/null";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
>  
>  				fdt-0 {
>  					description = "k3-am642-evm";
> @@ -254,29 +194,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM64 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM64 Board";
>  				};
>  
>  				fdt-0 {
> @@ -340,65 +263,17 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
>  
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "/dev/null";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob {
> -						filename = "spl/u-boot-spl-nodtb.bin";
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am642-evm";
>  					type = "flat_dt";
> @@ -443,26 +318,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM64 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM64 Board";
>  				};
>  
>  				fdt-0 {
> diff --git a/arch/arm/dts/k3-am65x-binman.dtsi b/arch/arm/dts/k3-am65x-binman.dtsi
> index 59605ca597..8cc24da1f3 100644
> --- a/arch/arm/dts/k3-am65x-binman.dtsi
> +++ b/arch/arm/dts/k3-am65x-binman.dtsi
> @@ -42,77 +42,7 @@
>  	};
>  	itb {
>  		filename = "sysfw-am65x_sr2-hs-evm.itb";
> -		fit {
> -			description = "SYSFW and Config fragments";
> -			#address-cells = <1>;
> -			images {
> -				sysfw.bin {
> -					description = "sysfw";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -					    filename = "sysfw.bin";
> -					};
> -				};
> -				board-cfg.bin {
> -					description = "board-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&board_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					board_cfg: board-cfg {
> -						filename = "board-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				pm-cfg.bin {
> -					description = "pm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&pm_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					pm_cfg: pm-cfg {
> -						filename = "pm-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				rm-cfg.bin {
> -					description = "rm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&rm_cfg>;
> -						keyfile = "custMpk.pem";\
> -					};
> -					rm_cfg: rm-cfg {
> -						filename = "rm-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				sec-cfg.bin {
> -					description = "sec-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&sec_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					sec_cfg: sec-cfg {
> -						filename = "sec-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -			};
> -		};
> +		insert-template = <&itb_template>;
>  	};
>  };
>  
> @@ -149,55 +79,14 @@
>  	itb_gp {
>  		filename = "sysfw-am65x_sr2-gp-evm.itb";
>  		symlink = "sysfw.itb";
> +		insert-template = <&itb_unsigned_template>;
>  		fit {
> -			description = "SYSFW and Config fragments";
> -			#address-cells = <1>;
>  			images {
>  				sysfw.bin {
> -					description = "sysfw";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
>  					blob-ext {
>  					    filename = "sysfw.bin_gp";
>  					};
>  				};
> -				board-cfg.bin {
> -					description = "board-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "board-cfg.bin";
> -					};
> -				};
> -				pm-cfg.bin {
> -					description = "pm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "pm-cfg.bin";
> -					};
> -				};
> -				rm-cfg.bin {
> -					description = "rm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "rm-cfg.bin";
> -					};
> -				};
> -				sec-cfg.bin {
> -					description = "sec-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "sec-cfg.bin";
> -					};
> -				};
>  			};
>  		};
>  	};
> @@ -206,86 +95,22 @@
>  
>  #ifdef CONFIG_TARGET_AM654_A53_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_AM654_EVM_DTB "spl/dts/k3-am654-base-board.dtb"
> -
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define AM654_EVM_DTB "u-boot.dtb"
>  
>  &binman {
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
>  
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "/dev/null";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-am654-base-board";
>  					type = "flat_dt";
> @@ -317,29 +142,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM65 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM65 Board";
>  				};
>  
>  				fdt-0 {
> @@ -378,67 +186,16 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "/dev/null";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-j721e-common-proc-board";
>  					type = "flat_dt";
> @@ -466,26 +223,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for AM65 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for AM65 Board";
>  				};
>  
>  				fdt-0 {
> diff --git a/arch/arm/dts/k3-j7200-binman.dtsi b/arch/arm/dts/k3-j7200-binman.dtsi
> index 14f7dea65e..10c9d6cba7 100644
> --- a/arch/arm/dts/k3-j7200-binman.dtsi
> +++ b/arch/arm/dts/k3-j7200-binman.dtsi
> @@ -180,10 +180,7 @@
>  
>  #ifdef CONFIG_TARGET_J7200_A72_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_J7200_EVM_DTB "spl/dts/k3-j7200-common-proc-board.dtb"
> -
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define J7200_EVM_DTB "u-boot.dtb"
>  
>  &binman {
> @@ -194,82 +191,20 @@
>  		};
>  	};
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					ti-secure {
>  						content = <&dm>;
>  						keyfile = "custMpk.pem";
>  					};
> -
>  					dm: blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-j7200-common-proc-board";
>  					type = "flat_dt";
> @@ -302,29 +237,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for J7200 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for J7200 Board";
>  				};
>  
>  				fdt-0 {
> @@ -362,67 +280,16 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-1 {
>  					description = "k3-j7200-common-proc-board";
>  					type = "flat_dt";
> @@ -450,26 +317,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for J7200 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for J7200 Board";
>  				};
>  
>  				fdt-1 {
> diff --git a/arch/arm/dts/k3-j721e-binman.dtsi b/arch/arm/dts/k3-j721e-binman.dtsi
> index 4f566c21a9..5ddb474e3a 100644
> --- a/arch/arm/dts/k3-j721e-binman.dtsi
> +++ b/arch/arm/dts/k3-j721e-binman.dtsi
> @@ -42,78 +42,7 @@
>  	};
>  	itb {
>  		filename = "sysfw-j721e_sr1_1-hs-evm.itb";
> -		fit {
> -			description = "SYSFW and Config fragments";
> -			#address-cells = <1>;
> -			images {
> -				sysfw.bin {
> -					description = "sysfw";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -					    filename = "sysfw.bin";
> -					};
> -				};
> -				board-cfg.bin {
> -					description = "board-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&board_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					board_cfg: board-cfg {
> -						filename = "board-cfg.bin";
> -						type = "blob-ext";
> -					};
> -
> -				};
> -				pm-cfg.bin {
> -					description = "pm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&pm_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					pm_cfg: pm-cfg {
> -						filename = "pm-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				rm-cfg.bin {
> -					description = "rm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&rm_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					rm_cfg: rm-cfg {
> -						filename = "rm-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				sec-cfg.bin {
> -					description = "sec-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					ti-secure {
> -						content = <&sec_cfg>;
> -						keyfile = "custMpk.pem";
> -					};
> -					sec_cfg: sec-cfg {
> -						filename = "sec-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -			};
> -		};
> +		insert-template = <&itb_template>;
>  	};
>  };
>  
> @@ -145,62 +74,7 @@
>  	};
>  	itb_fs {
>  		filename = "sysfw-j721e_sr2-hs-fs-evm.itb";
> -		fit {
> -			description = "SYSFW and Config fragments";
> -			#address-cells = <1>;
> -			images {
> -				sysfw.bin {
> -					description = "sysfw";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -					    filename = "sysfw.bin_fs";
> -					};
> -				};
> -				board-cfg.bin {
> -					description = "board-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					board-cfg {
> -						filename = "board-cfg.bin";
> -						type = "blob-ext";
> -					};
> -
> -				};
> -				pm-cfg.bin {
> -					description = "pm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					pm-cfg {
> -						filename = "pm-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				rm-cfg.bin {
> -					description = "rm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					rm-cfg {
> -						filename = "rm-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -				sec-cfg.bin {
> -					description = "sec-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					sec-cfg {
> -						filename = "sec-cfg.bin";
> -						type = "blob-ext";
> -					};
> -				};
> -			};
> -		};
> +		insert-template = <&itb_unsigned_template>;
>  	};
>  };
>  
> @@ -237,55 +111,15 @@
>  	itb_gp {
>  		filename = "sysfw-j721e-gp-evm.itb";
>  		symlink = "sysfw.itb";
> +		insert-template = <&itb_unsigned_template>;
> +
>  		fit {
> -			description = "SYSFW and Config fragments";
> -			#address-cells = <1>;
>  			images {
>  				sysfw.bin {
> -					description = "sysfw";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
>  					blob-ext {
>  					    filename = "sysfw.bin_gp";
>  					};
>  				};
> -				board-cfg.bin {
> -					description = "board-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "board-cfg.bin";
> -					};
> -				};
> -				pm-cfg.bin {
> -					description = "pm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "pm-cfg.bin";
> -					};
> -				};
> -				rm-cfg.bin {
> -					description = "rm-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "rm-cfg.bin";
> -					};
> -				};
> -				sec-cfg.bin {
> -					description = "sec-cfg";
> -					type = "firmware";
> -					arch = "arm";
> -					compression = "none";
> -					blob-ext {
> -						filename = "sec-cfg.bin";
> -					};
> -				};
>  			};
>  		};
>  	};
> @@ -294,11 +128,9 @@
>  
>  #ifdef CONFIG_TARGET_J721E_A72_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_J721E_EVM_DTB "spl/dts/k3-j721e-common-proc-board.dtb"
>  #define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
>  
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define J721E_EVM_DTB "u-boot.dtb"
>  #define J721E_SK_DTB "arch/arm/dts/k3-j721e-sk.dtb"
>  
> @@ -310,55 +142,11 @@
>  		};
>  	};
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					ti-secure {
>  						content = <&dm>;
>  						keyfile = "custMpk.pem";
> @@ -368,24 +156,6 @@
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-j721e-common-proc-board";
>  					type = "flat_dt";
> @@ -439,29 +209,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> -
> +		insert-template = <&u_boot_template>;
>  		fit {
> -			description = "FIT image with multiple configurations";
>  
>  			images {
>  				uboot {
> -					description = "U-Boot for j721e board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for J721E Board";
>  				};
>  
>  				fdt-0 {
> @@ -524,67 +277,16 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-j721e-common-proc-board";
>  					type = "flat_dt";
> @@ -629,26 +331,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for j721e board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for J721E Board";
>  				};
>  
>  				fdt-0 {
> diff --git a/arch/arm/dts/k3-j721s2-binman.dtsi b/arch/arm/dts/k3-j721s2-binman.dtsi
> index 5bca4e94ec..3922007b3b 100644
> --- a/arch/arm/dts/k3-j721s2-binman.dtsi
> +++ b/arch/arm/dts/k3-j721s2-binman.dtsi
> @@ -141,11 +141,9 @@
>  
>  #ifdef CONFIG_TARGET_J721S2_A72_EVM
>  
> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>  #define SPL_J721S2_EVM_DTB "spl/dts/k3-j721s2-common-proc-board.dtb"
>  #define SPL_AM68_SK_DTB "spl/dts/k3-am68-sk-base-board.dtb"
>  
> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>  #define J721S2_EVM_DTB "u-boot.dtb"
>  #define AM68_SK_DTB "arch/arm/dts/k3-am68-sk-base-board.dtb"
>  
> @@ -157,55 +155,11 @@
>  		};
>  	};
>  	ti-spl {
> -		filename = "tispl.bin";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					ti-secure {
> -						content = <&atf>;
> -						keyfile = "custMpk.pem";
> -					};
> -					atf: atf-bl31 {
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					ti-secure {
> -						content = <&tee>;
> -						keyfile = "custMpk.pem";
> -					};
> -					tee: tee-os {
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					ti-secure {
>  						content = <&dm>;
>  						keyfile = "custMpk.pem";
> @@ -215,23 +169,6 @@
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_spl_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_spl_nodtb: blob-ext {
> -						filename = SPL_NODTB;
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-j721s2-common-proc-board";
>  					type = "flat_dt";
> @@ -285,29 +222,12 @@
>  
>  &binman {
>  	u-boot {
> -		filename = "u-boot.img";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for J721S2 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					ti-secure {
> -						content = <&u_boot_nodtb>;
> -						keyfile = "custMpk.pem";
> -					};
> -					u_boot_nodtb: u-boot-nodtb {
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for J721S2 Board";
>  				};
>  
>  				fdt-0 {
> @@ -371,67 +291,16 @@
>  
>  &binman {
>  	ti-spl_unsigned {
> -		filename = "tispl.bin_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&ti_spl_unsigned_template>;
>  
>  		fit {
> -			description = "Configuration to load ATF and SPL";
> -			#address-cells = <1>;
> -
>  			images {
> -
> -				atf {
> -					description = "ARM Trusted Firmware";
> -					type = "firmware";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "arm-trusted-firmware";
> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
> -					atf-bl31 {
> -						filename = "bl31.bin";
> -					};
> -				};
> -
> -				tee {
> -					description = "OP-TEE";
> -					type = "tee";
> -					arch = "arm64";
> -					compression = "none";
> -					os = "tee";
> -					load = <0x9e800000>;
> -					entry = <0x9e800000>;
> -					tee-os {
> -						filename = "tee-raw.bin";
> -					};
> -				};
> -
>  				dm {
> -					description = "DM binary";
> -					type = "firmware";
> -					arch = "arm32";
> -					compression = "none";
> -					os = "DM";
> -					load = <0x89000000>;
> -					entry = <0x89000000>;
>  					blob-ext {
>  						filename = "ti-dm.bin";
>  					};
>  				};
>  
> -				spl {
> -					description = "SPL (64-bit)";
> -					type = "standalone";
> -					os = "U-Boot";
> -					arch = "arm64";
> -					compression = "none";
> -					load = <CONFIG_SPL_TEXT_BASE>;
> -					entry = <CONFIG_SPL_TEXT_BASE>;
> -					blob {
> -						filename = "spl/u-boot-spl-nodtb.bin";
> -					};
> -				};
> -
>  				fdt-0 {
>  					description = "k3-j721s2-common-proc-board";
>  					type = "flat_dt";
> @@ -475,26 +344,12 @@
>  
>  &binman {
>  	u-boot_unsigned {
> -		filename = "u-boot.img_unsigned";
> -		pad-byte = <0xff>;
> +		insert-template = <&u_boot_unsigned_template>;
>  
>  		fit {
> -			description = "FIT image with multiple configurations";
> -
>  			images {
>  				uboot {
> -					description = "U-Boot for J721S2 board";
> -					type = "firmware";
> -					os = "u-boot";
> -					arch = "arm";
> -					compression = "none";
> -					load = <CONFIG_TEXT_BASE>;
> -					blob {
> -						filename = UBOOT_NODTB;
> -					};
> -					hash {
> -						algo = "crc32";
> -					};
> +					description = "U-Boot for J721S2 Board";
>  				};
>  
>  				fdt-0 {
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-22  5:20   ` Manorit Chawdhry
@ 2023-11-22  5:52     ` Neha Malcom Francis
  0 siblings, 0 replies; 15+ messages in thread
From: Neha Malcom Francis @ 2023-11-22  5:52 UTC (permalink / raw)
  To: Manorit Chawdhry
  Cc: sjg, marcel.ziswiler, u-boot, vigneshr, nm, u-kumar1, kamlesh,
	afd, mkorpershoek

Hi Manorit

On 22/11/23 10:50, Manorit Chawdhry wrote:
> Hi Neha,
> 
> On 15:40-20231115, Neha Malcom Francis wrote:
>> Reduce redundancy in code by using templates to generate the A72 boot
>> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
>> (for legacy boot following devices J721E and AM65x).
>>
>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>> ---
>>   arch/arm/dts/k3-am625-sk-binman.dtsi          | 157 +--------
>>   .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +-------
>>   arch/arm/dts/k3-am62a-sk-binman.dtsi          | 158 +--------
>>   arch/arm/dts/k3-am64x-binman.dtsi             | 151 +-------
>>   arch/arm/dts/k3-am65x-binman.dtsi             | 273 +-------------
>>   arch/arm/dts/k3-j7200-binman.dtsi             | 159 +--------
>>   arch/arm/dts/k3-j721e-binman.dtsi             | 332 +-----------------
>>   arch/arm/dts/k3-j721s2-binman.dtsi            | 157 +--------
>>   8 files changed, 54 insertions(+), 1488 deletions(-)
>>
>> diff --git a/arch/arm/dts/k3-am625-sk-binman.dtsi b/arch/arm/dts/k3-am625-sk-binman.dtsi
>> index 41277bf4bf..b7b5368886 100644
>> --- a/arch/arm/dts/k3-am625-sk-binman.dtsi
>> +++ b/arch/arm/dts/k3-am625-sk-binman.dtsi
>> @@ -141,10 +141,7 @@
>>   
>>   #ifdef CONFIG_TARGET_AM625_A53_EVM
>>   
>> -#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
>>   #define SPL_AM625_SK_DTB "spl/dts/k3-am625-sk.dtb"
>> -
>> -#define UBOOT_NODTB "u-boot-nodtb.bin"
>>   #define AM625_SK_DTB "u-boot.dtb"
>>   
>>   &binman {
>> @@ -155,55 +152,11 @@
>>   		};
>>   	};
>>   	ti-spl {
>> -		filename = "tispl.bin";
>> -		pad-byte = <0xff>;
>> +		insert-template = <&ti_spl_template>;
>>   
>>   		fit {
>> -			description = "Configuration to load ATF and SPL";
>> -			#address-cells = <1>;
>> -
>>   			images {
>> -
>> -				atf {
>> -					description = "ARM Trusted Firmware";
>> -					type = "firmware";
>> -					arch = "arm64";
>> -					compression = "none";
>> -					os = "arm-trusted-firmware";
>> -					load = <CONFIG_K3_ATF_LOAD_ADDR>;
>> -					entry = <CONFIG_K3_ATF_LOAD_ADDR>;
>> -					ti-secure {
>> -						content = <&atf>;
>> -						keyfile = "custMpk.pem";
>> -					};
> 
> For ATF/OP-TEE Firewalling, can you keep these nodes intact? Just keep
> the ti-secure inside atf and tee nodes similar to how you have done that
> for DM as all the ATF/OPTEE nodes in the tispl.bin would be different
> for devices w.r.t certifications but we can still use templates for
> other common stuff.
> 

I believe you will still be able to process firewalling by adding the extra 
parameters in the board binman DTSI file. The reason for retaining DM was 
different. For example, for J721E:

diff --git a/arch/arm/dts/k3-j721e-binman.dtsi b/arch/arm/dts/k3-j721e-binman.dtsi
index 5ddb474e3a..647b5dc629 100644
--- a/arch/arm/dts/k3-j721e-binman.dtsi
+++ b/arch/arm/dts/k3-j721e-binman.dtsi
@@ -146,6 +146,27 @@

  		fit {
  			images {
+				atf {
+					ti-secure {
+						auth-in-place = <0xa02>;
+
+						firewall-257-0 {
+						/* cpu_0_cpu_0_msmc Background Firewall */
+							id = <257>;
+							region = <0>;
+							control = <(FWCTRL_EN | FWCTRL_LOCK |
+										FWCTRL_BG | FWCTRL_CACHE)>;
+							permissions = <((FWPRIVID_ALL << FWPRIVID_SHIFT) |
+											FWPERM_SECURE_PRIV_RWCD |
+											FWPERM_SECURE_USER_RWCD |
+											FWPERM_NON_SECURE_PRIV_RWCD |
+											FWPERM_NON_SECURE_USER_RWCD)>;
+							start_address = <0x0 0x0>;
+							end_address = <0xff 0xffffffff>;
+						};
+					};
+				};
+
  				dm {
  					ti-secure {
  						content = <&dm>;


I have only checked whether this builds fine without any errors. If you could 
check whether the intended functionality also works, we should be good.

> With this change,
> 
> Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
> 
> Regards,
> Manorit
>> -					atf: atf-bl31 {
>> -					};
>> -				};
>> -

[...]

-- 
Thanking You
Neha Malcom Francis

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates
  2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
  2023-11-16 16:03   ` Simon Glass
@ 2023-11-22 20:50   ` Tom Rini
  1 sibling, 0 replies; 15+ messages in thread
From: Tom Rini @ 2023-11-22 20:50 UTC (permalink / raw)
  To: Neha Malcom Francis
  Cc: sjg, marcel.ziswiler, u-boot, vigneshr, nm, u-kumar1, kamlesh,
	m-chawdhry, afd, mkorpershoek

[-- Attachment #1: Type: text/plain, Size: 440 bytes --]

On Wed, Nov 15, 2023 at 03:40:23PM +0530, Neha Malcom Francis wrote:

> Add templates for FIT images used extensively across K3 boards with most
> of the code common. This includes the FIT portions of:
> 	- tispl.bin
> 	- u-boot.img
> 	- sysfw.itb (in case of legacy boot flow)
> 
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs
  2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
                     ` (2 preceding siblings ...)
  2023-11-22  5:20   ` Manorit Chawdhry
@ 2023-11-22 20:50   ` Tom Rini
  3 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2023-11-22 20:50 UTC (permalink / raw)
  To: Neha Malcom Francis
  Cc: sjg, marcel.ziswiler, u-boot, vigneshr, nm, u-kumar1, kamlesh,
	m-chawdhry, afd, mkorpershoek

[-- Attachment #1: Type: text/plain, Size: 523 bytes --]

On Wed, Nov 15, 2023 at 03:40:24PM +0530, Neha Malcom Francis wrote:

> Reduce redundancy in code by using templates to generate the A72 boot
> binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
> (for legacy boot following devices J721E and AM65x).
> 
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> Acked-by: Andrew Davis <afd@ti.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-11-22 20:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-15 10:10 [PATCH 0/2] Cleanup K3 binman FIT images Neha Malcom Francis
2023-11-15 10:10 ` [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates Neha Malcom Francis
2023-11-16 16:03   ` Simon Glass
2023-11-16 16:43     ` Marcel Ziswiler
2023-11-17  5:15       ` Neha Malcom Francis
2023-11-22 20:50   ` Tom Rini
2023-11-15 10:10 ` [PATCH 2/2] arm: dts: k3-*-binman: Move to using templated FITs Neha Malcom Francis
2023-11-15 15:52   ` Andrew Davis
2023-11-16  5:08     ` Neha Malcom Francis
2023-11-16 16:04   ` Simon Glass
2023-11-22  5:20   ` Manorit Chawdhry
2023-11-22  5:52     ` Neha Malcom Francis
2023-11-22 20:50   ` Tom Rini
2023-11-15 17:33 ` [PATCH 0/2] Cleanup K3 binman FIT images Marcel Ziswiler
2023-11-16  5:08   ` Neha Malcom Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox