ath79: rename Ubiquiti PowerBeam M (XW) to PowerBeam M5 (XW)
[openwrt/openwrt.git] / target / linux / ath79 / image / generic-ubnt.mk
1 DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE UBNT_VERSION UBNT_REVISION
2
3 # On M (XW) devices the U-Boot as of version 1.1.4-s1039 doesn't like
4 # VERSION_DIST being on the place of major(?) version number, so we need to
5 # use some number.
6 UBNT_REVISION := $(VERSION_DIST)-$(REVISION)
7
8 # mkubntimage is using the kernel image direct
9 # routerboard creates partitions out of the ubnt header
10 define Build/mkubntimage
11 -$(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
12 -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
13 -k $(IMAGE_KERNEL) -r $@ -o $@
14 endef
15
16 define Build/mkubntimage2
17 -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
18 -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
19 -p jffs2:0x50000:0xf60000:0:0:$@ \
20 -o $@.new
21 @mv $@.new $@
22 endef
23
24 # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
25 # booting the image, the size doesn't matter.
26 define Build/mkubntimage-split
27 -[ -f $@ ] && ( \
28 dd if=$@ of=$@.old1 bs=1024k count=1; \
29 dd if=$@ of=$@.old2 bs=1024k skip=1; \
30 $(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
31 -v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
32 -k $@.old1 -r $@.old2 -o $@; \
33 rm $@.old1 $@.old2 )
34 endef
35
36 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
37 # UBNT_TYPE e.g. one of (BZ, XM, XW)
38 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
39 # UBNT_VERSION e.g. one of (6.0.0, 8.5.3)
40 define Device/ubnt
41 DEVICE_VENDOR := Ubiquiti
42 DEVICE_PACKAGES := kmod-usb2
43 IMAGES += factory.bin
44 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
45 append-rootfs | pad-rootfs | check-size | mkubntimage-split
46 endef
47
48 define Device/ubnt-bz
49 $(Device/ubnt)
50 SOC := ar7241
51 IMAGE_SIZE := 7448k
52 UBNT_BOARD := XM
53 UBNT_CHIP := ar7240
54 UBNT_TYPE := BZ
55 UBNT_VERSION := 6.0.0
56 endef
57
58 define Device/ubnt-sw
59 $(Device/ubnt)
60 SOC := ar7242
61 DEVICE_PACKAGES += kmod-usb-ohci
62 IMAGE_SIZE := 7552k
63 UBNT_BOARD := SW
64 UBNT_CHIP := ar7240
65 UBNT_TYPE := SW
66 UBNT_VERSION := 1.4.1
67 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
68 endef
69
70 define Device/ubnt-2wa
71 $(Device/ubnt)
72 SOC := ar9342
73 IMAGE_SIZE := 15744k
74 UBNT_BOARD := WA
75 UBNT_CHIP := ar934x
76 UBNT_TYPE := 2WA
77 UBNT_VERSION := 8.5.3
78 endef
79
80 define Device/ubnt-wa
81 $(Device/ubnt)
82 SOC := ar9342
83 IMAGE_SIZE := 15744k
84 UBNT_BOARD := WA
85 UBNT_CHIP := ar934x
86 UBNT_TYPE := WA
87 UBNT_VERSION := 8.5.3
88 endef
89
90 define Device/ubnt-xc
91 $(Device/ubnt)
92 IMAGE_SIZE := 15744k
93 UBNT_BOARD := XC
94 UBNT_CHIP := qca955x
95 UBNT_TYPE := XC
96 UBNT_VERSION := 8.5.3
97 endef
98
99 define Device/ubnt-xm
100 $(Device/ubnt)
101 DEVICE_VARIANT := XM
102 DEVICE_PACKAGES += kmod-usb-ohci
103 IMAGE_SIZE := 7448k
104 UBNT_BOARD := XM
105 UBNT_CHIP := ar7240
106 UBNT_TYPE := XM
107 UBNT_VERSION := 6.0.0
108 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
109 endef
110
111 define Device/ubnt-xw
112 $(Device/ubnt)
113 SOC := ar9342
114 DEVICE_VARIANT := XW
115 IMAGE_SIZE := 7552k
116 UBNT_BOARD := XM
117 UBNT_CHIP := ar934x
118 UBNT_REVISION := 42.$(UBNT_REVISION)
119 UBNT_TYPE := XW
120 UBNT_VERSION := 6.0.4
121 endef
122
123 define Device/ubnt-unifi-jffs2
124 $(Device/ubnt)
125 KERNEL_SIZE := 3072k
126 IMAGE_SIZE := 15744k
127 UBNT_TYPE := BZ
128 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0
129 IMAGES := sysupgrade.bin factory.bin
130 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\
131 pad-rootfs | check-size | append-metadata
132 IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
133 endef
134
135 define Device/ubnt-acb
136 $(Device/ubnt)
137 IMAGE_SIZE := 15744k
138 UBNT_BOARD := ACB
139 UBNT_TYPE := ACB
140 UBNT_VERSION := 2.5.0
141 endef
142
143 define Device/ubnt_aircube-ac
144 $(Device/ubnt-acb)
145 SOC := ar9342
146 DEVICE_MODEL := airCube AC
147 UBNT_CHIP := ar9342
148 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
149 endef
150 TARGET_DEVICES += ubnt_aircube-ac
151
152 define Device/ubnt_aircube-isp
153 $(Device/ubnt-acb)
154 SOC := qca9533
155 DEVICE_MODEL := airCube ISP
156 UBNT_CHIP := qca9533
157 SUPPORTED_DEVICES += ubnt,acb-isp
158 endef
159 TARGET_DEVICES += ubnt_aircube-isp
160
161 define Device/ubnt_airrouter
162 $(Device/ubnt-xm)
163 SOC := ar7241
164 DEVICE_MODEL := AirRouter
165 SUPPORTED_DEVICES += airrouter
166 endef
167 TARGET_DEVICES += ubnt_airrouter
168
169 define Device/ubnt_bullet-ac
170 $(Device/ubnt-2wa)
171 DEVICE_MODEL := Bullet AC
172 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
173 endef
174 TARGET_DEVICES += ubnt_bullet-ac
175
176 define Device/ubnt_bullet-m-ar7240
177 $(Device/ubnt-xm)
178 SOC := ar7240
179 DEVICE_MODEL := Bullet M
180 DEVICE_VARIANT := XM (AR7240)
181 DEVICE_PACKAGES += rssileds
182 SUPPORTED_DEVICES += bullet-m
183 endef
184 TARGET_DEVICES += ubnt_bullet-m-ar7240
185
186 define Device/ubnt_bullet-m-ar7241
187 $(Device/ubnt-xm)
188 SOC := ar7241
189 DEVICE_MODEL := Bullet M
190 DEVICE_VARIANT := XM (AR7241)
191 DEVICE_PACKAGES += rssileds
192 SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
193 endef
194 TARGET_DEVICES += ubnt_bullet-m-ar7241
195
196 define Device/ubnt_bullet-m-xw
197 $(Device/ubnt-xw)
198 DEVICE_MODEL := Bullet M
199 DEVICE_PACKAGES += rssileds
200 SUPPORTED_DEVICES += bullet-m-xw
201 endef
202 TARGET_DEVICES += ubnt_bullet-m-xw
203
204 define Device/ubnt_edgeswitch-5xp
205 $(Device/ubnt-sw)
206 DEVICE_MODEL := EdgeSwitch 5XP
207 endef
208 TARGET_DEVICES += ubnt_edgeswitch-5xp
209
210 define Device/ubnt_edgeswitch-8xp
211 $(Device/ubnt-sw)
212 DEVICE_MODEL := EdgeSwitch 8XP
213 DEVICE_PACKAGES += kmod-switch-bcm53xx-mdio
214 endef
215 TARGET_DEVICES += ubnt_edgeswitch-8xp
216
217 define Device/ubnt_lap-120
218 $(Device/ubnt-wa)
219 DEVICE_MODEL := LiteAP ac (LAP-120)
220 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
221 endef
222 TARGET_DEVICES += ubnt_lap-120
223
224 define Device/ubnt_litebeam-ac-gen2
225 $(Device/ubnt-wa)
226 DEVICE_MODEL := LiteBeam AC
227 DEVICE_VARIANT := Gen2
228 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
229 endef
230 TARGET_DEVICES += ubnt_litebeam-ac-gen2
231
232 define Device/ubnt_nanobeam-ac
233 $(Device/ubnt-wa)
234 DEVICE_MODEL := NanoBeam AC
235 DEVICE_VARIANT := Gen1
236 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
237 endef
238 TARGET_DEVICES += ubnt_nanobeam-ac
239
240 define Device/ubnt_nanobeam-ac-gen2
241 $(Device/ubnt-wa)
242 DEVICE_MODEL := NanoBeam AC
243 DEVICE_VARIANT := Gen2
244 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
245 endef
246 TARGET_DEVICES += ubnt_nanobeam-ac-gen2
247
248 define Device/ubnt_nanobridge-m
249 $(Device/ubnt-xm)
250 SOC := ar7241
251 DEVICE_MODEL := NanoBridge M
252 DEVICE_PACKAGES += rssileds
253 SUPPORTED_DEVICES += bullet-m
254 endef
255 TARGET_DEVICES += ubnt_nanobridge-m
256
257 define Device/ubnt_nanostation-ac
258 $(Device/ubnt-wa)
259 DEVICE_MODEL := Nanostation AC
260 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
261 endef
262 TARGET_DEVICES += ubnt_nanostation-ac
263
264 define Device/ubnt_nanostation-ac-loco
265 $(Device/ubnt-wa)
266 DEVICE_MODEL := Nanostation AC loco
267 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
268 endef
269 TARGET_DEVICES += ubnt_nanostation-ac-loco
270
271 define Device/ubnt_nanostation-loco-m
272 $(Device/ubnt-xm)
273 SOC := ar7241
274 DEVICE_MODEL := Nanostation Loco M
275 DEVICE_PACKAGES += rssileds
276 SUPPORTED_DEVICES += bullet-m
277 endef
278 TARGET_DEVICES += ubnt_nanostation-loco-m
279
280 define Device/ubnt_nanostation-loco-m-xw
281 $(Device/ubnt-xw)
282 DEVICE_MODEL := Nanostation Loco M
283 DEVICE_PACKAGES += rssileds
284 SUPPORTED_DEVICES += loco-m-xw
285 endef
286 TARGET_DEVICES += ubnt_nanostation-loco-m-xw
287
288 define Device/ubnt_nanostation-m
289 $(Device/ubnt-xm)
290 SOC := ar7241
291 DEVICE_MODEL := Nanostation M
292 DEVICE_PACKAGES += rssileds
293 SUPPORTED_DEVICES += nanostation-m
294 endef
295 TARGET_DEVICES += ubnt_nanostation-m
296
297 define Device/ubnt_nanostation-m-xw
298 $(Device/ubnt-xw)
299 DEVICE_MODEL := Nanostation M
300 DEVICE_PACKAGES += rssileds
301 SUPPORTED_DEVICES += nanostation-m-xw
302 endef
303 TARGET_DEVICES += ubnt_nanostation-m-xw
304
305 define Device/ubnt_picostation-m
306 $(Device/ubnt-xm)
307 SOC := ar7241
308 DEVICE_MODEL := Picostation M
309 DEVICE_PACKAGES += rssileds
310 SUPPORTED_DEVICES += bullet-m
311 endef
312 TARGET_DEVICES += ubnt_picostation-m
313
314 define Device/ubnt_powerbeam-5ac-500
315 $(Device/ubnt-xc)
316 SOC := qca9558
317 DEVICE_MODEL := PowerBeam 5AC
318 DEVICE_VARIANT := 500
319 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
320 endef
321 TARGET_DEVICES += ubnt_powerbeam-5ac-500
322
323 define Device/ubnt_powerbeam-5ac-gen2
324 $(Device/ubnt-wa)
325 DEVICE_MODEL := PowerBeam 5AC
326 DEVICE_VARIANT := Gen2
327 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
328 endef
329 TARGET_DEVICES += ubnt_powerbeam-5ac-gen2
330
331 define Device/ubnt_powerbeam-m5-xw
332 $(Device/ubnt-xw)
333 DEVICE_MODEL := PowerBeam M5
334 DEVICE_PACKAGES += rssileds
335 SUPPORTED_DEVICES += loco-m-xw
336 endef
337 TARGET_DEVICES += ubnt_powerbeam-m5-xw
338
339 define Device/ubnt_powerbridge-m
340 $(Device/ubnt-xm)
341 SOC := ar7241
342 DEVICE_MODEL := PowerBridge M
343 DEVICE_PACKAGES += rssileds
344 SUPPORTED_DEVICES += bullet-m
345 endef
346 TARGET_DEVICES += ubnt_powerbridge-m
347
348 define Device/ubnt_rocket-5ac-lite
349 $(Device/ubnt-xc)
350 SOC := qca9558
351 DEVICE_MODEL := Rocket 5AC
352 DEVICE_VARIANT := Lite
353 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
354 endef
355 TARGET_DEVICES += ubnt_rocket-5ac-lite
356
357 define Device/ubnt_rocket-m
358 $(Device/ubnt-xm)
359 SOC := ar7241
360 DEVICE_MODEL := Rocket M
361 DEVICE_PACKAGES += rssileds
362 SUPPORTED_DEVICES += rocket-m
363 endef
364 TARGET_DEVICES += ubnt_rocket-m
365
366 define Device/ubnt_routerstation_common
367 DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
368 kmod-usb2 fconfig
369 DEVICE_VENDOR := Ubiquiti
370 SOC := ar7161
371 IMAGE_SIZE := 16128k
372 IMAGES += factory.bin
373 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
374 check-size
375 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | \
376 check-size | append-metadata
377 KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
378 KERNEL_INITRAMFS := kernel-bin | append-dtb
379 endef
380
381 define Device/ubnt_routerstation
382 $(Device/ubnt_routerstation_common)
383 DEVICE_MODEL := RouterStation
384 UBNT_BOARD := RS
385 UBNT_TYPE := RSx
386 UBNT_CHIP := ar7100
387 DEVICE_PACKAGES += -swconfig
388 SUPPORTED_DEVICES += routerstation
389 endef
390 TARGET_DEVICES += ubnt_routerstation
391
392 define Device/ubnt_routerstation-pro
393 $(Device/ubnt_routerstation_common)
394 DEVICE_MODEL := RouterStation Pro
395 UBNT_BOARD := RSPRO
396 UBNT_TYPE := RSPRO
397 UBNT_CHIP := ar7100pro
398 SUPPORTED_DEVICES += routerstation-pro
399 endef
400 TARGET_DEVICES += ubnt_routerstation-pro
401
402 define Device/ubnt_unifi
403 $(Device/ubnt-bz)
404 DEVICE_MODEL := UniFi
405 SUPPORTED_DEVICES += unifi
406 endef
407 TARGET_DEVICES += ubnt_unifi
408
409 define Device/ubnt_unifiac
410 DEVICE_VENDOR := Ubiquiti
411 SOC := qca9563
412 IMAGE_SIZE := 7744k
413 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
414 endef
415
416 define Device/ubnt_unifiac-lite
417 $(Device/ubnt_unifiac)
418 DEVICE_MODEL := UniFi AC Lite
419 SUPPORTED_DEVICES += unifiac-lite
420 endef
421 TARGET_DEVICES += ubnt_unifiac-lite
422
423 define Device/ubnt_unifiac-lr
424 $(Device/ubnt_unifiac)
425 DEVICE_MODEL := UniFi AC LR
426 SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
427 endef
428 TARGET_DEVICES += ubnt_unifiac-lr
429
430 define Device/ubnt_unifiac-mesh
431 $(Device/ubnt_unifiac)
432 DEVICE_MODEL := UniFi AC Mesh
433 SUPPORTED_DEVICES += unifiac-lite
434 endef
435 TARGET_DEVICES += ubnt_unifiac-mesh
436
437 define Device/ubnt_unifiac-mesh-pro
438 $(Device/ubnt_unifiac)
439 DEVICE_MODEL := UniFi AC Mesh Pro
440 SUPPORTED_DEVICES += unifiac-pro
441 endef
442 TARGET_DEVICES += ubnt_unifiac-mesh-pro
443
444 define Device/ubnt_unifiac-pro
445 $(Device/ubnt_unifiac)
446 DEVICE_MODEL := UniFi AC Pro
447 DEVICE_PACKAGES += kmod-usb2
448 SUPPORTED_DEVICES += unifiac-pro
449 endef
450 TARGET_DEVICES += ubnt_unifiac-pro
451
452 define Device/ubnt_unifi-ap-outdoor-plus
453 $(Device/ubnt-bz)
454 $(Device/ubnt-unifi-jffs2)
455 DEVICE_MODEL := UniFi AP Outdoor+
456 SUPPORTED_DEVICES += unifi-outdoor-plus
457 endef
458 TARGET_DEVICES += ubnt_unifi-ap-outdoor-plus
459
460 define Device/ubnt_unifi-ap-pro
461 $(Device/ubnt-unifi-jffs2)
462 SOC := ar9344
463 DEVICE_MODEL := UniFi AP Pro
464 UBNT_CHIP := ar934x
465 SUPPORTED_DEVICES += uap-pro
466 endef
467 TARGET_DEVICES += ubnt_unifi-ap-pro