ath79: add support for D-Link COVR-P2500 A1
[openwrt/staging/hauke.git] / target / linux / ath79 / image / generic.mk
index d8ee3192c08c5290eb233f9966e34a7a7d03a8ae..e6e78b9287517fb17ff144beaa071fc060eaaa08 100644 (file)
@@ -33,6 +33,17 @@ define Build/cybertan-trx
        -rm $@-empty.bin
 endef
 
+define Build/dlink-sge-signature
+       ( \
+               crc=$$(gzip -c $@ | tail -c 8 | od -An -tx4 --endian little | cut -d " " -f2); \
+               cat $@; \
+               $(MKHASH) md5 $@ ; \
+               echo $(1); \
+               echo -n $$crc; \
+       ) > $@.new
+       mv $@.new $@
+endef
+
 define Build/edimax-headers
        $(eval edimax_magic=$(word 1,$(1)))
        $(eval edimax_model=$(word 2,$(1)))
@@ -995,6 +1006,26 @@ define Device/devolo_magic-2-wifi
 endef
 TARGET_DEVICES += devolo_magic-2-wifi
 
+define Device/dlink_covr-p2500-a1
+  $(Device/loader-okli-uimage)
+  SOC := qca9563
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := COVR-P2500
+  DEVICE_VARIANT := A1
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
+  LOADER_FLASH_OFFS := 0x050000
+  LOADER_KERNEL_MAGIC := 0x68737173
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x68737173
+  IMAGE_SIZE := 14528k
+  IMAGES += factory.bin recovery.bin
+  IMAGE/recovery.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+       append-rootfs | pad-rootfs | check-size | pad-to 14528k | \
+       append-loader-okli-uimage $(1) | pad-to 15616k
+  IMAGE/factory.bin := $$(IMAGE/recovery.bin) | \
+       dlink-sge-image COVR-P2500 | dlink-sge-signature COVR-P2500
+endef
+TARGET_DEVICES += dlink_covr-p2500-a1
+
 define Device/dlink_dap-13xx
   SOC := qca9533
   DEVICE_VENDOR := D-Link
@@ -1544,6 +1575,16 @@ define Device/fortinet_fap_common
        gzip-filename $$$$(FACTORY_IMG_NAME)
 endef
 
+define Device/fortinet_fap-220-b
+  $(Device/fortinet_fap_common)
+  SOC := ar7161
+  DEVICE_MODEL := FAP-220-B
+  FACTORY_IMG_NAME := FAP22B-9.99-AP-build999-999999-patch99
+  DEVICE_PACKAGES := -uboot-envtools kmod-usb-ohci kmod-usb2 \
+       kmod-owl-loader
+endef
+TARGET_DEVICES += fortinet_fap-220-b
+
 define Device/fortinet_fap-221-b
   $(Device/fortinet_fap_common)
   SOC := ar9344