Skip to contentSkip to conversation

Makefile: socfpga: Generate sfp file with 4 SPL images

PATCH New Chee Hong Ang 2 participants 2 messages Aug 11, 2020 – Aug 27, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Makefile: socfpga: Generate sfp file with 4 SPL images

Generate 'u-boot-splx4.sfp' which consist of 4 SPL images required for booting up Cyclone5/Arria10.

By default, this 'u-boot-splx4.sfp' is generated without extra padding after each SPL image.

For Cyclone5, 'u-boot-splx4.sfp' contains:
4 x SPL(64KB) = 256KB

For Arria10, 'u-boot-splx4.sfp' contains:
4 x SPL(256KB) = 1024KB

For Cyclone5 using NAND flash image layout for 128 KB memory blocks, user can 'make' the following target to generate 4 SPL images with padding:

make u-boot-spl-padx4.sfp

'u-boot-spl-padx4.sfp' contains four 128KB SPL images (each 64KB SPL is followed by 64KB of zero-padding).
4 x (SPL(64KB) + zero-padding(64KB)) = 512KB

---
v3 changes:
- add 'u-boot-splx4.sfp' make target (4 x SPL image without paddings)
- add 'u-boot-spl-padx4.sfp' make target (4 x SPL image with 64KB paddings)
- Update commit message (refer to commit message for details explanation)

 Makefile | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)
Makefile +18 -9
index 4483a9bc8a..20357adebb 100644
@@ -1580,21 +1580,30 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
 	$(call if_changed,pad_cat)
 
 ifneq ($(CONFIG_ARCH_SOCFPGA),)
+quiet_cmd_gensplx4 = GENSPLX4 $@
+cmd_gensplx4 = cat	spl/u-boot-spl.sfp spl/u-boot-spl.sfp	\
+			spl/u-boot-spl.sfp spl/u-boot-spl.sfp > $@ || rm -f $@
+u-boot-splx4.sfp: spl/u-boot-spl.sfp FORCE
+	$(call if_changed,gensplx4)
+
 quiet_cmd_socboot = SOCBOOT $@
-cmd_socboot = cat	spl/u-boot-spl.sfp spl/u-boot-spl.sfp	\
-			spl/u-boot-spl.sfp spl/u-boot-spl.sfp	\
-			u-boot.img > $@ || rm -f $@
-u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
+cmd_socboot = cat	u-boot-splx4.sfp u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: u-boot-splx4.sfp u-boot.img FORCE
 	$(call if_changed,socboot)
 
-quiet_cmd_socnandboot = SOCNANDBOOT $@
-cmd_socnandboot =  dd if=/dev/zero of=spl/u-boot-spl.pad bs=64 count=1024 ; \
+quiet_cmd_gensplpadx4 = GENSPLPADX4 $@
+cmd_gensplpadx4 =  dd if=/dev/zero of=spl/u-boot-spl.pad bs=64 count=1024 ; \
 		   cat	spl/u-boot-spl.sfp spl/u-boot-spl.pad \
 			spl/u-boot-spl.sfp spl/u-boot-spl.pad \
 			spl/u-boot-spl.sfp spl/u-boot-spl.pad \
-			spl/u-boot-spl.sfp spl/u-boot-spl.pad \
-			u-boot.img > $@ || rm -f $@ spl/u-boot-spl.pad
-u-boot-with-nand-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
+			spl/u-boot-spl.sfp spl/u-boot-spl.pad > $@ || \
+			rm -f $@ spl/u-boot-spl.pad
+u-boot-spl-padx4.sfp: spl/u-boot-spl.sfp FORCE
+	$(call if_changed,gensplpadx4)
+
+quiet_cmd_socnandboot = SOCNANDBOOT $@
+cmd_socnandboot = cat	u-boot-spl-padx4.sfp u-boot.img > $@ || rm -f $@
+u-boot-with-nand-spl.sfp: u-boot-spl-padx4.sfp u-boot.img FORCE
 	$(call if_changed,socnandboot)
 
 endif
Signature · 1 line
2.19.0
#1 lore raw

PATCH v3 1/1 Makefile: socfpga: Generate sfp file with 4 SPL images

Quoted 38 lines

-----Original Message-----
From: Ang, Chee Hong <[email protected]>
Sent: Tuesday, August 11, 2020 9:53 PM
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; Simon Goldschmidt <[email protected]>; Tom Rini <[email protected]>; See, Chin Liang <[email protected]>; Tan, Ley Foon <[email protected]>; Ang, Chee Hong <[email protected]>; Chee, Tien Fong <[email protected]>; Lim, Elly Siew Chin <[email protected]>
Subject: [PATCH v3 1/1] Makefile: socfpga: Generate sfp file with 4 SPL images

Generate 'u-boot-splx4.sfp' which consist of 4 SPL images required for booting up Cyclone5/Arria10.

By default, this 'u-boot-splx4.sfp' is generated without extra padding after each SPL image.

For Cyclone5, 'u-boot-splx4.sfp' contains:
4 x SPL(64KB) = 256KB

For Arria10, 'u-boot-splx4.sfp' contains:
4 x SPL(256KB) = 1024KB

For Cyclone5 using NAND flash image layout for 128 KB memory blocks, user can 'make' the following target to generate 4 SPL images with padding:

make u-boot-spl-padx4.sfp

'u-boot-spl-padx4.sfp' contains four 128KB SPL images (each 64KB SPL is followed by 64KB of zero-padding).
4 x (SPL(64KB) + zero-padding(64KB)) = 512KB

Quoted 8 lines

---
v3 changes:
- add 'u-boot-splx4.sfp' make target (4 x SPL image without paddings)
- add 'u-boot-spl-padx4.sfp' make target (4 x SPL image with 64KB paddings)
- Update commit message (refer to commit message for details explanation)

 Makefile | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)