ath79: add support for D-Link DAP-2660 A1
[openwrt/staging/dedeckeh.git] / target / linux / ath79 / image / generic.mk
index 614f9ff0b240805cbf9e624a0bf1471b7f6920f5..e1b0c4c1e166abd135b419c36d9fbb8d5c6e7483 100644 (file)
@@ -7,6 +7,7 @@ DEVICE_VARS += ADDPATTERN_ID ADDPATTERN_VERSION
 DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
 DEVICE_VARS += KERNEL_INITRAMFS_PREFIX
 DEVICE_VARS += DAP_SIGNATURE ENGENIUS_IMGNAME
+DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL
 
 define Build/add-elecom-factory-initramfs
   $(eval edimax_model=$(word 1,$(1)))
@@ -50,6 +51,24 @@ define Build/cybertan-trx
        -rm $@-empty.bin
 endef
 
+define Build/edimax-headers
+       $(eval edimax_magic=$(word 1,$(1)))
+       $(eval edimax_model=$(word 2,$(1)))
+
+       $(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\
+               -v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \
+               -n "uImage" \
+               -i $(KDIR)/loader-$(DEVICE_NAME).uImage \
+               -o $@.uImage
+       $(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\
+               -v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \
+               -n "rootfs" \
+               -i $@ \
+               -o $@.rootfs
+       cat $@.uImage $@.rootfs > $@
+       rm -rf $@.uImage $@.rootfs
+endef
+
 # This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to
 # sysupgrade, as otherwise it will implant the old configuration from
 # OEM firmware when writing rootfs from factory.bin
@@ -218,6 +237,20 @@ define Device/adtran_bsap1840
 endef
 TARGET_DEVICES += adtran_bsap1840
 
+define Device/airtight_c-75
+  SOC := qca9550
+  DEVICE_VENDOR := AirTight Networks
+  DEVICE_MODEL := C-75
+  DEVICE_ALT0_VENDOR := Mojo Networks
+  DEVICE_ALT0_MODEL := C-75
+  DEVICE_ALT1_VENDOR := WatchGuard
+  DEVICE_ALT1_MODEL := AP320
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct kmod-usb2
+  IMAGE_SIZE := 32320k
+  KERNEL_SIZE := 15936k
+endef
+TARGET_DEVICES += airtight_c-75
+
 define Device/alfa-network_ap121f
   SOC := ar9331
   DEVICE_VENDOR := ALFA Network
@@ -363,6 +396,42 @@ define Device/avm_fritzdvbc
 endef
 TARGET_DEVICES += avm_fritzdvbc
 
+define Device/belkin_f9x-v2
+  SOC := qca9558
+  DEVICE_VENDOR := Belkin
+  IMAGE_SIZE := 14464k
+  DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 \
+       kmod-usb3 kmod-usb-ledtrig-usbport
+  LOADER_TYPE := bin
+  LOADER_FLASH_OFFS := 0x50000
+  COMPILE := loader-$(1).bin loader-$(1).uImage
+  COMPILE/loader-$(1).bin := loader-okli-compile
+  COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | \
+       lzma | uImage lzma
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+       append-rootfs | pad-rootfs | check-size | \
+       edimax-headers $$$$(EDIMAX_HEADER_MAGIC) $$$$(EDIMAX_HEADER_MODEL) | \
+       pad-to $$$$(BLOCKSIZE)
+endef
+
+define Device/belkin_f9j1108-v2
+  $(Device/belkin_f9x-v2)
+  DEVICE_MODEL := F9J1108 v2 (AC1750 DB Wi-Fi)
+  EDIMAX_HEADER_MAGIC := F9J1108v1
+  EDIMAX_HEADER_MODEL := BR-6679BAC
+endef
+TARGET_DEVICES += belkin_f9j1108-v2
+
+define Device/belkin_f9k1115-v2
+  $(Device/belkin_f9x-v2)
+  DEVICE_MODEL := F9K1115 v2 (AC1750 DB Wi-Fi)
+  EDIMAX_HEADER_MAGIC := eDiMaX
+  EDIMAX_HEADER_MODEL := F9K1115V2
+endef
+TARGET_DEVICES += belkin_f9k1115-v2
+
 define Device/buffalo_bhr-4grv
   $(Device/buffalo_common)
   SOC := ar7242
@@ -669,6 +738,28 @@ define Device/dlink_dap-1365-a1
 endef
 TARGET_DEVICES += dlink_dap-1365-a1
 
+define Device/dlink_dap-2xxx
+  IMAGES += factory.img sysupgrade.bin
+  IMAGE/factory.img := append-kernel | pad-offset 6144k 160 | \
+       append-rootfs | wrgg-pad-rootfs | mkwrggimg | check-size
+  IMAGE/sysupgrade.bin := append-kernel | mkwrggimg | \
+       pad-to $$$$(BLOCKSIZE) | append-rootfs | append-metadata | check-size
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma
+  KERNEL_INITRAMFS := $$(KERNEL) | mkwrggimg
+endef
+
+define Device/dlink_dap-2660-a1
+  $(Device/dlink_dap-2xxx)
+  SOC := qca9557
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DAP-2660
+  DEVICE_VARIANT := A1
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
+  IMAGE_SIZE := 15232k
+  DAP_SIGNATURE := wapac09_dkbs_dap2660
+endef
+TARGET_DEVICES += dlink_dap-2660-a1
+
 define Device/dlink_dap-2695-a1
   SOC := qca9558
   DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
@@ -873,20 +964,43 @@ define Device/engenius_eap300-v2
 endef
 TARGET_DEVICES += engenius_eap300-v2
 
+define Device/engenius_ecb1200
+  SOC := qca9557
+  DEVICE_VENDOR := EnGenius
+  DEVICE_MODEL := ECB1200
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
+  IMAGE_SIZE := 15680k
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+       append-rootfs | pad-rootfs | check-size | \
+       senao-header -r 0x101 -p 0x6e -t 2
+endef
+TARGET_DEVICES += engenius_ecb1200
+
 define Device/engenius_ecb1750
   SOC := qca9558
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ECB1750
-  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
   IMAGE_SIZE := 15680k
+  IMAGES += factory.bin
   IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
        append-rootfs | pad-rootfs | check-size | \
        senao-header -r 0x101 -p 0x6d -t 2
-  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
-       append-metadata | check-size
 endef
 TARGET_DEVICES += engenius_ecb1750
 
+define Device/engenius_ecb350-v1
+  $(Device/engenius_loader_okli)
+  SOC := ar7242
+  DEVICE_MODEL := ECB350
+  DEVICE_VARIANT := v1
+  IMAGE_SIZE := 4864k
+  LOADER_FLASH_OFFS := 0x1b0000
+  ENGENIUS_IMGNAME := senao-ecb350
+endef
+TARGET_DEVICES += engenius_ecb350-v1
+
 define Device/engenius_enh202-v1
   $(Device/engenius_loader_okli)
   SOC := ar7240
@@ -1030,6 +1144,15 @@ define Device/glinet_gl-mifi
 endef
 TARGET_DEVICES += glinet_gl-mifi
 
+define Device/glinet_gl-usb150
+  SOC := ar9331
+  DEVICE_VENDOR := GL.iNET
+  DEVICE_MODEL := GL-USB150
+  IMAGE_SIZE := 16000k
+  SUPPORTED_DEVICES += gl-usb150
+endef
+TARGET_DEVICES += glinet_gl-usb150
+
 define Device/glinet_gl-x750
   SOC := qca9531
   DEVICE_VENDOR := GL.iNet
@@ -1478,6 +1601,30 @@ define Device/pisen_wmm003n
 endef
 TARGET_DEVICES += pisen_wmm003n
 
+define Device/plasmacloud_pa300-common
+  SOC := qca9533
+  DEVICE_VENDOR := Plasma Cloud
+  DEVICE_PACKAGES := uboot-envtools
+  IMAGE_SIZE := 7168k
+  BLOCKSIZE := 64k
+  IMAGES += factory.bin
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-to $$(BLOCKSIZE)
+  IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA300
+  IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
+endef
+
+define Device/plasmacloud_pa300
+  $(Device/plasmacloud_pa300-common)
+  DEVICE_MODEL := PA300
+endef
+TARGET_DEVICES += plasmacloud_pa300
+
+define Device/plasmacloud_pa300e
+  $(Device/plasmacloud_pa300-common)
+  DEVICE_MODEL := PA300E
+endef
+TARGET_DEVICES += plasmacloud_pa300e
+
 define Device/qihoo_c301
   $(Device/seama)
   SOC := ar9344