[PATCH 4/4] rockchip: binman: Add support for Falcon mode FIT images with ATF+Linux

Alexey Charkov alchark at flipper.net
Tue Jun 9 18:52:27 CEST 2026


Modern Rockchip SoCs such as RK3576 require ATF to be running to provide
firmware services to the OS. To enable booting Linux in Falcon mode on
such SoCs, add binman support for generation of FIT images containing
appropriately split ATF raw binaries (as is currently done by binman for
U-boot proper images), externally preprocessed DTB and a Linux kernel.

Signed-off-by: Alexey Charkov <alchark at flipper.net>
---
 Makefile                           |   2 +
 arch/arm/dts/rockchip-u-boot.dtsi  | 109 +++++++++++++++++++++++++++++++++++++
 tools/binman/etype/falcon_fdt.py   |  26 +++++++++
 tools/binman/etype/linux_kernel.py |  22 ++++++++
 4 files changed, 159 insertions(+)

diff --git a/Makefile b/Makefile
index 4e5c1dd6a1c4..844e5adb7b31 100644
--- a/Makefile
+++ b/Makefile
@@ -1690,6 +1690,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
 		$(foreach f,$(BINMAN_INDIRS),-I $(f)) \
 		-a atf-bl1-path=${BL1} \
 		-a atf-bl31-path=${BL31} \
+		-a linux-kernel-path=${LINUX_KERNEL} \
+		-a falcon-fdt-path=${FALCON_FDT} \
 		-a tee-os-path=${TEE} \
 		-a ti-dm-path=${TI_DM} \
 		-a opensbi-path=${OPENSBI} \
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index 4ba6a87e78ab..866a6ab654ca 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -161,6 +161,96 @@
 			};
 		};
 	};
+
+#ifdef CONFIG_SPL_OS_BOOT
+	fit_falcon_template: template-falcon {
+		type = "fit";
+		description = "FIT image for Falcon Linux with bl31 (TF-A)";
+		#address-cells = <1>;
+		fit,fdt-list-val = "u-boot";
+		fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+		fit,align = <512>;
+
+		images {
+			@atf-SEQ {
+				fit,operation = "split-elf";
+				description = "ARM Trusted Firmware";
+				type = "firmware";
+				arch = FIT_ARCH;
+				os = "arm-trusted-firmware";
+				compression = "none";
+				fit,load;
+				fit,entry;
+				fit,data;
+
+				atf-bl31 {
+				};
+#ifdef FIT_HASH_ALGO
+				hash {
+					algo = FIT_HASH_ALGO;
+				};
+#endif
+			};
+
+			kernel {
+				description = "Linux kernel";
+				type = "kernel";
+				arch = FIT_ARCH;
+				os = "linux";
+				compression = "none";
+				load = <0x48000000>;
+				entry = <0x48000000>;
+
+				linux-kernel {
+				};
+#ifdef FIT_HASH_ALGO
+				hash {
+					algo = FIT_HASH_ALGO;
+				};
+#endif
+			};
+
+			fdt-1 {
+				description = "falcon-fdt";
+				type = "flat_dt";
+				arch = FIT_ARCH;
+				compression = "none";
+				load = <0x52000000>;
+
+				falcon-fdt {
+				};
+#ifdef FIT_HASH_ALGO
+				hash {
+					algo = FIT_HASH_ALGO;
+				};
+#endif
+			};
+		};
+
+		configurations {
+			default = "config-1";
+			@config-SEQ {
+				description = "RK3576 Falcon Linux via ATF";
+				fit,firmware = "atf-1", "kernel";
+				fit,loadables;
+				fdt = "fdt-SEQ";
+#ifdef FIT_HASH_ALGO
+				hash {
+					algo = FIT_HASH_ALGO;
+				};
+#endif
+			};
+		};
+	};
+
+	falcon-fit {
+		filename = "u-boot-rockchip-falcon.itb";
+
+		fit {
+			insert-template = <&fit_falcon_template>;
+		};
+	};
+#endif
 #endif /* HAS_FIT */
 
 	simple-bin {
@@ -260,6 +350,25 @@
 		};
 		};
 	};
+
+#ifdef CONFIG_SPL_OS_BOOT
+	simple-bin-usb472-falcon {
+		filename = "u-boot-rockchip-usb472-falcon.bin";
+		pad-byte = <0x00>;
+
+		u-boot-spl {
+		};
+
+		payload {
+			type = "section";
+			align = <CONFIG_SYS_CACHELINE_SIZE>;
+			u-boot-any {
+				type = "fit";
+				insert-template = <&fit_falcon_template>;
+			};
+		};
+	};
+#endif
 #endif /* CONFIG_ROCKCHIP_MASKROM_IMAGE */
 };
 #endif /* CONFIG_SPL */
diff --git a/tools/binman/etype/falcon_fdt.py b/tools/binman/etype/falcon_fdt.py
new file mode 100644
index 000000000000..7c5b13b60d05
--- /dev/null
+++ b/tools/binman/etype/falcon_fdt.py
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2026 Flipper FZCO
+#
+# Entry type for Linux DTB used in Falcon mode FIT images.
+
+from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
+
+
+class Entry_falcon_fdt(Entry_blob_named_by_arg):
+    """Falcon Linux DTB for Rockchip maskrom Falcon image
+
+    Properties / Entry arguments:
+        - falcon-fdt-path: Filename containing the Falcon Linux DTB (optional,
+            defaults to 'u-boot.dtb')
+
+    This allows selecting the Falcon DTB from an environment variable passed
+    through binman entry arguments, while defaulting to the built U-Boot
+    control DTB when not provided.
+    """
+
+    def __init__(self, section, etype, node):
+        super().__init__(section, etype, node, 'falcon-fdt')
+        # Entry_blob defaults filename to etype when no filename is provided.
+        # Treat that as "unset" and fall back to the control DTB.
+        if not self._filename or self._filename == self.etype:
+            self._filename = 'u-boot.dtb'
diff --git a/tools/binman/etype/linux_kernel.py b/tools/binman/etype/linux_kernel.py
new file mode 100644
index 000000000000..15a1da690c4f
--- /dev/null
+++ b/tools/binman/etype/linux_kernel.py
@@ -0,0 +1,22 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2026 Flipper FZCO
+#
+# Entry-type module for Linux kernel binary blob
+
+from binman.etype.blob_named_by_arg import Entry_blob_named_by_arg
+
+
+class Entry_linux_kernel(Entry_blob_named_by_arg):
+    """Linux kernel image blob
+
+    Properties / Entry arguments:
+        - linux-kernel-path: Filename of file to read into entry. This is
+            typically an uncompressed ARM64 Image.
+
+    This entry allows binman FIT templates to consume a kernel provided via
+    make variable, similar to how BL31 is passed to atf-bl31.
+    """
+
+    def __init__(self, section, etype, node):
+        super().__init__(section, etype, node, 'linux-kernel', required=True)
+        self.external = True

-- 
2.53.0



More information about the U-Boot mailing list