]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
rockchip: binman: Create a template for the FIT
authorSimon Glass <sjg@chromium.org>
Sun, 13 Apr 2025 19:59:35 +0000 (19:59 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Tue, 6 May 2025 07:58:25 +0000 (15:58 +0800)
Move the FIT description into a template so that it can be used in both
the simple-bin and the simple-bin-spi images.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
arch/arm/dts/rockchip-u-boot.dtsi

index 943d7d87a068ce535dabbffa0a68f659bd83832d..0c074c0ec6b9af0908da759895de071db4885338 100644 (file)
 #define FIT_UBOOT_COMP         "none"
 #endif
 
+#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE))
+#define HAS_FIT
+#endif
+
 / {
        binman: binman {
                multiple-images;
 
 #ifdef CONFIG_SPL
 &binman {
-       simple-bin {
-               filename = "u-boot-rockchip.bin";
-               pad-byte = <0xff>;
-
-               mkimage {
-                       filename = "idbloader.img";
-                       args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
-                       multiple-data-files;
-
-#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
-                       rockchip-tpl {
-                       };
-#elif defined(CONFIG_TPL)
-                       u-boot-tpl {
-                       };
-#endif
-                       u-boot-spl {
-                       };
-               };
-
-#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE))
-               fit: fit {
+#ifdef HAS_FIT
+       fit_template: template-1 {
+                       type = "fit";
 #ifdef CONFIG_ARM64
                        description = "FIT image for U-Boot with bl31 (TF-A)";
 #else
 #endif
                        #address-cells = <1>;
                        fit,fdt-list = "of-list";
-                       filename = "u-boot.itb";
                        fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
                        fit,align = <512>;
-                       offset = <CONFIG_SPL_PAD_TO>;
                        images {
                                u-boot {
                                        description = "U-Boot";
                                        fit,loadables;
                                };
                        };
+       };
+#endif /* HAS_FIT */
+
+       simple-bin {
+               filename = "u-boot-rockchip.bin";
+               pad-byte = <0xff>;
+
+               mkimage {
+                       filename = "idbloader.img";
+                       args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
+                       multiple-data-files;
+
+#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
+                       rockchip-tpl {
+                       };
+#elif defined(CONFIG_TPL)
+                       u-boot-tpl {
+                       };
+#endif
+                       u-boot-spl {
+                       };
                };
+
+#ifdef HAS_FIT
+               fit {
+                       filename = "u-boot.itb";
+                       insert-template = <&fit_template>;
 #else
                u-boot-img {
+#endif
                        offset = <CONFIG_SPL_PAD_TO>;
                };
-#endif
        };
 
 #ifdef CONFIG_ROCKCHIP_SPI_IMAGE
                        };
                };
 
-#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)
+#ifdef HAS_FIT
                fit {
-                       type = "blob";
-                       filename = "u-boot.itb";
+                       insert-template = <&fit_template>;
 #else
                u-boot-img {
 #endif