public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/4] makefile: tools: socfpgaimage: update padding flow
@ 2022-11-13 13:55 Jit Loon Lim
  2022-11-13 13:55 ` [PATCH 2/4] doc: README.socfpga: Add guide for mkimage Jit Loon Lim
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jit Loon Lim @ 2022-11-13 13:55 UTC (permalink / raw)
  To: u-boot
  Cc: Jagan Teki, Vignesh R, Marek, Simon, Tien Fong, Kok Kiang,
	Siew Chin, Sin Hui, Raaj, Dinesh, Boon Khai, Alif, Teik Heng,
	Hazim, Jit Loon Lim, Sieu Mun Tang, Ley Foon Tan

From: Ley Foon Tan <ley.foon.tan@intel.com>

HSD #1508690657-2: The existing socfpgaimage always pads the image to the maximum size of
OCRAM size. This will break in the encryption flow where it expects the
image to be un-padded. The encryption tool will do the encryption for
the whole image and append the signature key at end of the image.
The signature key will append to beyond the size of OCRAM if the image
is padded with the maximum size before encryption.

Move the padding step from socfpgaimage to Makefile and pads with objcopy
command.

socfpgaimage will pad the image with 16 bytes aligned (including CRC word),
this is a requirement in encryption flow.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
 Makefile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index ff25f92974..04914a8bec 100644
--- a/Makefile
+++ b/Makefile
@@ -1606,8 +1606,14 @@ spl/u-boot-splx4.sfp: spl/u-boot-spl.sfp FORCE
 	$(call if_changed,gensplx4)
 
 quiet_cmd_socboot = SOCBOOT $@
-cmd_socboot = cat	spl/u-boot-splx4.sfp u-boot.img > $@ || { rm -f $@; false; }
-u-boot-with-spl.sfp: spl/u-boot-splx4.sfp u-boot.img FORCE
+cmd_socboot = $(OBJCOPY) -I binary -O binary --gap-fill=0x0		\
+			--pad-to=$(CONFIG_SPL_PAD_TO)			\
+			spl/u-boot-spl.sfp spl/u-boot-spl.sfp &&	\
+		cat	spl/u-boot-spl.sfp spl/u-boot-spl.sfp		\
+			spl/u-boot-spl.sfp 				\
+			spl/u-boot-spl.sfp > spl/u-boot-splx4.sfp ;	\
+	      cat	spl/u-boot-splx4.sfp u-boot.img > $@ || rm -f $@
+u-boot-with-spl.sfp: spl/u-boot-spl.sfp u-boot.img FORCE
 	$(call if_changed,socboot)
 
 quiet_cmd_gensplpadx4 = GENSPLPADX4 $@
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-13 13:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-13 13:55 [PATCH 1/4] makefile: tools: socfpgaimage: update padding flow Jit Loon Lim
2022-11-13 13:55 ` [PATCH 2/4] doc: README.socfpga: Add guide for mkimage Jit Loon Lim
2022-11-13 13:55 ` [PATCH 3/4] doc: README.socfpga: Update for U-boot 2022.04 Jit Loon Lim
2022-11-13 13:55 ` [PATCH 4/4] doc: README.socfpga: Add official boot flow support info Jit Loon Lim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox