]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman
authorMarek Vasut <marex@denx.de>
Thu, 25 Apr 2024 23:00:37 +0000 (01:00 +0200)
committerFabio Estevam <festevam@gmail.com>
Sun, 28 Apr 2024 15:10:13 +0000 (12:10 -0300)
Rework the flash.bin image generation such that it uses the new binman
nxp_imx8mimage etype. This way, the flash.bin is assembled in correct
order using plain binman, without any workarounds or sections assembled
in special DT node order.

Reviewed-By: Tim Harvey <tharvey@gateworks.com>
Tested-By: Tim Harvey <tharvey@gateworks.com> # imx8mm_venice
Tested-by: Fabio Estevam <festevam@gmail.com> # imx8mm-evk and imx8mn-evk
Signed-off-by: Marek Vasut <marex@denx.de>
arch/arm/dts/imx8mm-u-boot.dtsi
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
arch/arm/dts/imx8mn-u-boot.dtsi
arch/arm/dts/imx8mp-dhcom-u-boot.dtsi
arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi
arch/arm/dts/imx8mp-u-boot.dtsi
arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
arch/arm/dts/imx8mq-u-boot.dtsi

index 06f2f73a03f3236aa5acf260a72643d149ed5a24..6ab8f66256edaa70556f8e776d7b1cca6b1d0172 100644 (file)
@@ -5,7 +5,6 @@
 
 / {
        binman: binman {
-               multiple-images;
        };
 
 #ifdef CONFIG_OPTEE
 };
 
 &binman {
-       u-boot-spl-ddr {
-               align = <4>;
-               align-size = <4>;
-               filename = "u-boot-spl-ddr.bin";
-               pad-byte = <0xff>;
-
-               u-boot-spl {
-                       align-end = <4>;
-                       filename = "u-boot-spl.bin";
-               };
+       filename = "flash.bin";
+       section {
+               pad-byte = <0x00>;
 
-               ddr-1d-imem-fw {
-                       filename = "lpddr4_pmu_train_1d_imem.bin";
-                       align-end = <4>;
+#ifdef CONFIG_FSPI_CONF_HEADER
+               fspi_conf_block {
+                       filename = CONFIG_FSPI_CONF_FILE;
                        type = "blob-ext";
+                       size = <0x1000>;
                };
+#endif
 
-               ddr-1d-dmem-fw {
-                       filename = "lpddr4_pmu_train_1d_dmem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
+               nxp-imx8mimage {
+                       filename = "u-boot-spl-mkimage.bin";
+                       nxp,boot-from = "sd";
+                       nxp,rom-version = <1>;
+                       nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
+                       args;   /* Needed by mkimage etype superclass */
 
-               ddr-2d-imem-fw {
-                       filename = "lpddr4_pmu_train_2d_imem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
+                       section {
+                               align = <4>;
+                               align-size = <4>;
+                               filename = "u-boot-spl-ddr.bin";
+                               pad-byte = <0xff>;
 
-               ddr-2d-dmem-fw {
-                       filename = "lpddr4_pmu_train_2d_dmem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
-       };
+                               u-boot-spl {
+                                       align-end = <4>;
+                                       filename = "u-boot-spl.bin";
+                               };
 
-       spl {
-               filename = "spl.bin";
+                               ddr-1d-imem-fw {
+                                       filename = "lpddr4_pmu_train_1d_imem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
 
-               mkimage {
-                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+                               ddr-1d-dmem-fw {
+                                       filename = "lpddr4_pmu_train_1d_dmem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
 
-                       blob {
-                               filename = "u-boot-spl-ddr.bin";
+                               ddr-2d-imem-fw {
+                                       filename = "lpddr4_pmu_train_2d_imem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
+
+                               ddr-2d-dmem-fw {
+                                       filename = "lpddr4_pmu_train_2d_dmem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
                        };
                };
-       };
-
-       itb {
-               filename = "u-boot.itb";
 
                fit {
                        description = "Configuration to load ATF before U-Boot";
 #endif
                        fit,fdt-list = "of-list";
                        #address-cells = <1>;
+#ifdef CONFIG_FSPI_CONF_HEADER
+                       offset = <0x58C00>;
+#else
+                       offset = <0x57c00>;
+#endif
 
                        images {
                                uboot {
                        };
                };
        };
-
-       imx-boot {
-               filename = "flash.bin";
-               pad-byte = <0x00>;
-
-#ifdef CONFIG_FSPI_CONF_HEADER
-               fspi_conf_block {
-                       filename = CONFIG_FSPI_CONF_FILE;
-                       type = "blob-ext";
-                       size = <0x1000>;
-               };
-
-               spl {
-                       filename = "spl.bin";
-                       offset = <0x1000>;
-                       type = "blob-ext";
-               };
-
-               binman_uboot: uboot {
-                       filename = "u-boot.itb";
-                       offset = <0x58C00>;
-                       type = "blob-ext";
-               };
-#else
-               spl {
-                       filename = "spl.bin";
-                       offset = <0x0>;
-                       type = "blob-ext";
-               };
-
-               binman_uboot: uboot {
-                       filename = "u-boot.itb";
-                       offset = <0x57c00>;
-                       type = "blob-ext";
-               };
-#endif
-       };
 };
 
 &clk {
index 8b397f535c148810ce672cb56c27486796322559..90183aff8bcc8ba1a7a64aa2beb74833849ecd7d 100644 (file)
        bootph-pre-ram;
 };
 
-&binman_uboot {
-       offset = <0x5fc00>;
+&binman {
+       section {
+               fit {
+                       offset = <0x5fc00>;
+               };
+       };
 };
 
 &gpio1 {
index 96b1a1bc80297a582e5318be10b79a0f3d231338..ba9967dbe4aff8dd41ea4cccea630d89eb0aeb23 100644 (file)
@@ -5,7 +5,6 @@
 
 / {
        binman: binman {
-               multiple-images;
        };
 
 #ifdef CONFIG_OPTEE
 };
 
 &binman {
-        u-boot-spl-ddr {
-               filename = "u-boot-spl-ddr.bin";
-               pad-byte = <0xff>;
-               align-size = <4>;
-               align = <4>;
-
-               u-boot-spl {
-                       align-end = <4>;
-                       filename = "u-boot-spl.bin";
+       filename = "flash.bin";
+       section {
+               pad-byte = <0x00>;
+
+#ifdef CONFIG_FSPI_CONF_HEADER
+               fspi_conf_block {
+                       filename = CONFIG_FSPI_CONF_FILE;
+                       type = "blob-ext";
+                       offset = <0x400>;
                };
+#endif
 
-               ddr-1d-imem-fw {
+               nxp-imx8mimage {
+                       filename = "u-boot-spl-mkimage.bin";
+                       nxp,boot-from = "sd";
+                       nxp,rom-version = <2>;
+                       nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
+                       args;   /* Needed by mkimage etype superclass */
+
+                       section {
+                               filename = "u-boot-spl-ddr.bin";
+                               pad-byte = <0xff>;
+                               align-size = <4>;
+                               align = <4>;
+
+                               u-boot-spl {
+                                       align-end = <4>;
+                                       filename = "u-boot-spl.bin";
+                               };
+
+                               ddr-1d-imem-fw {
 #ifdef CONFIG_IMX8M_LPDDR4
-                       filename = "lpddr4_pmu_train_1d_imem.bin";
+                                       filename = "lpddr4_pmu_train_1d_imem.bin";
 #elif CONFIG_IMX8M_DDR4
-                       filename = "ddr4_imem_1d_201810.bin";
+                                       filename = "ddr4_imem_1d_201810.bin";
 #else
-                       filename = "ddr3_imem_1d.bin";
+                                       filename = "ddr3_imem_1d.bin";
 #endif
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 
-               ddr-1d-dmem-fw {
+                               ddr-1d-dmem-fw {
 #ifdef CONFIG_IMX8M_LPDDR4
-                       filename = "lpddr4_pmu_train_1d_dmem.bin";
+                                       filename = "lpddr4_pmu_train_1d_dmem.bin";
 #elif CONFIG_IMX8M_DDR4
-                       filename = "ddr4_dmem_1d_201810.bin";
+                                       filename = "ddr4_dmem_1d_201810.bin";
 #else
-                       filename = "ddr3_dmem_1d.bin";
+                                       filename = "ddr3_dmem_1d.bin";
 #endif
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 
 #if defined(CONFIG_IMX8M_LPDDR4) || defined(CONFIG_IMX8M_DDR4)
-               ddr-2d-imem-fw {
+                               ddr-2d-imem-fw {
 #ifdef CONFIG_IMX8M_LPDDR4
-                       filename = "lpddr4_pmu_train_2d_imem.bin";
+                                       filename = "lpddr4_pmu_train_2d_imem.bin";
 #else
-                       filename = "ddr4_imem_2d_201810.bin";
+                                       filename = "ddr4_imem_2d_201810.bin";
 #endif
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 
-               ddr-2d-dmem-fw {
+                               ddr-2d-dmem-fw {
 #ifdef CONFIG_IMX8M_LPDDR4
-                       filename = "lpddr4_pmu_train_2d_dmem.bin";
+                                       filename = "lpddr4_pmu_train_2d_dmem.bin";
 #else
-                       filename = "ddr4_dmem_2d_201810.bin";
+                                       filename = "ddr4_dmem_2d_201810.bin";
 #endif
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 #endif
-       };
-
-       spl {
-               filename = "spl.bin";
-
-               mkimage {
-                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
-
-                       blob {
-                               filename = "u-boot-spl-ddr.bin";
                        };
                };
-       };
-
-       itb {
-               filename = "u-boot.itb";
 
                fit {
                        description = "Configuration to load ATF before U-Boot";
 #endif
                        fit,fdt-list = "of-list";
                        #address-cells = <1>;
+#ifdef CONFIG_FSPI_CONF_HEADER
+                       offset = <0x59000>;
+#else
+                       offset = <0x58000>;
+#endif
 
                        images {
                                uboot {
                        };
                };
        };
-
-       imx-boot {
-               filename = "flash.bin";
-               pad-byte = <0x00>;
-
-#ifdef CONFIG_FSPI_CONF_HEADER
-               fspi_conf_block {
-                       filename = CONFIG_FSPI_CONF_FILE;
-                       type = "blob-ext";
-                       offset = <0x400>;
-               };
-
-               spl {
-                       filename = "spl.bin";
-                       offset = <0x1000>;
-                       type = "blob-ext";
-               };
-
-               binman_uboot: uboot {
-                       filename = "u-boot.itb";
-                       offset = <0x59000>;
-                       type = "blob-ext";
-               };
-#else
-
-               spl {
-                       offset = <0x0>;
-                       filename = "spl.bin";
-                       type = "blob-ext";
-               };
-
-               binman_uboot: uboot {
-                       offset = <0x58000>;
-                       filename = "u-boot.itb";
-                       type = "blob-ext";
-               };
-#endif
-       };
 };
index b05be57e71b859a22eaeda740ee99ccca1c19146..cb37e28f28fded88411a81c4299a230713f65d9d 100644 (file)
 };
 
 &binman {
-       itb {
+       section {
                fit {
                        images {
                                fdt-dto-imx8mp-dhcom-som-overlay-eth1xfast {
index 22171bd344e38207dd7144cee082d096ccbfb084..aff5dcf615df186b0825cb4307f1e93277fb2ac2 100644 (file)
 };
 
 &binman {
-       itb {
+       section {
                fit {
                        images {
                                fip {
index 4fadcaea509370ec5af89e873ebfec1e1460668c..c4c1a1771026b3f69b47aa626c4785531c661eaf 100644 (file)
@@ -6,7 +6,6 @@
 
 / {
        binman: binman {
-               multiple-images;
        };
 
 #ifdef CONFIG_OPTEE
 #endif
 
 &binman {
-        u-boot-spl-ddr {
-               filename = "u-boot-spl-ddr.bin";
-               pad-byte = <0xff>;
-               align-size = <4>;
-               align = <4>;
-
-               u-boot-spl {
-                       align-end = <4>;
-               };
+       filename = "flash.bin";
+       section {
+               pad-byte = <0x00>;
 
-               ddr-1d-imem-fw {
-                       filename = "lpddr4_pmu_train_1d_imem_202006.bin";
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+               nxp-imx8mimage {
+                       filename = "u-boot-spl-mkimage.bin";
+                       nxp,boot-from = "sd";
+                       nxp,rom-version = <2>;
+                       nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
+                       args;   /* Needed by mkimage etype superclass */
 
-               ddr-1d-dmem-fw {
-                       filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+                       section {
+                               filename = "u-boot-spl-ddr.bin";
+                               pad-byte = <0xff>;
+                               align-size = <4>;
+                               align = <4>;
 
-               ddr-2d-imem-fw {
-                       filename = "lpddr4_pmu_train_2d_imem_202006.bin";
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
+                               u-boot-spl {
+                                       align-end = <4>;
+                               };
 
-               ddr-2d-dmem-fw {
-                       filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
-                       type = "blob-ext";
-                       align-end = <4>;
-               };
-       };
+                               ddr-1d-imem-fw {
+                                       filename = "lpddr4_pmu_train_1d_imem_202006.bin";
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 
-       spl {
-               filename = "spl.bin";
+                               ddr-1d-dmem-fw {
+                                       filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 
-               mkimage {
-                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x920000";
+                               ddr-2d-imem-fw {
+                                       filename = "lpddr4_pmu_train_2d_imem_202006.bin";
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
 
-                       blob {
-                               filename = "u-boot-spl-ddr.bin";
+                               ddr-2d-dmem-fw {
+                                       filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
+                                       type = "blob-ext";
+                                       align-end = <4>;
+                               };
                        };
                };
-       };
-
-       itb {
-               filename = "u-boot.itb";
 
                fit {
                        description = "Configuration to load ATF before U-Boot";
 #endif
                        fit,fdt-list = "of-list";
                        #address-cells = <1>;
+                       offset = <0x58000>;
 
                        images {
                                uboot {
                        };
                };
        };
-
-       imx-boot {
-               filename = "flash.bin";
-               pad-byte = <0x00>;
-
-               spl {
-                       filename = "spl.bin";
-                       offset = <0x0>;
-                       type = "blob-ext";
-               };
-
-               binman_uboot: uboot {
-                       filename = "u-boot.itb";
-                       offset = <0x58000>;
-                       type = "blob-ext";
-               };
-       };
 };
index e3341a46d630b21cb5bddc5382fb73c6b805562b..1a4568dac65660305d032fb0cf70e2624bd9a73a 100644 (file)
 };
 
 &binman {
-       /delete-node/ signed-hdmi;
-
-       signed-hdmi {
-               filename = "signed_hdmi.bin";
-
-               signed-dp-imx8m {
-                       filename = "signed_dp_imx8m.bin";
-                       type = "blob-ext";
+       section {
+               nxp-imx8mimage {
+                       section {
+                               signed-hdmi-imx8m {
+                                       filename = "signed_dp_imx8m.bin";
+                               };
+                       };
                };
        };
 };
index 90b2274754bb1bff27f5090625df1d5ef0db0975..48dbe94f0c4b75003b2fca9d1b9378ab40e72182 100644 (file)
@@ -5,7 +5,6 @@
 
 / {
        binman: binman {
-               multiple-images;
        };
 
 };
 };
 
 &binman {
-       u-boot-spl-ddr {
-               align = <4>;
-               align-size = <4>;
-               filename = "u-boot-spl-ddr.bin";
-               pad-byte = <0xff>;
-
-               u-boot-spl {
-                       align-end = <4>;
-                       filename = "u-boot-spl.bin";
-               };
+       filename = "flash.bin";
+       section {
+               pad-byte = <0x00>;
 
-               ddr-1d-imem-fw {
-                       filename = "lpddr4_pmu_train_1d_imem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
+               nxp-imx8mimage {
+                       filename = "u-boot-spl-mkimage.bin";
+                       nxp,boot-from = "sd";
+                       nxp,rom-version = <1>;
+                       nxp,loader-address = <CONFIG_SPL_TEXT_BASE>;
+                       args;   /* Needed by mkimage etype superclass */
 
-               ddr-1d-dmem-fw {
-                       filename = "lpddr4_pmu_train_1d_dmem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
-
-               ddr-2d-imem-fw {
-                       filename = "lpddr4_pmu_train_2d_imem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
+                       section {
+                               align = <4>;
+                               align-size = <4>;
+                               filename = "u-boot-spl-ddr.bin";
+                               pad-byte = <0xff>;
 
-               ddr-2d-dmem-fw {
-                       filename = "lpddr4_pmu_train_2d_dmem.bin";
-                       align-end = <4>;
-                       type = "blob-ext";
-               };
-       };
+                               u-boot-spl {
+                                       align-end = <4>;
+                                       filename = "u-boot-spl.bin";
+                               };
 
-       signed-hdmi {
-               filename = "signed_hdmi.bin";
+                               ddr-1d-imem-fw {
+                                       filename = "lpddr4_pmu_train_1d_imem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
 
-               signed-hdmi-imx8m {
-                       filename = "signed_hdmi_imx8m.bin";
-                       type = "blob-ext";
-               };
-       };
+                               ddr-1d-dmem-fw {
+                                       filename = "lpddr4_pmu_train_1d_dmem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
 
-       spl {
-               filename = "spl.bin";
+                               ddr-2d-imem-fw {
+                                       filename = "lpddr4_pmu_train_2d_imem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
 
-               mkimage {
-                       args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+                               ddr-2d-dmem-fw {
+                                       filename = "lpddr4_pmu_train_2d_dmem.bin";
+                                       align-end = <4>;
+                                       type = "blob-ext";
+                               };
 
-                       blob {
-                               filename = "u-boot-spl-ddr.bin";
+                               signed-hdmi-imx8m {
+                                       filename = "signed_hdmi_imx8m.bin";
+                                       type = "blob-ext";
+                               };
                        };
                };
-       };
-
-       itb {
-               filename = "u-boot.itb";
 
                fit {
                        description = "Configuration to load ATF before U-Boot";
                        };
                };
        };
-
-       imx-boot {
-               filename = "flash.bin";
-               pad-byte = <0x00>;
-
-               spl {
-                       filename = "spl.bin";
-                       offset = <0x0>;
-                       type = "blob-ext";
-               };
-
-               binman_uboot: uboot {
-                       filename = "u-boot.itb";
-                       offset = <0x57c00>;
-                       type = "blob-ext";
-               };
-       };
 };