Commit 94aebe6cc3111c7c9e3cd1311cc9793d01cc3ded

Authored by Stefan Roese
Committed by Albert ARIBAUD
1 parent d014e03388

Makefile: Add u-boot.spr build target (SPEAr)

On x600 (SPEAr600) U-Boot is appended to U-Boot SPL. Both images are
created using mkimage (crc etc), so that the ROM bootloader can check
its integrity. Padding needs to be done to the SPL image (with
mkimage header) and not the binary. Otherwise the resulting image
which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
The resulting image containing both U-Boot images is called u-boot.spr.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Amit Virdi <amit.virdi@st.com>
Cc: Vipin Kumar <vipin.kumar@st.com>

Showing 2 changed files with 21 additions and 0 deletions Side-by-side Diff

... ... @@ -456,6 +456,22 @@
456 456 elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \
457 457 -o $(obj)u-boot.sb
458 458  
  459 +# On x600 (SPEAr600) U-Boot is appended to U-Boot SPL.
  460 +# Both images are created using mkimage (crc etc), so that the ROM
  461 +# bootloader can check its integrity. Padding needs to be done to the
  462 +# SPL image (with mkimage header) and not the binary. Otherwise the resulting image
  463 +# which is loaded/copied by the ROM bootloader to SRAM doesn't fit.
  464 +# The resulting image containing both U-Boot images is called u-boot.spr
  465 +$(obj)u-boot.spr: $(obj)u-boot.img $(obj)spl/u-boot-spl.bin
  466 + $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
  467 + -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE) -n XLOADER \
  468 + -d $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl.img
  469 + tr "\000" "\377" < /dev/zero | dd ibs=1 count=$(CONFIG_SPL_PAD_TO) \
  470 + of=$(obj)spl/u-boot-spl-pad.img 2>/dev/null
  471 + dd if=$(obj)spl/u-boot-spl.img of=$(obj)spl/u-boot-spl-pad.img \
  472 + conv=notrunc 2>/dev/null
  473 + cat $(obj)spl/u-boot-spl-pad.img $(obj)u-boot.img > $@
  474 +
459 475 ifeq ($(CONFIG_SANDBOX),y)
460 476 GEN_UBOOT = \
461 477 cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \
... ... @@ -775,6 +791,7 @@
775 791 @rm -f $(obj)u-boot.ais
776 792 @rm -f $(obj)u-boot.dtb
777 793 @rm -f $(obj)u-boot.sb
  794 + @rm -f $(obj)u-boot.spr
778 795 @rm -f $(obj)tools/inca-swap-bytes
779 796 @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
780 797 @rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c
... ... @@ -205,6 +205,10 @@
205 205 CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
206 206 endif
207 207  
  208 +ifneq ($(CONFIG_SPL_PAD_TO),)
  209 +CPPFLAGS += -DCONFIG_SPL_PAD_TO=$(CONFIG_SPL_PAD_TO)
  210 +endif
  211 +
208 212 ifeq ($(CONFIG_SPL_BUILD),y)
209 213 CPPFLAGS += -DCONFIG_SPL_BUILD
210 214 endif