summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2021-01-13 13:53:05 +0300
committerLey Foon Tan <ley.foon.tan@intel.com>2021-01-15 12:48:39 +0300
commit40551cf99c237f93d9e0e07b6dd8f31b3868a0f0 (patch)
treecb980ab19def72fe9a0661f1639f7e2e5afb9e4b /Makefile
parent53b59290c59a4b699d829655987d1b96e4810aaf (diff)
downloadu-boot-40551cf99c237f93d9e0e07b6dd8f31b3868a0f0.tar.xz
tools: socfpgaimage: update padding flow
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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 902a976779..cef149dec9 100644
--- a/Makefile
+++ b/Makefile
@@ -1583,7 +1583,10 @@ u-boot.spr: spl/u-boot-spl.img u-boot.img FORCE
ifneq ($(CONFIG_ARCH_SOCFPGA),)
quiet_cmd_gensplx4 = GENSPLX4 $@
-cmd_gensplx4 = cat spl/u-boot-spl.sfp spl/u-boot-spl.sfp \
+cmd_gensplx4 = $(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 > $@ || { rm -f $@; false; }
spl/u-boot-splx4.sfp: spl/u-boot-spl.sfp FORCE
$(call if_changed,gensplx4)