Skip to contentSkip to conversation

arm: mach-imx: Makefile: Extend u-boot-nand.imx padding

PATCH In review Hiago De Franco 3 participants 3 messages Oct 3, 2023 – Oct 16, 2023

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

PATCH 1/1 arm: mach-imx: Makefile: Extend u-boot-nand.imx padding

From: Hiago De Franco <[email protected]>

Extend the padding process of u-boot-nand.imx target by adding 10k bytes of zeros to the end of the binary using the 'dd' command.

The existing padding method did not generate a functional binary, as discussed in more detail in this thread [1]. Instead, we adopt the end-padding calculation method documented in 'board/doc/colibri_imx7.rst' as a reference, which is relevant for iMX7 with NAND storage.

Adding 10k bytes of zeros provides an approximate value that makes the proper padding for these NAND devices.

[1] https://lore.kernel.org/all/CAC4tdFUqffQzRQFv5AGe_xtbFy1agr2SEpn_FzEdexhwjdryyw@mail.gmail.com/

---
 arch/arm/mach-imx/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-imx/Makefile +3 -1
index aebfa6517b..6904cf3880 100644
@@ -142,7 +142,9 @@ u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
 	$(call if_changed,mkimage)
 
 quiet_cmd_u-boot-nand_imx = GEN     $@
-cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | cat - $< > $@
+cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | cat - $< > [email protected] ; \
+		      (dd bs=10k count=1 if=/dev/zero 2>/dev/null) | cat [email protected] - > $@ ; \
+		      rm -f [email protected]
 
 u-boot-nand.imx: u-boot.imx FORCE
 	$(call if_changed,u-boot-nand_imx)
Signature · 1 line
2.40.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Hiago De Franco

From: Hiago De Franco <[email protected]>

Extend the padding process of u-boot-nand.imx target by adding 10k bytes of zeros to the end of the binary using the 'dd' command.

The existing padding method did not generate a functional binary, as discussed in more detail in this thread [1]. Instead, we adopt the end-padding calculation method documented in 'board/doc/colibri_imx7.rst' as a reference, which is relevant for iMX7 with NAND storage.

Quoted 6 lines

Adding 10k bytes of zeros provides an approximate value that makes the proper padding for these NAND devices.

[1] https://lore.kernel.org/all/CAC4tdFUqffQzRQFv5AGe_xtbFy1agr2SEpn_FzEdexhwjdryyw@mail.gmail.com/

#2 lore raw

PATCH 1/1 arm: mach-imx: Makefile: Extend u-boot-nand.imx padding

In reply to Hiago De Franco
Quoted 10 lines

From: Hiago De Franco <[email protected]>
Extend the padding process of u-boot-nand.imx target by adding 10k bytes
of zeros to the end of the binary using the 'dd' command.
The existing padding method did not generate a functional binary,
as discussed in more detail in this thread [1]. Instead, we adopt the
end-padding calculation method documented in 'board/doc/colibri_imx7.rst'
as a reference, which is relevant for iMX7 with NAND storage.
Adding 10k bytes of zeros provides an approximate value that makes the
proper padding for these NAND devices.
[1] https://lore.kernel.org/all/CAC4tdFUqffQzRQFv5AGe_xtbFy1agr2SEpn_FzEdexhwjdryyw@mail.gmail.com/

Quoted 2 lines

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

Best regards,
Stefano Babic

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