imx: add u-boot-nand.imx target
authorStefan Agner <stefan.agner@toradex.com>
Thu, 16 Oct 2014 07:50:12 +0000 (09:50 +0200)
committerStefan Agner <stefan@agner.ch>
Tue, 14 Apr 2015 07:08:09 +0000 (09:08 +0200)
Add an additional target which prepends the u-boot.imx image with
0x400 padding bytes. On Vybrid, this is required for NAND boot
devices. The configuration CONFIG_IMX_NAND enables this image
for a board.

Makefile
arch/arm/config.mk
arch/arm/imx-common/Makefile

index 950c960fe62d517ea28c3091ac485a8e804761b9..645499d179b11746c12ad74a60c270e6f348eacd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -813,6 +813,9 @@ u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE
 %.imx: %.bin
        $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
 
+u-boot-nand.imx: u-boot.bin
+       $(Q)$(MAKE) $(build)=arch/arm/imx-common $@
+
 quiet_cmd_copy = COPY    $@
       cmd_copy = cp $< $@
 
index c005ce490512492629670162ac4027367e9358fb..3f7780146d8b02353cff4eabe5130f18d82cabbd 100644 (file)
@@ -128,7 +128,12 @@ else
 ifeq ($(CONFIG_OF_SEPARATE),y)
 ALL-y += u-boot-dtb.imx
 else
+ifeq ($(CONFIG_IMX_NAND),y)
+# u-boot-nand.imx builds u-boot.imx as well
+ALL-y += u-boot-nand.imx
+else
 ALL-y += u-boot.imx
 endif
 endif
 endif
+endif
index b9f1ca4da98828fded63bd3a0b60f9b61162bba0..a5a3642833ad3df20990a3df6f033a271e5f5617 100644 (file)
@@ -44,6 +44,15 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \
 u-boot.imx: u-boot.bin $(IMX_CONFIG) FORCE
        $(call if_changed,mkimage)
 
+ifeq ($(CONFIG_IMX_NAND),y)
+quiet_cmd_u-boot-nand_imx = GEN     $@
+cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
+       cat - $< > $@
+
+u-boot-nand.imx: u-boot.imx $(IMX_CONFIG) FORCE
+       $(call if_changed,u-boot-nand_imx)
+endif
+
 ifeq ($(CONFIG_OF_SEPARATE),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \
        -e $(CONFIG_SYS_TEXT_BASE)