Skip to contentSkip to conversation

imx8mm-evk: Generate a single bootable flash.bin again

PATCH In review Fabio Estevam 3 participants 3 messages Aug 23, 2021 – Oct 20, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 imx8mm-evk: Generate a single bootable flash.bin again

After the conversion to binman in commit 8996e6b7c6a1 ("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.

Such new requirement breaks existing distro mechanisms to generate the final binary because the extra u-boot.itb is now required.

Generate a final flash.bin that can be used again as a single bootable binary to keep the original behavior.

After this change the SPL binary is called spl.bin, which is a more descriptive name for its purpose, and can still be used standalone (for example, for secure boot purposes).

Also update imx8mm_evk.rst to remove the u-boot.itb copy step.

---
Changes since v4:
- Pass filename = "spl.bin"; to the spl node. (Heiko/Marcel)

 arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 19 ++++++++++++++++++-
 .../imx8mm_evk/imximage-8mm-lpddr4.cfg        |  2 +-
 doc/board/freescale/imx8mm_evk.rst            |  1 -
 3 files changed, 19 insertions(+), 3 deletions(-)
arch/arm/dts/imx8mm-evk-u-boot.dtsi +18 -1
index f200afac9f..3c75415e8f 100644
@@ -150,7 +150,9 @@
 	};
 
 
-       flash {
+	spl {
+		filename = "spl.bin";
+
 		mkimage {
 			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
 
@@ -217,4 +219,19 @@
 			};
 		};
 	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			offset = <0x0>;
+			filename = "spl.bin";
+		};
+
+		uboot: blob-ext@2 {
+			offset = <0x57c00>;
+			filename = "u-boot.itb";
+		};
+	};
 };
board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg +1 -1
index b89092a559..90573be5fd 100644
@@ -6,4 +6,4 @@
 #define __ASSEMBLY__
 
 BOOT_FROM	sd
-LOADER		mkimage.flash.mkimage	0x7E1000
+LOADER		u-boot-spl-ddr.bin	0x7E1000
doc/board/freescale/imx8mm_evk.rst +0 -1
index 7fd3d72564..b377c4de27 100644
@@ -50,7 +50,6 @@ Burn the flash.bin to MicroSD card offset 33KB:
 .. code-block:: bash
 
    $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc
-   $sudo dd if=u-boot.itb of=/dev/sdc bs=1024 seek=384 conv=sync
 
 Boot
 ----
Signature · 1 line
2.25.1
Reviewed-by on v5 1/1
#1 lore raw

Hi Fabio,

Am Mo., 23. Aug. 2021 um 14:57 Uhr schrieb Fabio Estevam <[email protected]>:

Quoted 16 lines

After the conversion to binman in commit 8996e6b7c6a1 ("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.

Such new requirement breaks existing distro mechanisms to generate the final binary because the extra u-boot.itb is now required.

Generate a final flash.bin that can be used again as a single bootable binary to keep the original behavior.

After this change the SPL binary is called spl.bin, which is a more descriptive name for its purpose, and can still be used standalone (for example, for secure boot purposes).

Quoted 6 lines

Also update imx8mm_evk.rst to remove the u-boot.itb copy step.

Quoted 70 lines

---
Changes since v4:
- Pass filename = "spl.bin"; to the spl node. (Heiko/Marcel)

 arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 19 ++++++++++++++++++-
 .../imx8mm_evk/imximage-8mm-lpddr4.cfg        |  2 +-
 doc/board/freescale/imx8mm_evk.rst            |  1 -
 3 files changed, 19 insertions(+), 3 deletions(-)
arch/arm/dts/imx8mm-evk-u-boot.dtsi +18 -1
index f200afac9f..3c75415e8f 100644
@@ -150,7 +150,9 @@
        };
 
 
-       flash {
+       spl {
+               filename = "spl.bin";
+
                mkimage {
                        args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
 
@@ -217,4 +219,19 @@
                        };
                };
        };
+
+       imx-boot {
+               filename = "flash.bin";
+               pad-byte = <0x00>;
+
+               spl: blob-ext@1 {
+                       offset = <0x0>;
+                       filename = "spl.bin";
+               };
+
+               uboot: blob-ext@2 {
+                       offset = <0x57c00>;
+                       filename = "u-boot.itb";
+               };
+       };
 };
board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg +1 -1
index b89092a559..90573be5fd 100644
@@ -6,4 +6,4 @@
 #define __ASSEMBLY__
 
 BOOT_FROM      sd
-LOADER         mkimage.flash.mkimage   0x7E1000
+LOADER         u-boot-spl-ddr.bin      0x7E1000
doc/board/freescale/imx8mm_evk.rst +0 -2
index 7fd3d72564..b377c4de27 100644
@@ -50,7 +50,6 @@ Burn the flash.bin to MicroSD card offset 33KB:
 .. code-block:: bash
 
    $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc
-   $sudo dd if=u-boot.itb of=/dev/sdc bs=1024 seek=384 conv=sync
 
 Boot
 ----
--

2.25.1

#2 lore raw

PATCH v5 1/1 imx8mm-evk: Generate a single bootable flash.bin again

In reply to Fabio Estevam
Quoted 12 lines

After the conversion to binman in commit 8996e6b7c6a1 ("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.
Such new requirement breaks existing distro mechanisms to generate the final binary because the extra u-boot.itb is now required. Generate a final flash.bin that can be used again as a single bootable binary to keep the original behavior.
After this change the SPL binary is called spl.bin, which is a more descriptive name for its purpose, and can still be used standalone (for example, for secure boot purposes).
Also update imx8mm_evk.rst to remove the u-boot.itb copy step.

Quoted 5 lines

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================