55d98ce5085a8308948bcba544c6e2a8c56e91ef
[openwrt/staging/wigyori.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 # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
17 # booting the image, the size doesn't matter.
18 define Build/mkubntimage-split
19 -[ -f $@ ] && ( \
20 dd if=$@ of=$@.old1 bs=1024k count=1; \
21 dd if=$@ of=$@.old2 bs=1024k skip=1; \
22 $(STAGING_DIR_HOST)/bin/mkfwimage -B $(UBNT_BOARD) \
23 -v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
24 -k $@.old1 -r $@.old2 -o $@; \
25 rm $@.old1 $@.old2 )
26 endef
27
28 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
29 # UBNT_TYPE e.g. one of (BZ, XM, XW)
30 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
31 # UBNT_VERSION e.g. one of (6.0.0, 8.5.3)
32 define Device/ubnt
33 DEVICE_VENDOR := Ubiquiti
34 DEVICE_PACKAGES := kmod-usb2
35 IMAGES += factory.bin
36 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
37 append-rootfs | pad-rootfs | check-size | mkubntimage-split
38 endef
39
40 define Device/ubnt-bz
41 $(Device/ubnt)
42 SOC := ar7241
43 IMAGE_SIZE := 7448k
44 UBNT_BOARD := XM
45 UBNT_CHIP := ar7240
46 UBNT_TYPE := BZ
47 UBNT_VERSION := 6.0.0
48 endef
49
50 define Device/ubnt-sw
51 $(Device/ubnt)
52 SOC := ar7242
53 DEVICE_PACKAGES += kmod-usb-ohci
54 IMAGE_SIZE := 7552k
55 UBNT_BOARD := SW
56 UBNT_CHIP := ar7240
57 UBNT_TYPE := SW
58 UBNT_VERSION := 1.4.1
59 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
60 endef
61
62 define Device/ubnt-wa
63 $(Device/ubnt)
64 SOC := ar9342
65 IMAGE_SIZE := 15744k
66 UBNT_BOARD := WA
67 UBNT_CHIP := ar934x
68 UBNT_TYPE := WA
69 UBNT_VERSION := 8.5.3
70 endef
71
72 define Device/ubnt-xc
73 $(Device/ubnt)
74 IMAGE_SIZE := 15744k
75 UBNT_BOARD := XC
76 UBNT_CHIP := qca955x
77 UBNT_TYPE := XC
78 UBNT_VERSION := 8.5.3
79 endef
80
81 define Device/ubnt-xm
82 $(Device/ubnt)
83 DEVICE_VARIANT := XM
84 DEVICE_PACKAGES += kmod-usb-ohci
85 IMAGE_SIZE := 7448k
86 UBNT_BOARD := XM
87 UBNT_CHIP := ar7240
88 UBNT_TYPE := XM
89 UBNT_VERSION := 6.0.0
90 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
91 endef
92
93 define Device/ubnt-xw
94 $(Device/ubnt)
95 SOC := ar9342
96 DEVICE_VARIANT := XW
97 IMAGE_SIZE := 7552k
98 UBNT_BOARD := XM
99 UBNT_CHIP := ar934x
100 UBNT_REVISION := 42.$(UBNT_REVISION)
101 UBNT_TYPE := XW
102 UBNT_VERSION := 6.0.4
103 endef
104
105 define Device/ubnt_acb-isp
106 $(Device/ubnt)
107 SOC := qca9533
108 DEVICE_MODEL := airCube ISP
109 IMAGE_SIZE := 15744k
110 UBNT_BOARD := ACB-ISP
111 UBNT_CHIP := qca9533
112 UBNT_TYPE := ACB
113 UBNT_VERSION := 2.5.0
114 endef
115 TARGET_DEVICES += ubnt_acb-isp
116
117 define Device/ubnt_airrouter
118 $(Device/ubnt-xm)
119 SOC := ar7241
120 DEVICE_MODEL := AirRouter
121 SUPPORTED_DEVICES += airrouter
122 endef
123 TARGET_DEVICES += ubnt_airrouter
124
125 define Device/ubnt_bullet-m-ar7240
126 $(Device/ubnt-xm)
127 SOC := ar7240
128 DEVICE_MODEL := Bullet M
129 DEVICE_VARIANT := XM (AR7240)
130 DEVICE_PACKAGES += rssileds
131 SUPPORTED_DEVICES += bullet-m
132 endef
133 TARGET_DEVICES += ubnt_bullet-m-ar7240
134
135 define Device/ubnt_bullet-m-ar7241
136 $(Device/ubnt-xm)
137 SOC := ar7241
138 DEVICE_MODEL := Bullet M
139 DEVICE_VARIANT := XM (AR7241)
140 DEVICE_PACKAGES += rssileds
141 SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
142 endef
143 TARGET_DEVICES += ubnt_bullet-m-ar7241
144
145 define Device/ubnt_bullet-m-xw
146 $(Device/ubnt-xw)
147 DEVICE_MODEL := Bullet M
148 DEVICE_PACKAGES += rssileds
149 SUPPORTED_DEVICES += bullet-m-xw
150 endef
151 TARGET_DEVICES += ubnt_bullet-m-xw
152
153 define Device/ubnt_edgeswitch-5xp
154 $(Device/ubnt-sw)
155 DEVICE_MODEL := EdgeSwitch 5XP
156 endef
157 TARGET_DEVICES += ubnt_edgeswitch-5xp
158
159 define Device/ubnt_edgeswitch-8xp
160 $(Device/ubnt-sw)
161 DEVICE_MODEL := EdgeSwitch 8XP
162 DEVICE_PACKAGES += kmod-switch-bcm53xx-mdio
163 endef
164 TARGET_DEVICES += ubnt_edgeswitch-8xp
165
166 define Device/ubnt_lap-120
167 $(Device/ubnt-wa)
168 DEVICE_MODEL := LiteAP ac (LAP-120)
169 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
170 endef
171 TARGET_DEVICES += ubnt_lap-120
172
173 define Device/ubnt_litebeam-ac-gen2
174 $(Device/ubnt-wa)
175 DEVICE_MODEL := LiteBeam AC
176 DEVICE_VARIANT := Gen2
177 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
178 endef
179 TARGET_DEVICES += ubnt_litebeam-ac-gen2
180
181 define Device/ubnt_nanobeam-ac
182 $(Device/ubnt-wa)
183 DEVICE_MODEL := NanoBeam AC
184 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
185 endef
186 TARGET_DEVICES += ubnt_nanobeam-ac
187
188 define Device/ubnt_nanobridge-m
189 $(Device/ubnt-xm)
190 SOC := ar7241
191 DEVICE_MODEL := NanoBridge M
192 DEVICE_PACKAGES += rssileds
193 SUPPORTED_DEVICES += bullet-m
194 endef
195 TARGET_DEVICES += ubnt_nanobridge-m
196
197 define Device/ubnt_nanostation-ac
198 $(Device/ubnt-wa)
199 DEVICE_MODEL := Nanostation AC
200 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
201 endef
202 TARGET_DEVICES += ubnt_nanostation-ac
203
204 define Device/ubnt_nanostation-ac-loco
205 $(Device/ubnt-wa)
206 DEVICE_MODEL := Nanostation AC loco
207 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
208 endef
209 TARGET_DEVICES += ubnt_nanostation-ac-loco
210
211 define Device/ubnt_nanostation-loco-m
212 $(Device/ubnt-xm)
213 SOC := ar7241
214 DEVICE_MODEL := Nanostation Loco M
215 DEVICE_PACKAGES += rssileds
216 SUPPORTED_DEVICES += bullet-m
217 endef
218 TARGET_DEVICES += ubnt_nanostation-loco-m
219
220 define Device/ubnt_nanostation-loco-m-xw
221 $(Device/ubnt-xw)
222 DEVICE_MODEL := Nanostation Loco M
223 DEVICE_PACKAGES += rssileds
224 SUPPORTED_DEVICES += loco-m-xw
225 endef
226 TARGET_DEVICES += ubnt_nanostation-loco-m-xw
227
228 define Device/ubnt_nanostation-m
229 $(Device/ubnt-xm)
230 SOC := ar7241
231 DEVICE_MODEL := Nanostation M
232 DEVICE_PACKAGES += rssileds
233 SUPPORTED_DEVICES += nanostation-m
234 endef
235 TARGET_DEVICES += ubnt_nanostation-m
236
237 define Device/ubnt_nanostation-m-xw
238 $(Device/ubnt-xw)
239 DEVICE_MODEL := Nanostation M
240 DEVICE_PACKAGES += rssileds
241 SUPPORTED_DEVICES += nanostation-m-xw
242 endef
243 TARGET_DEVICES += ubnt_nanostation-m-xw
244
245 define Device/ubnt_picostation-m
246 $(Device/ubnt-xm)
247 SOC := ar7241
248 DEVICE_MODEL := Picostation M
249 DEVICE_PACKAGES += rssileds
250 SUPPORTED_DEVICES += bullet-m
251 endef
252 TARGET_DEVICES += ubnt_picostation-m
253
254 define Device/ubnt_powerbeam-5ac-500
255 $(Device/ubnt-xc)
256 SOC := qca9558
257 DEVICE_MODEL := PowerBeam 5AC
258 DEVICE_VARIANT := 500
259 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
260 endef
261 TARGET_DEVICES += ubnt_powerbeam-5ac-500
262
263 define Device/ubnt_powerbeam-5ac-gen2
264 $(Device/ubnt-wa)
265 DEVICE_MODEL := PowerBeam 5AC
266 DEVICE_VARIANT := Gen2
267 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
268 endef
269 TARGET_DEVICES += ubnt_powerbeam-5ac-gen2
270
271 define Device/ubnt_powerbridge-m
272 $(Device/ubnt-xm)
273 SOC := ar7241
274 DEVICE_MODEL := PowerBridge M
275 DEVICE_PACKAGES += rssileds
276 SUPPORTED_DEVICES += bullet-m
277 endef
278 TARGET_DEVICES += ubnt_powerbridge-m
279
280 define Device/ubnt_rocket-m
281 $(Device/ubnt-xm)
282 SOC := ar7241
283 DEVICE_MODEL := Rocket M
284 DEVICE_PACKAGES += rssileds
285 SUPPORTED_DEVICES += rocket-m
286 endef
287 TARGET_DEVICES += ubnt_rocket-m
288
289 define Device/ubnt_routerstation_common
290 DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \
291 kmod-usb2 fconfig
292 DEVICE_VENDOR := Ubiquiti
293 SOC := ar7161
294 IMAGE_SIZE := 16128k
295 IMAGES := factory.bin
296 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
297 check-size
298 KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
299 KERNEL_INITRAMFS := kernel-bin | append-dtb
300 endef
301
302 define Device/ubnt_routerstation
303 $(Device/ubnt_routerstation_common)
304 DEVICE_MODEL := RouterStation
305 UBNT_BOARD := RS
306 UBNT_TYPE := RSx
307 UBNT_CHIP := ar7100
308 DEVICE_PACKAGES += -swconfig
309 SUPPORTED_DEVICES += routerstation
310 endef
311 TARGET_DEVICES += ubnt_routerstation
312
313 define Device/ubnt_routerstation-pro
314 $(Device/ubnt_routerstation_common)
315 DEVICE_MODEL := RouterStation Pro
316 UBNT_BOARD := RSPRO
317 UBNT_TYPE := RSPRO
318 UBNT_CHIP := ar7100pro
319 SUPPORTED_DEVICES += routerstation-pro
320 endef
321 TARGET_DEVICES += ubnt_routerstation-pro
322
323 define Device/ubnt_unifi
324 $(Device/ubnt-bz)
325 DEVICE_MODEL := UniFi
326 SUPPORTED_DEVICES += unifi
327 endef
328 TARGET_DEVICES += ubnt_unifi
329
330 define Device/ubnt_unifiac
331 DEVICE_VENDOR := Ubiquiti
332 SOC := qca9563
333 IMAGE_SIZE := 7744k
334 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
335 endef
336
337 define Device/ubnt_unifiac-lite
338 $(Device/ubnt_unifiac)
339 DEVICE_MODEL := UniFi AC Lite
340 SUPPORTED_DEVICES += unifiac-lite
341 endef
342 TARGET_DEVICES += ubnt_unifiac-lite
343
344 define Device/ubnt_unifiac-lr
345 $(Device/ubnt_unifiac)
346 DEVICE_MODEL := UniFi AC LR
347 SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
348 endef
349 TARGET_DEVICES += ubnt_unifiac-lr
350
351 define Device/ubnt_unifiac-mesh
352 $(Device/ubnt_unifiac)
353 DEVICE_MODEL := UniFi AC Mesh
354 SUPPORTED_DEVICES += unifiac-lite
355 endef
356 TARGET_DEVICES += ubnt_unifiac-mesh
357
358 define Device/ubnt_unifiac-mesh-pro
359 $(Device/ubnt_unifiac)
360 DEVICE_MODEL := UniFi AC Mesh Pro
361 SUPPORTED_DEVICES += unifiac-pro
362 endef
363 TARGET_DEVICES += ubnt_unifiac-mesh-pro
364
365 define Device/ubnt_unifiac-pro
366 $(Device/ubnt_unifiac)
367 DEVICE_MODEL := UniFi AC Pro
368 DEVICE_PACKAGES += kmod-usb2
369 SUPPORTED_DEVICES += unifiac-pro
370 endef
371 TARGET_DEVICES += ubnt_unifiac-pro