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