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