3f4cc139169b0470a0c6ed716eaeaa4f7373be01
[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 # 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
169 DEVICE_VARIANT := LAP-120
170 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
171 endef
172 TARGET_DEVICES += ubnt_lap-120
173
174 define Device/ubnt_litebeam-ac-gen2
175 $(Device/ubnt-wa)
176 DEVICE_MODEL := LiteBeam AC
177 DEVICE_VARIANT := Gen2
178 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
179 endef
180 TARGET_DEVICES += ubnt_litebeam-ac-gen2
181
182 define Device/ubnt_nanobeam-ac
183 $(Device/ubnt-wa)
184 DEVICE_MODEL := NanoBeam AC
185 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
186 endef
187 TARGET_DEVICES += ubnt_nanobeam-ac
188
189 define Device/ubnt_nanobridge-m
190 $(Device/ubnt-xm)
191 SOC := ar7241
192 DEVICE_MODEL := NanoBridge M
193 DEVICE_PACKAGES += rssileds
194 SUPPORTED_DEVICES += bullet-m
195 endef
196 TARGET_DEVICES += ubnt_nanobridge-m
197
198 define Device/ubnt_nanostation-ac
199 $(Device/ubnt-wa)
200 DEVICE_MODEL := Nanostation AC
201 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
202 endef
203 TARGET_DEVICES += ubnt_nanostation-ac
204
205 define Device/ubnt_nanostation-ac-loco
206 $(Device/ubnt-wa)
207 DEVICE_MODEL := Nanostation AC loco
208 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
209 endef
210 TARGET_DEVICES += ubnt_nanostation-ac-loco
211
212 define Device/ubnt_nanostation-loco-m
213 $(Device/ubnt-xm)
214 SOC := ar7241
215 DEVICE_MODEL := Nanostation Loco M
216 DEVICE_PACKAGES += rssileds
217 SUPPORTED_DEVICES += bullet-m
218 endef
219 TARGET_DEVICES += ubnt_nanostation-loco-m
220
221 define Device/ubnt_nanostation-loco-m-xw
222 $(Device/ubnt-xw)
223 DEVICE_MODEL := Nanostation Loco M
224 DEVICE_PACKAGES += rssileds
225 SUPPORTED_DEVICES += loco-m-xw
226 endef
227 TARGET_DEVICES += ubnt_nanostation-loco-m-xw
228
229 define Device/ubnt_nanostation-m
230 $(Device/ubnt-xm)
231 SOC := ar7241
232 DEVICE_MODEL := Nanostation M
233 DEVICE_PACKAGES += rssileds
234 SUPPORTED_DEVICES += nanostation-m
235 endef
236 TARGET_DEVICES += ubnt_nanostation-m
237
238 define Device/ubnt_nanostation-m-xw
239 $(Device/ubnt-xw)
240 DEVICE_MODEL := Nanostation M
241 DEVICE_PACKAGES += rssileds
242 SUPPORTED_DEVICES += nanostation-m-xw
243 endef
244 TARGET_DEVICES += ubnt_nanostation-m-xw
245
246 define Device/ubnt_picostation-m
247 $(Device/ubnt-xm)
248 SOC := ar7241
249 DEVICE_MODEL := Picostation M
250 DEVICE_PACKAGES += rssileds
251 SUPPORTED_DEVICES += bullet-m
252 endef
253 TARGET_DEVICES += ubnt_picostation-m
254
255 define Device/ubnt_powerbeam-5ac-500
256 $(Device/ubnt-xc)
257 SOC := qca9558
258 DEVICE_MODEL := PowerBeam 5AC
259 DEVICE_VARIANT := 500
260 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
261 endef
262 TARGET_DEVICES += ubnt_powerbeam-5ac-500
263
264 define Device/ubnt_powerbeam-5ac-gen2
265 $(Device/ubnt-wa)
266 DEVICE_MODEL := PowerBeam 5AC
267 DEVICE_VARIANT := Gen2
268 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
269 endef
270 TARGET_DEVICES += ubnt_powerbeam-5ac-gen2
271
272 define Device/ubnt_rocket-m
273 $(Device/ubnt-xm)
274 SOC := ar7241
275 DEVICE_MODEL := Rocket-M
276 DEVICE_PACKAGES += rssileds
277 SUPPORTED_DEVICES += rocket-m
278 endef
279 TARGET_DEVICES += ubnt_rocket-m
280
281 define Device/ubnt_routerstation_common
282 DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \
283 kmod-usb2 fconfig
284 DEVICE_VENDOR := Ubiquiti
285 SOC := ar7161
286 IMAGE_SIZE := 16128k
287 IMAGES := factory.bin
288 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
289 check-size
290 KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
291 KERNEL_INITRAMFS := kernel-bin | append-dtb
292 endef
293
294 define Device/ubnt_routerstation
295 $(Device/ubnt_routerstation_common)
296 DEVICE_MODEL := RouterStation
297 UBNT_BOARD := RS
298 UBNT_TYPE := RSx
299 UBNT_CHIP := ar7100
300 DEVICE_PACKAGES += -swconfig
301 SUPPORTED_DEVICES += routerstation
302 endef
303 TARGET_DEVICES += ubnt_routerstation
304
305 define Device/ubnt_routerstation-pro
306 $(Device/ubnt_routerstation_common)
307 DEVICE_MODEL := RouterStation Pro
308 UBNT_BOARD := RSPRO
309 UBNT_TYPE := RSPRO
310 UBNT_CHIP := ar7100pro
311 SUPPORTED_DEVICES += routerstation-pro
312 endef
313 TARGET_DEVICES += ubnt_routerstation-pro
314
315 define Device/ubnt_unifi
316 $(Device/ubnt-bz)
317 DEVICE_MODEL := UniFi
318 SUPPORTED_DEVICES += unifi
319 endef
320 TARGET_DEVICES += ubnt_unifi
321
322 define Device/ubnt_unifiac
323 DEVICE_VENDOR := Ubiquiti
324 SOC := qca9563
325 IMAGE_SIZE := 7744k
326 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
327 endef
328
329 define Device/ubnt_unifiac-lite
330 $(Device/ubnt_unifiac)
331 DEVICE_MODEL := UniFi AC-Lite
332 SUPPORTED_DEVICES += unifiac-lite
333 endef
334 TARGET_DEVICES += ubnt_unifiac-lite
335
336 define Device/ubnt_unifiac-lr
337 $(Device/ubnt_unifiac)
338 DEVICE_MODEL := UniFi AC-LR
339 SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
340 endef
341 TARGET_DEVICES += ubnt_unifiac-lr
342
343 define Device/ubnt_unifiac-mesh
344 $(Device/ubnt_unifiac)
345 DEVICE_MODEL := UniFi AC-Mesh
346 SUPPORTED_DEVICES += unifiac-lite
347 endef
348 TARGET_DEVICES += ubnt_unifiac-mesh
349
350 define Device/ubnt_unifiac-mesh-pro
351 $(Device/ubnt_unifiac)
352 DEVICE_MODEL := UniFi AC-Mesh Pro
353 SUPPORTED_DEVICES += unifiac-pro
354 endef
355 TARGET_DEVICES += ubnt_unifiac-mesh-pro
356
357 define Device/ubnt_unifiac-pro
358 $(Device/ubnt_unifiac)
359 DEVICE_MODEL := UniFi AC-Pro
360 DEVICE_PACKAGES += kmod-usb2
361 SUPPORTED_DEVICES += unifiac-pro
362 endef
363 TARGET_DEVICES += ubnt_unifiac-pro