ath79: add support for Ubiquiti UniFi AP Pro
[openwrt/staging/hauke.git] / target / linux / ath79 / image / generic-ubnt.mk
index b9451837769097408cbe37db0f4d1a0d06c829f1..6939edd25de86a8de1418a16bc444548a85acf52 100644 (file)
@@ -13,6 +13,14 @@ define Build/mkubntimage
                -k $(IMAGE_KERNEL) -r $@ -o $@
 endef
 
+define Build/mkubntimage2
+       -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
+               -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
+               -p jffs2:0x50000:0xf60000:0:0:$@ \
+               -o $@.new
+       @mv $@.new $@
+endef
+
 # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
 # booting the image, the size doesn't matter.
 define Build/mkubntimage-split
@@ -369,3 +377,20 @@ define Device/ubnt_unifiac-pro
   SUPPORTED_DEVICES += unifiac-pro
 endef
 TARGET_DEVICES += ubnt_unifiac-pro
+
+define Device/ubnt_unifi-ap-pro
+  SOC := ar9344
+  DEVICE_VENDOR := Ubiquiti
+  DEVICE_MODEL := UniFi AP Pro
+  UBNT_TYPE := BZ
+  UBNT_CHIP := ar934x
+  KERNEL_SIZE := 3072k
+  IMAGE_SIZE := 15744k
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\
+       pad-rootfs | append-metadata | check-size
+  IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
+  SUPPORTED_DEVICES += uap-pro
+endef
+TARGET_DEVICES += ubnt_unifi-ap-pro