ipq806x: add support for Nokia Airscale AC400i
[openwrt/openwrt.git] / target / linux / ipq806x / image / generic.mk
1 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
2 DEVICE_VARS += TPLINK_BOARD_ID
3
4 define Device/kernel-size-migration
5 DEVICE_COMPAT_VERSION := 2.0
6 DEVICE_COMPAT_MESSAGE := *** Kernel partition size has changed from earlier \
7 versions. You need to sysupgrade with the OpenWrt factory image and \
8 use the force flag when image check fails. Settings will be lost. ***
9 endef
10
11 define Build/buffalo-rootfs-cksum
12 ( \
13 echo -ne "\x$$(od -A n -t u1 $@ | tr -s ' ' '\n' | \
14 $(STAGING_DIR_HOST)/bin/awk '{s+=$$0}END{printf "%x", 255-s%256}')"; \
15 ) >> $@
16 endef
17
18 define Build/edimax-header
19 $(eval edimax_model=$(word 1,$(1)))
20
21 $(STAGING_DIR_HOST)/bin/mkedimaximg \
22 -b -s CSYS -m $(edimax_model) \
23 -f 0x70000 -S 0x1200000 \
24 -i $@ -o $@.new
25 @mv $@.new $@
26 endef
27
28 define Device/DniImage
29 KERNEL_SUFFIX := -uImage
30 KERNEL = kernel-bin | append-dtb | uImage none
31 KERNEL_NAME := zImage
32 NETGEAR_BOARD_ID :=
33 NETGEAR_HW_ID :=
34 UBINIZE_OPTS := -E 5
35 IMAGES += factory.img
36 IMAGE/factory.img := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
37 append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | \
38 append-ubi | netgear-dni
39 IMAGE/sysupgrade.bin := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
40 append-uImage-fakehdr filesystem | sysupgrade-tar kernel=$$$$@ | \
41 append-metadata
42 endef
43
44 define Device/TpSafeImage
45 KERNEL_SUFFIX := -uImage
46 KERNEL = kernel-bin | append-dtb | uImage none
47 KERNEL_NAME := zImage
48 TPLINK_BOARD_ID :=
49 IMAGES += factory.bin
50 IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
51 IMAGE/sysupgrade.bin := append-rootfs | \
52 tplink-safeloader sysupgrade | append-metadata
53 endef
54
55 define Device/ZyXELImage
56 KERNEL_SUFFIX := -uImage
57 KERNEL = kernel-bin | append-dtb | uImage none | \
58 pad-to $$(KERNEL_SIZE)
59 KERNEL_NAME := zImage
60 IMAGES += factory.bin
61 IMAGE/factory.bin := append-rootfs | pad-rootfs | \
62 pad-to $$$$(BLOCKSIZE) | zyxel-ras-image separate-kernel
63 IMAGE/sysupgrade.bin/squashfs := append-rootfs | \
64 pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | \
65 append-metadata
66 endef
67
68 define Device/arris_tr4400-v2
69 $(call Device/LegacyImage)
70 DEVICE_VENDOR := Arris
71 DEVICE_MODEL := TR4400
72 DEVICE_VARIANT := v2
73 SOC := qcom-ipq8065
74 BLOCKSIZE := 128k
75 PAGESIZE := 2048
76 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ath10k-firmware-qca99x0-ct
77 KERNEL_IN_UBI := 1
78 endef
79 TARGET_DEVICES += arris_tr4400-v2
80
81 define Device/askey_rt4230w-rev6
82 $(call Device/LegacyImage)
83 DEVICE_VENDOR := Askey
84 DEVICE_MODEL := RT4230W
85 DEVICE_VARIANT := REV6
86 SOC := qcom-ipq8065
87 BLOCKSIZE := 128k
88 PAGESIZE := 2048
89 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
90 KERNEL_IN_UBI := 1
91 endef
92 TARGET_DEVICES += askey_rt4230w-rev6
93
94 define Device/asrock_g10
95 $(call Device/FitImage)
96 $(call Device/UbiFit)
97 SOC := qcom-ipq8064
98 DEVICE_VENDOR := ASRock
99 DEVICE_MODEL := G10
100 BLOCKSIZE := 128k
101 PAGESIZE := 2048
102 KERNEL_SIZE := 5332k
103 DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct
104 IMAGE/nand-factory.bin := append-ubi | edimax-header RN67
105 endef
106 TARGET_DEVICES += asrock_g10
107
108 define Device/buffalo_wxr-2533dhp
109 $(call Device/LegacyImage)
110 SOC := qcom-ipq8064
111 DEVICE_VENDOR := Buffalo
112 DEVICE_MODEL := WXR-2533DHP
113 BLOCKSIZE := 128k
114 PAGESIZE := 2048
115 IMAGE_SIZE := 65536k
116 KERNEL_IN_UBI := 1
117 IMAGE/sysupgrade.bin := append-rootfs | buffalo-rootfs-cksum | \
118 sysupgrade-tar rootfs=$$$$@ | append-metadata
119 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
120 endef
121 TARGET_DEVICES += buffalo_wxr-2533dhp
122
123 define Device/compex_wpq864
124 $(call Device/FitImage)
125 $(call Device/UbiFit)
126 DEVICE_VENDOR := Compex
127 DEVICE_MODEL := WPQ864
128 BLOCKSIZE := 128k
129 PAGESIZE := 2048
130 SOC := qcom-ipq8064
131 DEVICE_PACKAGES := kmod-gpio-beeper
132 endef
133 TARGET_DEVICES += compex_wpq864
134
135 define Device/edgecore_ecw5410
136 $(call Device/FitImage)
137 $(call Device/UbiFit)
138 DEVICE_VENDOR := Edgecore
139 DEVICE_MODEL := ECW5410
140 SOC := qcom-ipq8068
141 BLOCKSIZE := 128k
142 PAGESIZE := 2048
143 DEVICE_DTS_CONFIG := config@v2.0-ap160
144 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct \
145 ipq-wifi-edgecore_ecw5410
146 endef
147 TARGET_DEVICES += edgecore_ecw5410
148
149 define Device/linksys_ea7500-v1
150 $(call Device/LegacyImage)
151 $(Device/kernel-size-migration)
152 DEVICE_VENDOR := Linksys
153 DEVICE_MODEL := EA7500
154 DEVICE_VARIANT := v1
155 SOC := qcom-ipq8064
156 PAGESIZE := 2048
157 BLOCKSIZE := 128k
158 KERNEL_SIZE := 4096k
159 KERNEL = kernel-bin | append-dtb | uImage none | \
160 append-uImage-fakehdr filesystem
161 UBINIZE_OPTS := -E 5
162 IMAGES := factory.bin sysupgrade.bin
163 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
164 append-ubi | pad-to $$$$(PAGESIZE)
165 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
166 endef
167 TARGET_DEVICES += linksys_ea7500-v1
168
169 define Device/linksys_ea8500
170 $(call Device/LegacyImage)
171 $(Device/kernel-size-migration)
172 DEVICE_VENDOR := Linksys
173 DEVICE_MODEL := EA8500
174 SOC := qcom-ipq8064
175 PAGESIZE := 2048
176 BLOCKSIZE := 128k
177 KERNEL_SIZE := 4096k
178 KERNEL = kernel-bin | append-dtb | uImage none | \
179 append-uImage-fakehdr filesystem
180 BOARD_NAME := ea8500
181 SUPPORTED_DEVICES += ea8500
182 UBINIZE_OPTS := -E 5
183 IMAGES += factory.bin
184 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
185 append-ubi
186 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
187 endef
188 TARGET_DEVICES += linksys_ea8500
189
190 define Device/meraki_mr42
191 $(call Device/FitImage)
192 DEVICE_VENDOR := Cisco Meraki
193 DEVICE_MODEL := MR42
194 SOC := qcom-ipq8068
195 BLOCKSIZE := 128k
196 PAGESIZE := 2048
197 KERNEL_LOADADDR = 0x44208000
198 DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
199 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
200 -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
201 -uboot-envtools ath10k-firmware-qca9887-ct \
202 ath10k-firmware-qca99x0-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
203 kmod-leds-tlc591xx
204 endef
205 TARGET_DEVICES += meraki_mr42
206
207 define Device/meraki_mr52
208 $(call Device/FitImage)
209 DEVICE_VENDOR := Cisco Meraki
210 DEVICE_MODEL := MR52
211 SOC := qcom-ipq8068
212 BLOCKSIZE := 128k
213 PAGESIZE := 2048
214 KERNEL_LOADADDR = 0x44208000
215 DEVICE_DTS_CONFIG := config@2
216 DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
217 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
218 -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
219 -uboot-envtools ath10k-firmware-qca9887-ct \
220 ath10k-firmware-qca9984-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
221 kmod-leds-tlc591xx
222 endef
223 TARGET_DEVICES += meraki_mr52
224
225 define Device/nec_wg2600hp
226 $(call Device/LegacyImage)
227 DEVICE_VENDOR := NEC
228 DEVICE_MODEL := Aterm WG2600HP
229 SOC := qcom-ipq8064
230 BLOCKSIZE := 64k
231 BOARD_NAME := wg2600hp
232 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
233 pad-rootfs | append-metadata
234 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
235 endef
236 TARGET_DEVICES += nec_wg2600hp
237
238 define Device/nec_wg2600hp3
239 $(call Device/LegacyImage)
240 DEVICE_VENDOR := NEC Platforms
241 DEVICE_MODEL := Aterm WG2600HP3
242 SOC := qcom-ipq8062
243 BLOCKSIZE := 64k
244 IMAGES := sysupgrade.bin
245 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
246 pad-rootfs | append-metadata
247 DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform \
248 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
249 -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \
250 ath10k-firmware-qca9984-ct
251 endef
252 TARGET_DEVICES += nec_wg2600hp3
253
254 define Device/netgear_d7800
255 $(call Device/DniImage)
256 DEVICE_VENDOR := NETGEAR
257 DEVICE_MODEL := Nighthawk X4 D7800
258 SOC := qcom-ipq8064
259 KERNEL_SIZE := 4096k
260 NETGEAR_BOARD_ID := D7800
261 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
262 BLOCKSIZE := 128k
263 PAGESIZE := 2048
264 BOARD_NAME := d7800
265 SUPPORTED_DEVICES += d7800
266 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
267 DEVICE_COMPAT_VERSION := 2.0
268 DEVICE_COMPAT_MESSAGE := Sysupgrade does not work due to rootfs ubi partition size change. \
269 Use factory image with the TFTP recovery flash routine.
270 endef
271 TARGET_DEVICES += netgear_d7800
272
273 define Device/netgear_r7500
274 $(call Device/DniImage)
275 DEVICE_VENDOR := NETGEAR
276 DEVICE_MODEL := Nighthawk X4 R7500
277 DEVICE_VARIANT := v1
278 SOC := qcom-ipq8064
279 KERNEL_SIZE := 4096k
280 NETGEAR_BOARD_ID := R7500
281 NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
282 BLOCKSIZE := 128k
283 PAGESIZE := 2048
284 BOARD_NAME := r7500
285 SUPPORTED_DEVICES += r7500
286 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
287 endef
288 TARGET_DEVICES += netgear_r7500
289
290 define Device/netgear_r7500v2
291 $(call Device/DniImage)
292 DEVICE_VENDOR := NETGEAR
293 DEVICE_MODEL := Nighthawk X4 R7500
294 DEVICE_VARIANT := v2
295 SOC := qcom-ipq8064
296 KERNEL_SIZE := 4096k
297 NETGEAR_BOARD_ID := R7500v2
298 NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
299 BLOCKSIZE := 128k
300 PAGESIZE := 2048
301 BOARD_NAME := r7500v2
302 SUPPORTED_DEVICES += r7500v2
303 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct \
304 ath10k-firmware-qca988x-ct
305 endef
306 TARGET_DEVICES += netgear_r7500v2
307
308 define Device/netgear_r7800
309 $(call Device/DniImage)
310 DEVICE_VENDOR := NETGEAR
311 DEVICE_MODEL := Nighthawk X4S R7800
312 SOC := qcom-ipq8065
313 KERNEL_SIZE := 4096k
314 NETGEAR_BOARD_ID := R7800
315 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
316 BLOCKSIZE := 128k
317 PAGESIZE := 2048
318 BOARD_NAME := r7800
319 SUPPORTED_DEVICES += r7800
320 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
321 endef
322 TARGET_DEVICES += netgear_r7800
323
324 define Device/netgear_xr500
325 $(call Device/DniImage)
326 DEVICE_VENDOR := NETGEAR
327 DEVICE_MODEL := Nighthawk XR500
328 SOC := qcom-ipq8065
329 KERNEL_SIZE := 4096k
330 NETGEAR_BOARD_ID := XR500
331 NETGEAR_HW_ID := 29764958+0+256+512+4x4+4x4+cascade
332 BLOCKSIZE := 128k
333 PAGESIZE := 2048
334 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
335 endef
336 TARGET_DEVICES += netgear_xr500
337
338 define Device/nokia_ac400i
339 $(call Device/FitImage)
340 $(call Device/UbiFit)
341 DEVICE_VENDOR := Nokia
342 DEVICE_MODEL := AC400i
343 SOC := qcom-ipq8065
344 DEVICE_DTS := qcom-ipq8065-ac400i
345 BLOCKSIZE := 128k
346 PAGESIZE := 2048
347 BOARD_NAME := ac400i
348 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-nokia-ac400i
349 endef
350 TARGET_DEVICES += nokia_ac400i
351
352 define Device/qcom_ipq8064-ap148
353 $(call Device/FitImage)
354 $(call Device/UbiFit)
355 DEVICE_VENDOR := Qualcomm
356 DEVICE_MODEL := AP148
357 DEVICE_VARIANT := standard
358 SOC := qcom-ipq8064
359 DEVICE_DTS := qcom-ipq8064-ap148
360 KERNEL_INSTALL := 1
361 BLOCKSIZE := 128k
362 PAGESIZE := 2048
363 BOARD_NAME := ap148
364 SUPPORTED_DEVICES += ap148
365 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
366 endef
367 TARGET_DEVICES += qcom_ipq8064-ap148
368
369 define Device/qcom_ipq8064-ap148-legacy
370 $(call Device/LegacyImage)
371 $(call Device/UbiFit)
372 DEVICE_VENDOR := Qualcomm
373 DEVICE_MODEL := AP148
374 DEVICE_VARIANT := legacy
375 SOC := qcom-ipq8064
376 DEVICE_DTS := qcom-ipq8064-ap148
377 BLOCKSIZE := 128k
378 PAGESIZE := 2048
379 BOARD_NAME := ap148
380 SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
381 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
382 endef
383 TARGET_DEVICES += qcom_ipq8064-ap148-legacy
384
385 define Device/qcom_ipq8064-ap161
386 $(call Device/FitImage)
387 $(call Device/UbiFit)
388 DEVICE_VENDOR := Qualcomm
389 DEVICE_MODEL := AP161
390 SOC := qcom-ipq8064
391 DEVICE_DTS := qcom-ipq8064-ap161
392 KERNEL_INSTALL := 1
393 BLOCKSIZE := 128k
394 PAGESIZE := 2048
395 BOARD_NAME := ap161
396 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
397 endef
398 TARGET_DEVICES += qcom_ipq8064-ap161
399
400 define Device/qcom_ipq8064-db149
401 $(call Device/FitImage)
402 DEVICE_VENDOR := Qualcomm
403 DEVICE_MODEL := DB149
404 SOC := qcom-ipq8064
405 DEVICE_DTS := qcom-ipq8064-db149
406 KERNEL_INSTALL := 1
407 BOARD_NAME := db149
408 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
409 endef
410 TARGET_DEVICES += qcom_ipq8064-db149
411
412 define Device/tplink_ad7200
413 $(call Device/TpSafeImage)
414 DEVICE_VENDOR := TP-Link
415 DEVICE_MODEL := AD7200
416 DEVICE_VARIANT := v1/v2
417 DEVICE_ALT0_VENDOR := TP-Link
418 DEVICE_ALT0_MODEL := Talon AD7200
419 DEVICE_ALT0_VARIANT := v1/v2
420 SOC := qcom-ipq8064
421 BLOCKSIZE := 128k
422 PAGESIZE := 2048
423 TPLINK_BOARD_ID := AD7200
424 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-ramoops kmod-wil6210
425 endef
426 TARGET_DEVICES += tplink_ad7200
427
428 define Device/tplink_c2600
429 $(call Device/TpSafeImage)
430 DEVICE_VENDOR := TP-Link
431 DEVICE_MODEL := Archer C2600
432 DEVICE_VARIANT := v1
433 SOC := qcom-ipq8064
434 BLOCKSIZE := 128k
435 PAGESIZE := 2048
436 BOARD_NAME := c2600
437 SUPPORTED_DEVICES += c2600
438 TPLINK_BOARD_ID := C2600
439 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-ramoops
440 endef
441 TARGET_DEVICES += tplink_c2600
442
443 define Device/tplink_vr2600v
444 DEVICE_VENDOR := TP-Link
445 DEVICE_MODEL := Archer VR2600v
446 DEVICE_VARIANT := v1
447 KERNEL_SUFFIX := -uImage
448 KERNEL = kernel-bin | append-dtb | uImage none
449 KERNEL_NAME := zImage
450 IMAGE_SIZE := 12672k
451 SOC := qcom-ipq8064
452 BLOCKSIZE := 128k
453 PAGESIZE := 2048
454 BOARD_NAME := vr2600v
455 SUPPORTED_DEVICES += vr2600v
456 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
457 IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | \
458 append-rootfs | pad-rootfs | append-metadata
459 endef
460 TARGET_DEVICES += tplink_vr2600v
461
462 define Device/ubnt_unifi-ac-hd
463 $(call Device/FitImageLzma)
464 DEVICE_VENDOR := Ubiquiti
465 DEVICE_MODEL := UniFi AC HD
466 SOC := qcom-ipq8064
467 BLOCKSIZE := 64k
468 IMAGE_SIZE := 14784k
469 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
470 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
471 append-rootfs | pad-rootfs | check-size | append-metadata
472 endef
473 TARGET_DEVICES += ubnt_unifi-ac-hd
474
475 define Device/zyxel_nbg6817
476 DEVICE_VENDOR := ZyXEL
477 DEVICE_MODEL := NBG6817
478 SOC := qcom-ipq8065
479 KERNEL_SIZE := 4096k
480 BLOCKSIZE := 64k
481 BOARD_NAME := nbg6817
482 RAS_BOARD := NBG6817
483 RAS_ROOTFS_SIZE := 20934k
484 RAS_VERSION := "V1.99(OWRT.9999)C0"
485 SUPPORTED_DEVICES += nbg6817
486 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs \
487 kmod-fs-ext4 losetup
488 $(call Device/ZyXELImage)
489 endef
490 TARGET_DEVICES += zyxel_nbg6817