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