ath79: generate firmware image for aircube-isp
[openwrt/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-wa
51 $(Device/ubnt)
52 SOC := ar9342
53 IMAGE_SIZE := 15744k
54 UBNT_BOARD := WA
55 UBNT_CHIP := ar934x
56 UBNT_TYPE := WA
57 UBNT_VERSION := 8.5.0
58 endef
59
60 define Device/ubnt-xm
61 $(Device/ubnt)
62 SOC := ar7241
63 DEVICE_VARIANT := XM
64 DEVICE_PACKAGES += kmod-usb-ohci
65 IMAGE_SIZE := 7448k
66 UBNT_BOARD := XM
67 UBNT_CHIP := ar7240
68 UBNT_TYPE := XM
69 UBNT_VERSION := 6.0.0
70 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
71 endef
72
73 define Device/ubnt-xw
74 $(Device/ubnt)
75 SOC := ar9342
76 DEVICE_VARIANT := XW
77 IMAGE_SIZE := 7552k
78 UBNT_BOARD := XM
79 UBNT_CHIP := ar934x
80 UBNT_REVISION := 42.$(UBNT_REVISION)
81 UBNT_TYPE := XW
82 UBNT_VERSION := 6.0.4
83 endef
84
85 define Device/ubnt_acb-isp
86 $(Device/ubnt)
87 SOC := qca9533
88 DEVICE_MODEL := airCube ISP
89 IMAGE_SIZE := 15744k
90 UBNT_BOARD := ACB-ISP
91 UBNT_CHIP := qca9533
92 UBNT_TYPE := ACB
93 UBNT_VERSION := 2.5.0
94 endef
95 TARGET_DEVICES += ubnt_acb-isp
96
97 define Device/ubnt_airrouter
98 $(Device/ubnt-xm)
99 DEVICE_MODEL := AirRouter
100 SUPPORTED_DEVICES += airrouter
101 endef
102 TARGET_DEVICES += ubnt_airrouter
103
104 define Device/ubnt_bullet-m
105 $(Device/ubnt-xm)
106 DEVICE_MODEL := Bullet-M
107 DEVICE_PACKAGES += rssileds
108 SUPPORTED_DEVICES += bullet-m
109 endef
110 TARGET_DEVICES += ubnt_bullet-m
111
112 define Device/ubnt_bullet-m-xw
113 $(Device/ubnt-xw)
114 DEVICE_MODEL := Bullet-M
115 DEVICE_PACKAGES += rssileds
116 SUPPORTED_DEVICES += bullet-m-xw
117 endef
118 TARGET_DEVICES += ubnt_bullet-m-xw
119
120 define Device/ubnt_lap-120
121 $(Device/ubnt-wa)
122 DEVICE_MODEL := LiteAP ac
123 DEVICE_VARIANT := LAP-120
124 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
125 endef
126 TARGET_DEVICES += ubnt_lap-120
127
128 define Device/ubnt_litebeam-ac-gen2
129 $(Device/ubnt-wa)
130 DEVICE_MODEL := LiteBeam AC
131 DEVICE_VARIANT := Gen2
132 DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
133 endef
134 TARGET_DEVICES += ubnt_litebeam-ac-gen2
135
136 define Device/ubnt_nanobeam-ac
137 $(Device/ubnt-wa)
138 DEVICE_MODEL := NanoBeam AC
139 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
140 endef
141 TARGET_DEVICES += ubnt_nanobeam-ac
142
143 define Device/ubnt_nanostation-ac
144 $(Device/ubnt-wa)
145 DEVICE_MODEL := Nanostation AC
146 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct rssileds
147 endef
148 TARGET_DEVICES += ubnt_nanostation-ac
149
150 define Device/ubnt_nanostation-ac-loco
151 $(Device/ubnt-wa)
152 DEVICE_MODEL := Nanostation AC loco
153 DEVICE_PACKAGES += kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct
154 endef
155 TARGET_DEVICES += ubnt_nanostation-ac-loco
156
157 define Device/ubnt_nanostation-m
158 $(Device/ubnt-xm)
159 DEVICE_MODEL := Nanostation M
160 DEVICE_PACKAGES += rssileds
161 SUPPORTED_DEVICES += nanostation-m
162 endef
163 TARGET_DEVICES += ubnt_nanostation-m
164
165 define Device/ubnt_nanostation-m-xw
166 $(Device/ubnt-xw)
167 DEVICE_MODEL := Nanostation M
168 DEVICE_PACKAGES += rssileds
169 SUPPORTED_DEVICES += nanostation-m-xw
170 endef
171 TARGET_DEVICES += ubnt_nanostation-m-xw
172
173 define Device/ubnt_rocket-m
174 $(Device/ubnt-xm)
175 DEVICE_MODEL := Rocket-M
176 DEVICE_PACKAGES += rssileds
177 SUPPORTED_DEVICES += rocket-m
178 endef
179 TARGET_DEVICES += ubnt_rocket-m
180
181 define Device/ubnt_routerstation_common
182 DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci \
183 kmod-usb2 fconfig
184 DEVICE_VENDOR := Ubiquiti
185 SOC := ar7161
186 IMAGE_SIZE := 16128k
187 IMAGES := factory.bin
188 IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
189 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 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