]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Makefile: Add target for building bootable SPL image for SoCFPGA
authorMarek Vasut <marex@denx.de>
Wed, 15 Jul 2015 00:53:45 +0000 (02:53 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 06:17:23 +0000 (08:17 +0200)
Add build target for generating boot partition images recognised by
the SoCFPGA BootROM. The SoCFPGA BootROM expects four copies of the
u-boot-spl-dtb.sfp at the beginning of boot partition. Those are
u-boot-spl-dtb.bin augmented by a header with which the BootROM can
work. The u-boot-dtb.img uImage is appended to this to produce a
full boot partition image, the u-boot-with-spl-dtb.sfp . This is
the name of the final target.

Signed-off-by: Marek Vasut <marex@denx.de>
Makefile
scripts/Makefile.spl

index 4a232268fcf09891c38993aef856df293df3bf6d..a9541e1860fd805b341c38e9279137824cc67226 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1023,6 +1023,15 @@ u-boot-nand.gph: u-boot.bin FORCE
        $(call if_changed,mkimage)
        @dd if=/dev/zero bs=8 count=1 2>/dev/null >> $@
 
+ifneq ($(CONFIG_ARCH_SOCFPGA),)
+quiet_cmd_socboot = SOCBOOT $@
+cmd_socboot = cat      spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
+                       spl/u-boot-spl-dtb.sfp spl/u-boot-spl-dtb.sfp   \
+                       u-boot-dtb.img > $@ || rm -f $@
+u-boot-with-spl-dtb.sfp: spl/u-boot-spl-dtb.sfp u-boot-dtb.img FORCE
+       $(call if_changed,socboot)
+endif
+
 # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
 # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
 # the middle.
@@ -1301,6 +1310,9 @@ spl/u-boot-spl: tools prepare $(if $(CONFIG_OF_SEPARATE),dts/dt.dtb)
 spl/sunxi-spl.bin: spl/u-boot-spl
        @:
 
+spl/u-boot-spl-dtb.sfp: spl/u-boot-spl
+       @:
+
 tpl/u-boot-tpl.bin: tools prepare
        $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all
 
index 4879d0a9195712a842f883d83075fc9c0e0ebc05..239ee48816634b450541383b032d218ae19b3c5b 100644 (file)
@@ -163,6 +163,10 @@ ifdef CONFIG_SAMSUNG
 ALL-y  += $(obj)/$(BOARD)-spl.bin
 endif
 
+ifdef CONFIG_ARCH_SOCFPGA
+ALL-y  += $(obj)/$(SPL_BIN)-dtb.sfp
+endif
+
 ifdef CONFIG_SUNXI
 ALL-y  += $(obj)/sunxi-spl.bin
 endif
@@ -231,6 +235,12 @@ ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
 
+ifdef CONFIG_ARCH_SOCFPGA
+MKIMAGEFLAGS_$(SPL_BIN)-dtb.sfp = -T socfpgaimage
+$(obj)/$(SPL_BIN)-dtb.sfp: $(obj)/$(SPL_BIN)-dtb.bin FORCE
+       $(call if_changed,mkimage)
+endif
+
 ifdef CONFIG_SUNXI
 quiet_cmd_mksunxiboot = MKSUNXI $@
 cmd_mksunxiboot = $(objtree)/tools/mksunxiboot $< $@