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