ramips: Add support for D-Link DCH-M225
[openwrt/staging/florian.git] / target / linux / ramips / image / mt7620.mk
index d6da803b525dfe0f69a8284bf0861e4a1126bd1e..8e1346ded290c194f9e83757d560c472be34d9a8 100644 (file)
@@ -8,9 +8,9 @@ define Build/tplink-header
 endef
 
 define Build/pad-kernel-ex2700
-       dd if=/dev/zero of=$@.pad bs=64 count=1 && cat $@ $@.pad \
-               | dd of=$@.new bs=64k conv=sync && truncate -s -64 $@.new \
-               && cat ex2700-fakeroot.uImage >> $@.new && rm $@.pad && mv $@.new $@
+       cp $@ $@.tmp && dd if=/dev/zero bs=64 count=1 >> $@.tmp \
+               && dd if=$@.tmp of=$@.new bs=64k conv=sync && truncate -s -64 $@.new \
+               && cat ex2700-fakeroot.uImage >> $@.new && rm $@.tmp && mv $@.new $@
 endef
 
 define Build/netgear-header
@@ -41,6 +41,15 @@ define Build/elecom-header
        $(STAGING_DIR_HOST)/bin/tar -cf $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5
 endef
 
+define Build/seama
+       $(STAGING_DIR_HOST)/bin/seama -i $@ $(1)
+       mv $@.seama $@
+endef
+
+define Build/seama-seal
+       $(call Build/seama,-s $@.seama $(1))
+endef
+
 define Device/ArcherC20i
   DTS := ArcherC20i
   KERNEL := $(KERNEL_DTB)
@@ -50,6 +59,15 @@ define Device/ArcherC20i
 endef
 TARGET_DEVICES += ArcherC20i
 
+define Device/ArcherC50
+  DTS := ArcherC50
+  KERNEL := $(KERNEL_DTB)
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC50 -c
+  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j -r $(KDIR)/root.squashfs
+  DEVICE_TITLE := TP-Link ArcherC50
+endef
+TARGET_DEVICES += ArcherC50
+
 ex2700_mtd_size=3866624
 define Device/ex2700
   DTS := EX2700
@@ -367,6 +385,14 @@ define Device/youku-yk1
 endef
 TARGET_DEVICES += youku-yk1
 
+define Device/zbt-ape522ii
+  DTS := ZBT-APE522II
+  IMAGE_SIZE := $(ralink_default_fw_size_8M)
+  DEVICE_TITLE := Zbtlink ZBT-APE522II
+  DEVICE_PACKAGES := kmod-mt76
+endef
+TARGET_DEVICES += zbt-ape522ii
+
 define Device/zbt-wa05
   DTS := ZBT-WA05
   IMAGE_SIZE := $(ralink_default_fw_size_8M)
@@ -396,3 +422,22 @@ define Device/tiny-ac
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
 endef
 TARGET_DEVICES += tiny-ac
+
+dch_m225_mtd_size=7012352
+define Device/dch-m225
+  DTS := DCH-M225
+  IMAGES += factory.bin
+  IMAGE_SIZE := $(dch_m225_mtd_size)
+  IMAGE/sysupgrade.bin := \
+       append-kernel | pad-offset 65536 64 | append-rootfs | \
+       seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+       pad-rootfs | check-size $$$$(IMAGE_SIZE)
+  IMAGE/factory.bin := \
+       append-kernel | pad-offset 65536 64 | append-rootfs | pad-rootfs -x 64 | \
+       seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
+       seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \
+       check-size $$$$(IMAGE_SIZE)
+  DEVICE_TITLE := D-Link DCH-M225
+  DEVICE_PACKAGES := kmod-mt76
+endef
+TARGET_DEVICES += dch-m225