ath79: add support for Ubiquiti LiteBeam AC Gen2
[openwrt/staging/mkresin.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 \
12 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
13 -k $(IMAGE_KERNEL) \
14 -r $@ \
15 -o $@
16 endef
17
18 # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
19 # booting the image, the size doesn't matter.
20 define Build/mkubntimage-split
21 -[ -f $@ ] && ( \
22 dd if=$@ of=$@.old1 bs=1024k count=1; \
23 dd if=$@ of=$@.old2 bs=1024k skip=1; \
24 $(STAGING_DIR_HOST)/bin/mkfwimage \
25 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
26 -k $@.old1 \
27 -r $@.old2 \
28 -o $@; \
29 rm $@.old1 $@.old2 )
30 endef
31
32 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
33 # UBNT_TYPE e.g. one of (BZ, XM, XW)
34 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
35 # UBNT_VERSION e.g. one of (6.0.0, 8.5.0)
36 define Device/ubnt
37 DEVICE_VENDOR := Ubiquiti
38 DEVICE_PACKAGES := kmod-usb2
39 UBNT_BOARD := XM
40 UBNT_VERSION := 6.0.0
41 IMAGES += factory.bin
42 IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
43 append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
44 endef
45
46 define Device/ubnt-bz
47 $(Device/ubnt)
48 IMAGE_SIZE := 7448k
49 UBNT_TYPE := BZ
50 UBNT_CHIP := ar7240
51 ATH_SOC := ar7241
52 endef
53
54 define Device/ubnt-wa
55 $(Device/ubnt)
56 IMAGE_SIZE := 15744k
57 UBNT_TYPE := WA
58 UBNT_CHIP := ar934x
59 UBNT_BOARD := WA
60 UBNT_VERSION := 8.5.0
61 ATH_SOC := ar9342
62 endef
63
64 define Device/ubnt-xm
65 $(Device/ubnt)
66 DEVICE_VARIANT := XM
67 DEVICE_PACKAGES += kmod-usb-ohci
68 IMAGE_SIZE := 7448k
69 UBNT_TYPE := XM
70 UBNT_CHIP := ar7240
71 ATH_SOC := ar7241
72 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
73 endef
74
75 define Device/ubnt-xw
76 $(Device/ubnt)
77 DEVICE_VARIANT := XW
78 IMAGE_SIZE := 7552k
79 UBNT_TYPE := XW
80 UBNT_CHIP := ar934x
81 UBNT_BOARD := XM
82 UBNT_VERSION := 6.0.4
83 UBNT_REVISION := 42.$(UBNT_REVISION)
84 ATH_SOC := ar9342
85 endef
86
87 define Device/ubnt_acb-isp
88 $(Device/ubnt)
89 ATH_SOC := qca9533
90 IMAGE_SIZE := 15744k
91 DEVICE_MODEL := airCube ISP
92 UBNT_BOARD := ACB-ISP
93 UBNT_TYPE := ACB
94 UBNT_CHIP := qca9533
95 IMAGES := sysupgrade.bin
96 endef
97 TARGET_DEVICES += ubnt_acb-isp
98
99 define Device/ubnt_airrouter
100 $(Device/ubnt-xm)
101 DEVICE_MODEL := AirRouter
102 SUPPORTED_DEVICES += airrouter
103 endef
104 TARGET_DEVICES += ubnt_airrouter
105
106 define Device/ubnt_bullet-m
107 $(Device/ubnt-xm)
108 DEVICE_MODEL := Bullet-M
109 DEVICE_PACKAGES += rssileds
110 SUPPORTED_DEVICES += bullet-m
111 endef
112 TARGET_DEVICES += ubnt_bullet-m
113
114 define Device/ubnt_bullet-m-xw
115 $(Device/ubnt-xw)
116 DEVICE_MODEL := Bullet-M
117 DEVICE_PACKAGES += rssileds
118 SUPPORTED_DEVICES += bullet-m-xw
119 endef
120 TARGET_DEVICES += ubnt_bullet-m-xw
121
122 define Device/ubnt_lap-120
123 $(Device/ubnt-wa)
124 DEVICE_MODEL := LiteAP ac
125 DEVICE_VARIANT := LAP-120
126 DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
127 endef
128 TARGET_DEVICES += ubnt_lap-120
129
130 define Device/ubnt_litebeam-ac-gen2
131 $(Device/ubnt-wa)
132 DEVICE_MODEL := LiteBeam AC
133 DEVICE_VARIANT := Gen2
134 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
135 endef
136 TARGET_DEVICES += ubnt_litebeam-ac-gen2
137
138 define Device/ubnt_nanobeam-ac
139 $(Device/ubnt-wa)
140 DEVICE_MODEL := NanoBeam AC
141 DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds
142 endef
143 TARGET_DEVICES += ubnt_nanobeam-ac
144
145 define Device/ubnt_nanostation-ac
146 $(Device/ubnt-wa)
147 DEVICE_MODEL := Nanostation AC
148 DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct rssileds
149 endef
150 TARGET_DEVICES += ubnt_nanostation-ac
151
152 define Device/ubnt_nanostation-ac-loco
153 $(Device/ubnt-wa)
154 DEVICE_MODEL := Nanostation AC loco
155 DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
156 endef
157 TARGET_DEVICES += ubnt_nanostation-ac-loco
158
159 define Device/ubnt_nanostation-m
160 $(Device/ubnt-xm)
161 DEVICE_MODEL := Nanostation M
162 DEVICE_PACKAGES += rssileds
163 SUPPORTED_DEVICES += nanostation-m
164 endef
165 TARGET_DEVICES += ubnt_nanostation-m
166
167 define Device/ubnt_nanostation-m-xw
168 $(Device/ubnt-xw)
169 DEVICE_MODEL := Nanostation M
170 DEVICE_PACKAGES += rssileds
171 SUPPORTED_DEVICES += nanostation-m-xw
172 endef
173 TARGET_DEVICES += ubnt_nanostation-m-xw
174
175 define Device/ubnt_rocket-m
176 $(Device/ubnt-xm)
177 DEVICE_MODEL := Rocket-M
178 DEVICE_PACKAGES += rssileds
179 SUPPORTED_DEVICES += rocket-m
180 endef
181 TARGET_DEVICES += ubnt_rocket-m
182
183 define Device/ubnt_routerstation_common
184 DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig
185 DEVICE_VENDOR := Ubiquiti
186 ATH_SOC := ar7161
187 IMAGE_SIZE := 16128k
188 IMAGES := factory.bin
189 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE)
190 KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
191 KERNEL_INITRAMFS := kernel-bin | append-dtb
192 endef
193
194 define Device/ubnt_routerstation
195 $(Device/ubnt_routerstation_common)
196 DEVICE_MODEL := RouterStation
197 UBNT_BOARD := RS
198 UBNT_TYPE := RSx
199 UBNT_CHIP := ar7100
200 DEVICE_PACKAGES += -swconfig
201 SUPPORTED_DEVICES += routerstation
202 endef
203 TARGET_DEVICES += ubnt_routerstation
204
205 define Device/ubnt_routerstation-pro
206 $(Device/ubnt_routerstation_common)
207 DEVICE_MODEL := RouterStation Pro
208 UBNT_BOARD := RSPRO
209 UBNT_TYPE := RSPRO
210 UBNT_CHIP := ar7100pro
211 SUPPORTED_DEVICES += routerstation-pro
212 endef
213 TARGET_DEVICES += ubnt_routerstation-pro
214
215 define Device/ubnt_unifi
216 $(Device/ubnt-bz)
217 DEVICE_MODEL := UniFi
218 SUPPORTED_DEVICES += unifi
219 endef
220 TARGET_DEVICES += ubnt_unifi
221
222 define Device/ubnt_unifiac
223 DEVICE_VENDOR := Ubiquiti
224 ATH_SOC := qca9563
225 IMAGE_SIZE := 7744k
226 DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
227 endef
228
229 define Device/ubnt_unifiac-lite
230 $(Device/ubnt_unifiac)
231 DEVICE_MODEL := UniFi AC-Lite
232 SUPPORTED_DEVICES += unifiac-lite
233 endef
234 TARGET_DEVICES += ubnt_unifiac-lite
235
236 define Device/ubnt_unifiac-lr
237 $(Device/ubnt_unifiac)
238 DEVICE_MODEL := UniFi AC-LR
239 SUPPORTED_DEVICES += unifiac-lite ubnt,unifiac-lite
240 endef
241 TARGET_DEVICES += ubnt_unifiac-lr
242
243 define Device/ubnt_unifiac-mesh
244 $(Device/ubnt_unifiac)
245 DEVICE_MODEL := UniFi AC-Mesh
246 SUPPORTED_DEVICES += ubnt-unifiac-mesh
247 endef
248 TARGET_DEVICES += ubnt_unifiac-mesh
249
250 define Device/ubnt_unifiac-mesh-pro
251 $(Device/ubnt_unifiac)
252 DEVICE_MODEL := UniFi AC-Mesh Pro
253 SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro
254 endef
255 TARGET_DEVICES += ubnt_unifiac-mesh-pro
256
257 define Device/ubnt_unifiac-pro
258 $(Device/ubnt_unifiac)
259 DEVICE_MODEL := UniFi AC-Pro
260 DEVICE_PACKAGES += kmod-usb2
261 SUPPORTED_DEVICES += ubnt-unifiac-pro
262 endef
263 TARGET_DEVICES += ubnt_unifiac-pro