ath79: rename ubnt_bullet-m to ubnt_bullet-m-ar7241
[oweals/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.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 $$$$(IMAGE_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-ar7241
117   $(Device/ubnt-xm)
118   SOC := ar7241
119   DEVICE_MODEL := Bullet-M
120   DEVICE_VARIANT := XM (AR7241)
121   DEVICE_PACKAGES += rssileds
122   SUPPORTED_DEVICES += bullet-m ubnt,bullet-m
123 endef
124 TARGET_DEVICES += ubnt_bullet-m-ar7241
125
126 define Device/ubnt_bullet-m-xw
127   $(Device/ubnt-xw)
128   DEVICE_MODEL := Bullet-M
129   DEVICE_PACKAGES += rssileds
130   SUPPORTED_DEVICES += bullet-m-xw
131 endef
132 TARGET_DEVICES += ubnt_bullet-m-xw
133
134 define Device/ubnt_edgeswitch-5xp
135   $(Device/ubnt-sw)
136   DEVICE_MODEL := EdgeSwitch 5XP
137 endef
138 TARGET_DEVICES += ubnt_edgeswitch-5xp
139
140 define Device/ubnt_edgeswitch-8xp
141   $(Device/ubnt-sw)
142   DEVICE_MODEL := EdgeSwitch 8XP
143   DEVICE_PACKAGES += switch-bcm53xx-mdio
144 endef
145 TARGET_DEVICES += ubnt_edgeswitch-8xp
146
147 define Device/ubnt_lap-120
148   $(Device/ubnt-wa)
149   DEVICE_MODEL := LiteAP ac
150   DEVICE_VARIANT := LAP-120
151   DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
152 endef
153 TARGET_DEVICES += ubnt_lap-120
154
155 define Device/ubnt_litebeam-ac-gen2
156   $(Device/ubnt-wa)
157   DEVICE_MODEL := LiteBeam AC
158   DEVICE_VARIANT := Gen2
159   DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
160 endef
161 TARGET_DEVICES += ubnt_litebeam-ac-gen2
162
163 define Device/ubnt_nanobeam-ac
164   $(Device/ubnt-wa)
165   DEVICE_MODEL := NanoBeam AC
166   DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
167 endef
168 TARGET_DEVICES += ubnt_nanobeam-ac
169
170 define Device/ubnt_nanostation-ac
171   $(Device/ubnt-wa)
172   DEVICE_MODEL := Nanostation AC
173   DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
174 endef
175 TARGET_DEVICES += ubnt_nanostation-ac
176
177 define Device/ubnt_nanostation-ac-loco
178   $(Device/ubnt-wa)
179   DEVICE_MODEL := Nanostation AC loco
180   DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
181 endef
182 TARGET_DEVICES += ubnt_nanostation-ac-loco
183
184 define Device/ubnt_nanostation-loco-m
185   $(Device/ubnt-xm)
186   SOC := ar7241
187   DEVICE_MODEL := Nanostation Loco M
188   DEVICE_PACKAGES += rssileds
189   SUPPORTED_DEVICES += bullet-m
190 endef
191 TARGET_DEVICES += ubnt_nanostation-loco-m
192
193 define Device/ubnt_nanostation-loco-m-xw
194   $(Device/ubnt-xw)
195   DEVICE_MODEL := Nanostation Loco M
196   DEVICE_PACKAGES += rssileds
197   SUPPORTED_DEVICES += loco-m-xw
198 endef
199 TARGET_DEVICES += ubnt_nanostation-loco-m-xw
200
201 define Device/ubnt_nanostation-m
202   $(Device/ubnt-xm)
203   SOC := ar7241
204   DEVICE_MODEL := Nanostation M
205   DEVICE_PACKAGES += rssileds
206   SUPPORTED_DEVICES += nanostation-m
207 endef
208 TARGET_DEVICES += ubnt_nanostation-m
209
210 define Device/ubnt_nanostation-m-xw
211   $(Device/ubnt-xw)
212   DEVICE_MODEL := Nanostation M
213   DEVICE_PACKAGES += rssileds
214   SUPPORTED_DEVICES += nanostation-m-xw
215 endef
216 TARGET_DEVICES += ubnt_nanostation-m-xw
217
218 define Device/ubnt_picostation-m
219   $(Device/ubnt-xm)
220   SOC := ar7241
221   DEVICE_MODEL := Picostation M
222   DEVICE_PACKAGES += rssileds
223   SUPPORTED_DEVICES += bullet-m
224 endef
225 TARGET_DEVICES += ubnt_picostation-m
226
227 define Device/ubnt_rocket-m
228   $(Device/ubnt-xm)
229   SOC := ar7241
230   DEVICE_MODEL := Rocket-M
231   DEVICE_PACKAGES += rssileds
232   SUPPORTED_DEVICES += rocket-m
233 endef
234 TARGET_DEVICES += ubnt_rocket-m
235
236 define Device/ubnt_routerstation_common
237   DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \
238         kmod-usb2 fconfig
239   DEVICE_VENDOR := Ubiquiti
240   SOC := ar7161
241   IMAGE_SIZE := 16128k
242   IMAGES := factory.bin
243   IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
244         check-size $$$$(IMAGE_SIZE)
245   KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
246   KERNEL_INITRAMFS := kernel-bin | append-dtb
247 endef
248
249 define Device/ubnt_routerstation
250   $(Device/ubnt_routerstation_common)
251   DEVICE_MODEL := RouterStation
252   UBNT_BOARD := RS
253   UBNT_TYPE := RSx
254   UBNT_CHIP := ar7100
255   DEVICE_PACKAGES += -swconfig
256   SUPPORTED_DEVICES += routerstation
257 endef
258 TARGET_DEVICES += ubnt_routerstation
259
260 define Device/ubnt_routerstation-pro
261   $(Device/ubnt_routerstation_common)
262   DEVICE_MODEL := RouterStation Pro
263   UBNT_BOARD := RSPRO
264   UBNT_TYPE := RSPRO
265   UBNT_CHIP := ar7100pro
266   SUPPORTED_DEVICES += routerstation-pro
267 endef
268 TARGET_DEVICES += ubnt_routerstation-pro
269
270 define Device/ubnt_unifi
271   $(Device/ubnt-bz)
272   DEVICE_MODEL := UniFi
273   SUPPORTED_DEVICES += unifi
274 endef
275 TARGET_DEVICES += ubnt_unifi
276
277 define Device/ubnt_unifiac
278   DEVICE_VENDOR := Ubiquiti
279   SOC := qca9563
280   IMAGE_SIZE := 7744k
281   DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
282 endef
283
284 define Device/ubnt_unifiac-lite
285   $(Device/ubnt_unifiac)
286   DEVICE_MODEL := UniFi AC-Lite
287   SUPPORTED_DEVICES += unifiac-lite
288 endef
289 TARGET_DEVICES += ubnt_unifiac-lite
290
291 define Device/ubnt_unifiac-lr
292   $(Device/ubnt_unifiac)
293   DEVICE_MODEL := UniFi AC-LR
294   SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
295 endef
296 TARGET_DEVICES += ubnt_unifiac-lr
297
298 define Device/ubnt_unifiac-mesh
299   $(Device/ubnt_unifiac)
300   DEVICE_MODEL := UniFi AC-Mesh
301   SUPPORTED_DEVICES += unifiac-lite
302 endef
303 TARGET_DEVICES += ubnt_unifiac-mesh
304
305 define Device/ubnt_unifiac-mesh-pro
306   $(Device/ubnt_unifiac)
307   DEVICE_MODEL := UniFi AC-Mesh Pro
308   SUPPORTED_DEVICES += unifiac-pro
309 endef
310 TARGET_DEVICES += ubnt_unifiac-mesh-pro
311
312 define Device/ubnt_unifiac-pro
313   $(Device/ubnt_unifiac)
314   DEVICE_MODEL := UniFi AC-Pro
315   DEVICE_PACKAGES += kmod-usb2
316   SUPPORTED_DEVICES += unifiac-pro
317 endef
318 TARGET_DEVICES += ubnt_unifiac-pro