treewide: remove kmod-usb-core from DEVICE_PACKAGES
[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 \
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   IMAGE_SIZE := 7552k
40   UBNT_BOARD := XM
41   UBNT_VERSION := 6.0.0
42   IMAGES += factory.bin
43   IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
44         append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
45 endef
46
47 define Device/ubnt-bz
48   $(Device/ubnt)
49   UBNT_TYPE := BZ
50   UBNT_CHIP := ar7240
51   ATH_SOC := ar7241
52 endef
53
54 define Device/ubnt-wa
55   $(Device/ubnt)
56   UBNT_TYPE := WA
57   UBNT_CHIP := ar934x
58   UBNT_BOARD := WA
59   UBNT_VERSION := 8.5.0
60   ATH_SOC := ar9342
61 endef
62
63 define Device/ubnt-xm
64   $(Device/ubnt)
65   DEVICE_VARIANT := XM
66   DEVICE_PACKAGES += kmod-usb-ohci rssileds
67   UBNT_TYPE := XM
68   UBNT_CHIP := ar7240
69   ATH_SOC := ar7241
70   KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
71 endef
72
73 define Device/ubnt-xw
74   $(Device/ubnt)
75   DEVICE_VARIANT := XW
76   UBNT_TYPE := XW
77   UBNT_CHIP := ar934x
78   UBNT_BOARD := XM
79   UBNT_VERSION := 6.0.4
80   UBNT_REVISION := 42.$(UBNT_REVISION)
81   ATH_SOC := ar9342
82 endef
83
84 define Device/ubnt_acb-isp
85   $(Device/ubnt)
86   ATH_SOC := qca9533
87   IMAGE_SIZE := 15744k
88   DEVICE_MODEL := airCube ISP
89   UBNT_BOARD := ACB-ISP
90   UBNT_TYPE := ACB
91   UBNT_CHIP := qca9533
92   IMAGES := sysupgrade.bin
93 endef
94 TARGET_DEVICES += ubnt_acb-isp
95
96 define Device/ubnt_airrouter
97   $(Device/ubnt-xm)
98   DEVICE_MODEL := AirRouter
99   SUPPORTED_DEVICES += airrouter
100 endef
101 TARGET_DEVICES += ubnt_airrouter
102
103 define Device/ubnt_bullet-m
104   $(Device/ubnt-xm)
105   DEVICE_MODEL := Bullet-M
106   SUPPORTED_DEVICES += bullet-m
107 endef
108 TARGET_DEVICES += ubnt_bullet-m
109
110 define Device/ubnt_bullet-m-xw
111   $(Device/ubnt-xw)
112   DEVICE_MODEL := Bullet-M
113   SUPPORTED_DEVICES += bullet-m-xw
114 endef
115 TARGET_DEVICES += ubnt_bullet-m-xw
116
117 define Device/ubnt_lap-120
118   $(Device/ubnt-wa)
119   DEVICE_MODEL := LiteAP ac
120   DEVICE_VARIANT := LAP-120
121   DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
122   IMAGE_SIZE := 15744k
123   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
124 endef
125 TARGET_DEVICES += ubnt_lap-120
126
127 define Device/ubnt_nanobeam-ac
128   $(Device/ubnt-wa)
129   DEVICE_MODEL := NanoBeam AC
130   DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
131   IMAGE_SIZE := 15744k
132   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
133 endef
134 TARGET_DEVICES += ubnt_nanobeam-ac
135
136 define Device/ubnt_nanostation-ac
137   $(Device/ubnt-wa)
138   DEVICE_MODEL := Nanostation AC
139   DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
140   IMAGE_SIZE := 15744k
141   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
142 endef
143 TARGET_DEVICES += ubnt_nanostation-ac
144
145 define Device/ubnt_nanostation-ac-loco
146   $(Device/ubnt-wa)
147   DEVICE_MODEL := Nanostation AC loco
148   DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct
149   IMAGE_SIZE := 15744k
150   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
151 endef
152 TARGET_DEVICES += ubnt_nanostation-ac-loco
153
154 define Device/ubnt_nanostation-m
155   $(Device/ubnt-xm)
156   DEVICE_MODEL := Nanostation M
157   SUPPORTED_DEVICES += nano-m
158 endef
159 TARGET_DEVICES += ubnt_nanostation-m
160
161 define Device/ubnt_nanostation-m-xw
162   $(Device/ubnt-xw)
163   DEVICE_MODEL := Nanostation M
164   SUPPORTED_DEVICES += nanostation-m-xw
165 endef
166 TARGET_DEVICES += ubnt_nanostation-m-xw
167
168 define Device/ubnt_rocket-m
169   $(Device/ubnt-xm)
170   DEVICE_MODEL := Rocket-M
171   SUPPORTED_DEVICES += rocket-m
172 endef
173 TARGET_DEVICES += ubnt_rocket-m
174
175 define Device/ubnt_routerstation_common
176   DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig
177   DEVICE_VENDOR := Ubiquiti
178   ATH_SOC := ar7161
179   IMAGE_SIZE := 16128k
180   IMAGES := factory.bin
181   IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE)
182   KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
183   KERNEL_INITRAMFS := kernel-bin | append-dtb
184 endef
185
186 define Device/ubnt_routerstation
187   $(Device/ubnt_routerstation_common)
188   DEVICE_MODEL := RouterStation
189   UBNT_BOARD := RS
190   UBNT_TYPE := RSx
191   UBNT_CHIP := ar7100
192   DEVICE_PACKAGES += -swconfig
193   SUPPORTED_DEVICES += routerstation
194 endef
195 TARGET_DEVICES += ubnt_routerstation
196
197 define Device/ubnt_routerstation-pro
198   $(Device/ubnt_routerstation_common)
199   DEVICE_MODEL := RouterStation Pro
200   UBNT_BOARD := RSPRO
201   UBNT_TYPE := RSPRO
202   UBNT_CHIP := ar7100pro
203   SUPPORTED_DEVICES += routerstation-pro
204 endef
205 TARGET_DEVICES += ubnt_routerstation-pro
206
207 define Device/ubnt_unifi
208   $(Device/ubnt-bz)
209   DEVICE_MODEL := UniFi
210   SUPPORTED_DEVICES += unifi
211 endef
212 TARGET_DEVICES += ubnt_unifi
213
214 define Device/ubnt_unifiac
215   DEVICE_VENDOR := Ubiquiti
216   ATH_SOC := qca9563
217   IMAGE_SIZE := 7744k
218   DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
219 endef
220
221 define Device/ubnt_unifiac-lite
222   $(Device/ubnt_unifiac)
223   DEVICE_MODEL := UniFi AC-Lite
224   SUPPORTED_DEVICES += ubnt-unifiac-lite
225 endef
226 TARGET_DEVICES += ubnt_unifiac-lite
227
228 define Device/ubnt_unifiac-mesh
229   $(Device/ubnt_unifiac)
230   DEVICE_MODEL := UniFi AC-Mesh
231   SUPPORTED_DEVICES += ubnt-unifiac-mesh
232 endef
233 TARGET_DEVICES += ubnt_unifiac-mesh
234
235 define Device/ubnt_unifiac-mesh-pro
236   $(Device/ubnt_unifiac)
237   DEVICE_MODEL := UniFi AC-Mesh Pro
238   SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro
239 endef
240 TARGET_DEVICES += ubnt_unifiac-mesh-pro
241
242 define Device/ubnt_unifiac-pro
243   $(Device/ubnt_unifiac)
244   DEVICE_MODEL := UniFi AC-Pro
245   DEVICE_PACKAGES += kmod-usb2
246   SUPPORTED_DEVICES += ubnt-unifiac-pro
247 endef
248 TARGET_DEVICES += ubnt_unifiac-pro