ath79: add missing UBNT_REVISION
[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_REVISION := 42.$(UBNT_REVISION)
107 UBNT_TYPE := XM
108 UBNT_VERSION := 6.0.0
109 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
110 endef
111
112 define Device/ubnt-xw
113 $(Device/ubnt)
114 SOC := ar9342
115 DEVICE_VARIANT := XW
116 IMAGE_SIZE := 7552k
117 UBNT_BOARD := XM
118 UBNT_CHIP := ar934x
119 UBNT_REVISION := 42.$(UBNT_REVISION)
120 UBNT_TYPE := XW
121 UBNT_VERSION := 6.0.4
122 endef
123
124 define Device/ubnt-unifi-jffs2
125 $(Device/ubnt)
126 KERNEL_SIZE := 3072k
127 IMAGE_SIZE := 15744k
128 UBNT_TYPE := BZ
129 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | jffs2 kernel0
130 IMAGES := sysupgrade.bin factory.bin
131 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-rootfs |\
132 pad-rootfs | check-size | append-metadata
133 IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage2
134 endef
135
136 define Device/ubnt-acb
137 $(Device/ubnt)
138 IMAGE_SIZE := 15744k
139 UBNT_BOARD := ACB
140 UBNT_TYPE := ACB
141 UBNT_VERSION := 2.5.0
142 endef
143
144 define Device/ubnt_aircube-ac
145 $(Device/ubnt-acb)
146 SOC := ar9342
147 DEVICE_MODEL := airCube AC
148 UBNT_CHIP := ar9342
149 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
150 endef
151 TARGET_DEVICES += ubnt_aircube-ac
152
153 define Device/ubnt_aircube-isp
154 $(Device/ubnt-acb)
155 SOC := qca9533
156 DEVICE_MODEL := airCube ISP
157 UBNT_CHIP := qca9533
158 SUPPORTED_DEVICES += ubnt,acb-isp
159 endef
160 TARGET_DEVICES += ubnt_aircube-isp
161
162 define Device/ubnt_airrouter
163 $(Device/ubnt-xm)
164 SOC := ar7241
165 DEVICE_MODEL := AirRouter
166 SUPPORTED_DEVICES += airrouter
167 endef
168 TARGET_DEVICES += ubnt_airrouter
169
170 define Device/ubnt_bullet-ac
171 $(Device/ubnt-2wa)
172 DEVICE_MODEL := Bullet AC
173 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
174 endef
175 TARGET_DEVICES += ubnt_bullet-ac
176
177 define Device/ubnt_bullet-m-ar7240
178 $(Device/ubnt-xm)
179 SOC := ar7240
180 DEVICE_MODEL := Bullet M
181 DEVICE_VARIANT := XM (AR7240)
182 DEVICE_PACKAGES += rssileds
183 SUPPORTED_DEVICES += bullet-m
184 endef
185 TARGET_DEVICES += ubnt_bullet-m-ar7240
186
187 define Device/ubnt_bullet-m-ar7241
188 $(Device/ubnt-xm)
189 SOC := ar7241
190 DEVICE_MODEL := Bullet M
191 DEVICE_VARIANT := XM (AR7241)
192 DEVICE_PACKAGES += rssileds
193 SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
194 endef
195 TARGET_DEVICES += ubnt_bullet-m-ar7241
196
197 define Device/ubnt_bullet-m-xw
198 $(Device/ubnt-xw)
199 DEVICE_MODEL := Bullet M
200 DEVICE_PACKAGES += rssileds
201 SUPPORTED_DEVICES += bullet-m-xw
202 endef
203 TARGET_DEVICES += ubnt_bullet-m-xw
204
205 define Device/ubnt_edgeswitch-5xp
206 $(Device/ubnt-sw)
207 DEVICE_MODEL := EdgeSwitch 5XP
208 endef
209 TARGET_DEVICES += ubnt_edgeswitch-5xp
210
211 define Device/ubnt_edgeswitch-8xp
212 $(Device/ubnt-sw)
213 DEVICE_MODEL := EdgeSwitch 8XP
214 DEVICE_PACKAGES += kmod-switch-bcm53xx-mdio
215 endef
216 TARGET_DEVICES += ubnt_edgeswitch-8xp
217
218 define Device/ubnt_lap-120
219 $(Device/ubnt-wa)
220 DEVICE_MODEL := LiteAP ac (LAP-120)
221 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
222 endef
223 TARGET_DEVICES += ubnt_lap-120
224
225 define Device/ubnt_litebeam-ac-gen2
226 $(Device/ubnt-wa)
227 DEVICE_MODEL := LiteBeam AC
228 DEVICE_VARIANT := Gen2
229 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
230 endef
231 TARGET_DEVICES += ubnt_litebeam-ac-gen2
232
233 define Device/ubnt_nanobeam-ac
234 $(Device/ubnt-wa)
235 DEVICE_MODEL := NanoBeam AC
236 DEVICE_VARIANT := Gen1
237 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
238 endef
239 TARGET_DEVICES += ubnt_nanobeam-ac
240
241 define Device/ubnt_nanobeam-ac-gen2
242 $(Device/ubnt-wa)
243 DEVICE_MODEL := NanoBeam AC
244 DEVICE_VARIANT := Gen2
245 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
246 endef
247 TARGET_DEVICES += ubnt_nanobeam-ac-gen2
248
249 define Device/ubnt_nanobridge-m
250 $(Device/ubnt-xm)
251 SOC := ar7241
252 DEVICE_MODEL := NanoBridge M
253 DEVICE_PACKAGES += rssileds
254 SUPPORTED_DEVICES += bullet-m
255 endef
256 TARGET_DEVICES += ubnt_nanobridge-m
257
258 define Device/ubnt_nanostation-ac
259 $(Device/ubnt-wa)
260 DEVICE_MODEL := Nanostation AC
261 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
262 endef
263 TARGET_DEVICES += ubnt_nanostation-ac
264
265 define Device/ubnt_nanostation-ac-loco
266 $(Device/ubnt-wa)
267 DEVICE_MODEL := Nanostation AC loco
268 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
269 endef
270 TARGET_DEVICES += ubnt_nanostation-ac-loco
271
272 define Device/ubnt_nanostation-loco-m
273 $(Device/ubnt-xm)
274 SOC := ar7241
275 DEVICE_MODEL := Nanostation Loco M
276 DEVICE_PACKAGES += rssileds
277 SUPPORTED_DEVICES += bullet-m
278 endef
279 TARGET_DEVICES += ubnt_nanostation-loco-m
280
281 define Device/ubnt_nanostation-loco-m-xw
282 $(Device/ubnt-xw)
283 DEVICE_MODEL := Nanostation Loco M
284 DEVICE_PACKAGES += rssileds
285 SUPPORTED_DEVICES += loco-m-xw
286 endef
287 TARGET_DEVICES += ubnt_nanostation-loco-m-xw
288
289 define Device/ubnt_nanostation-m
290 $(Device/ubnt-xm)
291 SOC := ar7241
292 DEVICE_MODEL := Nanostation M
293 DEVICE_PACKAGES += rssileds
294 SUPPORTED_DEVICES += nanostation-m
295 endef
296 TARGET_DEVICES += ubnt_nanostation-m
297
298 define Device/ubnt_nanostation-m-xw
299 $(Device/ubnt-xw)
300 DEVICE_MODEL := Nanostation M
301 DEVICE_PACKAGES += rssileds
302 SUPPORTED_DEVICES += nanostation-m-xw
303 endef
304 TARGET_DEVICES += ubnt_nanostation-m-xw
305
306 define Device/ubnt_picostation-m
307 $(Device/ubnt-xm)
308 SOC := ar7241
309 DEVICE_MODEL := Picostation M
310 DEVICE_PACKAGES += rssileds
311 SUPPORTED_DEVICES += bullet-m
312 endef
313 TARGET_DEVICES += ubnt_picostation-m
314
315 define Device/ubnt_powerbeam-5ac-500
316 $(Device/ubnt-xc)
317 SOC := qca9558
318 DEVICE_MODEL := PowerBeam 5AC
319 DEVICE_VARIANT := 500
320 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
321 endef
322 TARGET_DEVICES += ubnt_powerbeam-5ac-500
323
324 define Device/ubnt_powerbeam-5ac-gen2
325 $(Device/ubnt-wa)
326 DEVICE_MODEL := PowerBeam 5AC
327 DEVICE_VARIANT := Gen2
328 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
329 endef
330 TARGET_DEVICES += ubnt_powerbeam-5ac-gen2
331
332 define Device/ubnt_powerbeam-m2-xw
333 $(Device/ubnt-xw)
334 DEVICE_MODEL := PowerBeam M2
335 DEVICE_PACKAGES += rssileds
336 SUPPORTED_DEVICES += loco-m-xw
337 endef
338 TARGET_DEVICES += ubnt_powerbeam-m2-xw
339
340 define Device/ubnt_powerbeam-m5-xw
341 $(Device/ubnt-xw)
342 DEVICE_MODEL := PowerBeam M5
343 DEVICE_PACKAGES += rssileds
344 SUPPORTED_DEVICES += loco-m-xw
345 endef
346 TARGET_DEVICES += ubnt_powerbeam-m5-xw
347
348 define Device/ubnt_powerbridge-m
349 $(Device/ubnt-xm)
350 SOC := ar7241
351 DEVICE_MODEL := PowerBridge M
352 DEVICE_PACKAGES += rssileds
353 SUPPORTED_DEVICES += bullet-m
354 endef
355 TARGET_DEVICES += ubnt_powerbridge-m
356
357 define Device/ubnt_rocket-5ac-lite
358 $(Device/ubnt-xc)
359 SOC := qca9558
360 DEVICE_MODEL := Rocket 5AC
361 DEVICE_VARIANT := Lite
362 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
363 endef
364 TARGET_DEVICES += ubnt_rocket-5ac-lite
365
366 define Device/ubnt_rocket-m
367 $(Device/ubnt-xm)
368 SOC := ar7241
369 DEVICE_MODEL := Rocket M
370 DEVICE_PACKAGES += rssileds
371 SUPPORTED_DEVICES += rocket-m
372 endef
373 TARGET_DEVICES += ubnt_rocket-m
374
375 define Device/ubnt_routerstation_common
376 DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
377 kmod-usb2 fconfig
378 DEVICE_VENDOR := Ubiquiti
379 SOC := ar7161
380 IMAGE_SIZE := 16128k
381 IMAGES += factory.bin
382 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
383 check-size
384 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | \
385 check-size | append-metadata
386 KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
387 KERNEL_INITRAMFS := kernel-bin | append-dtb
388 endef
389
390 define Device/ubnt_routerstation
391 $(Device/ubnt_routerstation_common)
392 DEVICE_MODEL := RouterStation
393 UBNT_BOARD := RS
394 UBNT_TYPE := RSx
395 UBNT_CHIP := ar7100
396 DEVICE_PACKAGES += -swconfig
397 SUPPORTED_DEVICES += routerstation
398 endef
399 TARGET_DEVICES += ubnt_routerstation
400
401 define Device/ubnt_routerstation-pro
402 $(Device/ubnt_routerstation_common)
403 DEVICE_MODEL := RouterStation Pro
404 UBNT_BOARD := RSPRO
405 UBNT_TYPE := RSPRO
406 UBNT_CHIP := ar7100pro
407 SUPPORTED_DEVICES += routerstation-pro
408 endef
409 TARGET_DEVICES += ubnt_routerstation-pro
410
411 define Device/ubnt_unifi
412 $(Device/ubnt-bz)
413 DEVICE_MODEL := UniFi
414 SUPPORTED_DEVICES += unifi
415 endef
416 TARGET_DEVICES += ubnt_unifi
417
418 define Device/ubnt_unifiac
419 DEVICE_VENDOR := Ubiquiti
420 SOC := qca9563
421 IMAGE_SIZE := 7744k
422 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
423 endef
424
425 define Device/ubnt_unifiac-lite
426 $(Device/ubnt_unifiac)
427 DEVICE_MODEL := UniFi AC Lite
428 SUPPORTED_DEVICES += unifiac-lite
429 endef
430 TARGET_DEVICES += ubnt_unifiac-lite
431
432 define Device/ubnt_unifiac-lr
433 $(Device/ubnt_unifiac)
434 DEVICE_MODEL := UniFi AC LR
435 SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
436 endef
437 TARGET_DEVICES += ubnt_unifiac-lr
438
439 define Device/ubnt_unifiac-mesh
440 $(Device/ubnt_unifiac)
441 DEVICE_MODEL := UniFi AC Mesh
442 SUPPORTED_DEVICES += unifiac-lite
443 endef
444 TARGET_DEVICES += ubnt_unifiac-mesh
445
446 define Device/ubnt_unifiac-mesh-pro
447 $(Device/ubnt_unifiac)
448 DEVICE_MODEL := UniFi AC Mesh Pro
449 SUPPORTED_DEVICES += unifiac-pro
450 endef
451 TARGET_DEVICES += ubnt_unifiac-mesh-pro
452
453 define Device/ubnt_unifiac-pro
454 $(Device/ubnt_unifiac)
455 DEVICE_MODEL := UniFi AC Pro
456 DEVICE_PACKAGES += kmod-usb2
457 SUPPORTED_DEVICES += unifiac-pro
458 endef
459 TARGET_DEVICES += ubnt_unifiac-pro
460
461 define Device/ubnt_unifi-ap-outdoor-plus
462 $(Device/ubnt-bz)
463 $(Device/ubnt-unifi-jffs2)
464 DEVICE_MODEL := UniFi AP Outdoor+
465 SUPPORTED_DEVICES += unifi-outdoor-plus
466 endef
467 TARGET_DEVICES += ubnt_unifi-ap-outdoor-plus
468
469 define Device/ubnt_unifi-ap-pro
470 $(Device/ubnt-unifi-jffs2)
471 SOC := ar9344
472 DEVICE_MODEL := UniFi AP Pro
473 UBNT_CHIP := ar934x
474 SUPPORTED_DEVICES += uap-pro
475 endef
476 TARGET_DEVICES += ubnt_unifi-ap-pro