bcm63xx: nand: support CFE partition tags
[openwrt/staging/luka.git] / target / linux / bcm63xx / image / Makefile
index 7c3091fb66835dc56d6444b1c41bea92733eef0d..5fbe8ea47011cb1f48332bd04b723c61721585b9 100644 (file)
@@ -168,6 +168,9 @@ define Build/cfe-jffs2-cferam
        # Some devices need padding between CFE RAM and kernel
        $(if $(CFE_RAM_JFFS2_PAD),$(call Build/pad-to,$(CFE_RAM_JFFS2_PAD)))
 
+       # Add CFE partition tag
+       $(if $(CFE_PART_ID),$(call Build/cfe-part-tag))
+
        # Append kernel
        dd if=$@.kernel >> $@
        rm -f $@.kernel
@@ -204,6 +207,22 @@ define Build/cfe-jffs2-kernel
        $(call Build/cfe-jffs2,$@-kernel)
 endef
 
+define Build/cfe-part-tag
+       mv $@ $@.part
+
+       $(TOPDIR)/scripts/cfe-partition-tag.py \
+               --input-file $@.part \
+               --output-file $@ \
+               --flags $(CFE_PART_FLAGS) \
+               --id $(CFE_PART_ID) \
+               --name $(VERSION_CODE) \
+               --version $(DEVICE_NAME)
+
+       $(call Build/pad-to,$(BLOCKSIZE))
+
+       dd if=$@.part >> $@
+endef
+
 define Build/cfe-old-bin
        $(TOPDIR)/scripts/brcmImage.pl -t -p \
                -o $@ -b $(CFE_BOARD_ID) -c $(CHIP_ID) \