treewide: drop ath10k support
[openwrt/staging/blogic.git] / target / linux / ath79 / image / generic-ubnt.mk
1 DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
2
3 # mkubntimage is using the kernel image direct
4 # routerboard creates partitions out of the ubnt header
5 define Build/mkubntimage
6 -$(STAGING_DIR_HOST)/bin/mkfwimage \
7 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
8 -k $(IMAGE_KERNEL) \
9 -r $@ \
10 -o $@
11 endef
12
13 # all UBNT XM device expect the kernel image to have 1024k while flash, when
14 # booting the image, the size doesn't matter.
15 define Build/mkubntimage-split
16 -[ -f $@ ] && ( \
17 dd if=$@ of=$@.old1 bs=1024k count=1; \
18 dd if=$@ of=$@.old2 bs=1024k skip=1; \
19 $(STAGING_DIR_HOST)/bin/mkfwimage \
20 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
21 -k $@.old1 \
22 -r $@.old2 \
23 -o $@; \
24 rm $@.old1 $@.old2 )
25 endef
26
27 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
28 # UBNT_TYPE e.g. one of (BZ, XM, XW)
29 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
30 define Device/ubnt
31 DEVICE_PACKAGES := kmod-usb-core kmod-usb2
32 IMAGE_SIZE := 7552k
33 UBNT_BOARD := XM
34 IMAGES += factory.bin
35 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
36 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
37 endef
38
39 define Device/ubnt-xm
40 $(Device/ubnt)
41 DEVICE_PACKAGES += kmod-usb-ohci
42 UBNT_TYPE := XM
43 UBNT_CHIP := ar7240
44 ATH_SOC := ar7241
45 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
46 endef
47
48 define Device/ubnt-bz
49 $(Device/ubnt)
50 UBNT_TYPE := BZ
51 UBNT_CHIP := ar7240
52 ATH_SOC := ar7241
53 endef
54
55 define Device/ubnt_bullet-m
56 $(Device/ubnt-xm)
57 DEVICE_TITLE := Ubiquiti Bullet-M
58 SUPPORTED_DEVICES += bullet-m
59 endef
60 TARGET_DEVICES += ubnt_bullet-m
61
62 define Device/ubnt_rocket-m
63 $(Device/ubnt-xm)
64 DEVICE_TITLE := Ubiquiti Rocket-M
65 SUPPORTED_DEVICES += rocket-m
66 endef
67 TARGET_DEVICES += ubnt_rocket-m
68
69 define Device/ubnt_nano-m
70 $(Device/ubnt-xm)
71 DEVICE_TITLE := Ubiquiti Nano-M
72 SUPPORTED_DEVICES += nano-m
73 endef
74 TARGET_DEVICES += ubnt_nano-m
75
76 define Device/ubnt_unifi
77 $(Device/ubnt-bz)
78 DEVICE_TITLE := Ubiquiti UniFi
79 SUPPORTED_DEVICES += unifi
80 endef
81 TARGET_DEVICES += ubnt_unifi
82
83 define Device/ubnt_unifiac
84 ATH_SOC := qca9563
85 IMAGE_SIZE := 7744k
86 IMAGES := sysupgrade.bin
87 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
88 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
89 endef
90
91
92 define Device/ubnt_unifiac-lite
93 $(Device/ubnt_unifiac)
94 DEVICE_TITLE := Ubiquiti UniFi AC-Lite
95 SUPPORTED_DEVICES += ubnt-unifiac-lite
96 endef
97 TARGET_DEVICES += ubnt_unifiac-lite
98
99 define Device/ubnt_unifiac-mesh
100 $(Device/ubnt_unifiac)
101 DEVICE_TITLE := Ubiquiti UniFi AC-Mesh
102 SUPPORTED_DEVICES += ubnt-unifiac-mesh
103 endef
104 TARGET_DEVICES += ubnt_unifiac-mesh
105
106 define Device/ubnt_unifiac-mesh-pro
107 $(Device/ubnt_unifiac)
108 DEVICE_TITLE := Ubiquiti UniFi AC-Mesh Pro
109 SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro
110 endef
111 TARGET_DEVICES += ubnt_unifiac-mesh-pro
112
113 define Device/ubnt_unifiac-pro
114 $(Device/ubnt_unifiac)
115 DEVICE_TITLE := Ubiquiti UniFi AC-Pro
116 DEVICE_PACKAGES += kmod-usb-core kmod-usb2
117 SUPPORTED_DEVICES += ubnt-unifiac-pro
118 endef
119 TARGET_DEVICES += ubnt_unifiac-pro
120
121 define Device/ubnt_routerstation_common
122 DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig
123 ATH_SOC := ar7161
124 IMAGE_SIZE := 16128k
125 IMAGES := sysupgrade.bin factory.bin
126 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE)
127 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE) | append-metadata
128 KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
129 KERNEL_INITRAMFS := kernel-bin | append-dtb
130 endef
131
132 define Device/ubnt_routerstation
133 $(Device/ubnt_routerstation_common)
134 DEVICE_TITLE := Ubiquiti RouterStation
135 UBNT_BOARD := RS
136 UBNT_TYPE := RSx
137 UBNT_CHIP := ar7100
138 DEVICE_PACKAGES += -swconfig
139 endef
140 TARGET_DEVICES += ubnt_routerstation
141
142 define Device/ubnt_routerstation-pro
143 $(Device/ubnt_routerstation_common)
144 DEVICE_TITLE := Ubiquiti RouterStation Pro
145 UBNT_BOARD := RSPRO
146 UBNT_TYPE := RSPRO
147 UBNT_CHIP := ar7100pro
148 endef
149 TARGET_DEVICES += ubnt_routerstation-pro