44e0df1b3f91abd7b6d181af07956b8974e62c4c
[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 DEFAULT := n
167 endef
168 TARGET_DEVICES += linksys_ea7500-v1
169
170 define Device/linksys_ea8500
171 $(call Device/LegacyImage)
172 $(Device/kernel-size-migration)
173 DEVICE_VENDOR := Linksys
174 DEVICE_MODEL := EA8500
175 SOC := qcom-ipq8064
176 PAGESIZE := 2048
177 BLOCKSIZE := 128k
178 KERNEL_SIZE := 4096k
179 KERNEL = kernel-bin | append-dtb | uImage none | \
180 append-uImage-fakehdr filesystem
181 BOARD_NAME := ea8500
182 SUPPORTED_DEVICES += ea8500
183 UBINIZE_OPTS := -E 5
184 IMAGES += factory.bin
185 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
186 append-ubi
187 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
188 endef
189 TARGET_DEVICES += linksys_ea8500
190
191 define Device/meraki_mr42
192 $(call Device/FitImage)
193 DEVICE_VENDOR := Cisco Meraki
194 DEVICE_MODEL := MR42
195 SOC := qcom-ipq8068
196 BLOCKSIZE := 128k
197 PAGESIZE := 2048
198 KERNEL_LOADADDR = 0x44208000
199 DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
200 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
201 -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
202 -uboot-envtools ath10k-firmware-qca9887-ct \
203 ath10k-firmware-qca99x0-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
204 kmod-leds-tlc591xx
205 endef
206 TARGET_DEVICES += meraki_mr42
207
208 define Device/meraki_mr52
209 $(call Device/FitImage)
210 DEVICE_VENDOR := Cisco Meraki
211 DEVICE_MODEL := MR52
212 SOC := qcom-ipq8068
213 BLOCKSIZE := 128k
214 PAGESIZE := 2048
215 KERNEL_LOADADDR = 0x44208000
216 DEVICE_DTS_CONFIG := config@2
217 DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
218 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
219 -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
220 -uboot-envtools ath10k-firmware-qca9887-ct \
221 ath10k-firmware-qca9984-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
222 kmod-leds-tlc591xx
223 endef
224 TARGET_DEVICES += meraki_mr52
225
226 define Device/nec_wg2600hp
227 $(call Device/LegacyImage)
228 DEVICE_VENDOR := NEC
229 DEVICE_MODEL := Aterm WG2600HP
230 SOC := qcom-ipq8064
231 BLOCKSIZE := 64k
232 BOARD_NAME := wg2600hp
233 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
234 pad-rootfs | append-metadata
235 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
236 endef
237 TARGET_DEVICES += nec_wg2600hp
238
239 define Device/nec_wg2600hp3
240 $(call Device/LegacyImage)
241 DEVICE_VENDOR := NEC Platforms
242 DEVICE_MODEL := Aterm WG2600HP3
243 SOC := qcom-ipq8062
244 BLOCKSIZE := 64k
245 IMAGES := sysupgrade.bin
246 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
247 pad-rootfs | append-metadata
248 DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform \
249 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
250 -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \
251 ath10k-firmware-qca9984-ct
252 endef
253 TARGET_DEVICES += nec_wg2600hp3
254
255 define Device/netgear_d7800
256 $(call Device/DniImage)
257 DEVICE_VENDOR := NETGEAR
258 DEVICE_MODEL := Nighthawk X4 D7800
259 SOC := qcom-ipq8064
260 KERNEL_SIZE := 4096k
261 NETGEAR_BOARD_ID := D7800
262 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
263 BLOCKSIZE := 128k
264 PAGESIZE := 2048
265 BOARD_NAME := d7800
266 SUPPORTED_DEVICES += d7800
267 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
268 DEVICE_COMPAT_VERSION := 2.0
269 DEVICE_COMPAT_MESSAGE := Sysupgrade does not work due to rootfs ubi partition size change. \
270 Use factory image with the TFTP recovery flash routine.
271 endef
272 TARGET_DEVICES += netgear_d7800
273
274 define Device/netgear_r7500
275 $(call Device/DniImage)
276 DEVICE_VENDOR := NETGEAR
277 DEVICE_MODEL := Nighthawk X4 R7500
278 DEVICE_VARIANT := v1
279 SOC := qcom-ipq8064
280 KERNEL_SIZE := 4096k
281 NETGEAR_BOARD_ID := R7500
282 NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
283 BLOCKSIZE := 128k
284 PAGESIZE := 2048
285 BOARD_NAME := r7500
286 SUPPORTED_DEVICES += r7500
287 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
288 endef
289 TARGET_DEVICES += netgear_r7500
290
291 define Device/netgear_r7500v2
292 $(call Device/DniImage)
293 DEVICE_VENDOR := NETGEAR
294 DEVICE_MODEL := Nighthawk X4 R7500
295 DEVICE_VARIANT := v2
296 SOC := qcom-ipq8064
297 KERNEL_SIZE := 4096k
298 NETGEAR_BOARD_ID := R7500v2
299 NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
300 BLOCKSIZE := 128k
301 PAGESIZE := 2048
302 BOARD_NAME := r7500v2
303 SUPPORTED_DEVICES += r7500v2
304 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct \
305 ath10k-firmware-qca988x-ct
306 endef
307 TARGET_DEVICES += netgear_r7500v2
308
309 define Device/netgear_r7800
310 $(call Device/DniImage)
311 DEVICE_VENDOR := NETGEAR
312 DEVICE_MODEL := Nighthawk X4S R7800
313 SOC := qcom-ipq8065
314 KERNEL_SIZE := 4096k
315 NETGEAR_BOARD_ID := R7800
316 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
317 BLOCKSIZE := 128k
318 PAGESIZE := 2048
319 BOARD_NAME := r7800
320 SUPPORTED_DEVICES += r7800
321 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
322 endef
323 TARGET_DEVICES += netgear_r7800
324
325 define Device/netgear_xr500
326 $(call Device/DniImage)
327 DEVICE_VENDOR := NETGEAR
328 DEVICE_MODEL := Nighthawk XR500
329 SOC := qcom-ipq8065
330 KERNEL_SIZE := 4096k
331 NETGEAR_BOARD_ID := XR500
332 NETGEAR_HW_ID := 29764958+0+256+512+4x4+4x4+cascade
333 BLOCKSIZE := 128k
334 PAGESIZE := 2048
335 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
336 endef
337 TARGET_DEVICES += netgear_xr500
338
339 define Device/qcom_ipq8064-ap148
340 $(call Device/FitImage)
341 $(call Device/UbiFit)
342 DEVICE_VENDOR := Qualcomm
343 DEVICE_MODEL := AP148
344 DEVICE_VARIANT := standard
345 SOC := qcom-ipq8064
346 DEVICE_DTS := qcom-ipq8064-ap148
347 KERNEL_INSTALL := 1
348 BLOCKSIZE := 128k
349 PAGESIZE := 2048
350 BOARD_NAME := ap148
351 SUPPORTED_DEVICES += ap148
352 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
353 endef
354 TARGET_DEVICES += qcom_ipq8064-ap148
355
356 define Device/qcom_ipq8064-ap148-legacy
357 $(call Device/LegacyImage)
358 $(call Device/UbiFit)
359 DEVICE_VENDOR := Qualcomm
360 DEVICE_MODEL := AP148
361 DEVICE_VARIANT := legacy
362 SOC := qcom-ipq8064
363 DEVICE_DTS := qcom-ipq8064-ap148
364 BLOCKSIZE := 128k
365 PAGESIZE := 2048
366 BOARD_NAME := ap148
367 SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
368 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
369 endef
370 TARGET_DEVICES += qcom_ipq8064-ap148-legacy
371
372 define Device/qcom_ipq8064-ap161
373 $(call Device/FitImage)
374 $(call Device/UbiFit)
375 DEVICE_VENDOR := Qualcomm
376 DEVICE_MODEL := AP161
377 SOC := qcom-ipq8064
378 DEVICE_DTS := qcom-ipq8064-ap161
379 KERNEL_INSTALL := 1
380 BLOCKSIZE := 128k
381 PAGESIZE := 2048
382 BOARD_NAME := ap161
383 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
384 endef
385 TARGET_DEVICES += qcom_ipq8064-ap161
386
387 define Device/qcom_ipq8064-db149
388 $(call Device/FitImage)
389 DEVICE_VENDOR := Qualcomm
390 DEVICE_MODEL := DB149
391 SOC := qcom-ipq8064
392 DEVICE_DTS := qcom-ipq8064-db149
393 KERNEL_INSTALL := 1
394 BOARD_NAME := db149
395 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
396 endef
397 TARGET_DEVICES += qcom_ipq8064-db149
398
399 define Device/tplink_ad7200
400 $(call Device/TpSafeImage)
401 DEVICE_VENDOR := TP-Link
402 DEVICE_MODEL := AD7200
403 DEVICE_VARIANT := v1/v2
404 DEVICE_ALT0_VENDOR := TP-Link
405 DEVICE_ALT0_MODEL := Talon AD7200
406 DEVICE_ALT0_VARIANT := v1/v2
407 SOC := qcom-ipq8064
408 BLOCKSIZE := 128k
409 PAGESIZE := 2048
410 TPLINK_BOARD_ID := AD7200
411 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-ramoops kmod-wil6210
412 endef
413 TARGET_DEVICES += tplink_ad7200
414
415 define Device/tplink_c2600
416 $(call Device/TpSafeImage)
417 DEVICE_VENDOR := TP-Link
418 DEVICE_MODEL := Archer C2600
419 DEVICE_VARIANT := v1
420 SOC := qcom-ipq8064
421 BLOCKSIZE := 128k
422 PAGESIZE := 2048
423 BOARD_NAME := c2600
424 SUPPORTED_DEVICES += c2600
425 TPLINK_BOARD_ID := C2600
426 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-ramoops
427 endef
428 TARGET_DEVICES += tplink_c2600
429
430 define Device/tplink_vr2600v
431 DEVICE_VENDOR := TP-Link
432 DEVICE_MODEL := Archer VR2600v
433 DEVICE_VARIANT := v1
434 KERNEL_SUFFIX := -uImage
435 KERNEL = kernel-bin | append-dtb | uImage none
436 KERNEL_NAME := zImage
437 IMAGE_SIZE := 12672k
438 SOC := qcom-ipq8064
439 BLOCKSIZE := 128k
440 PAGESIZE := 2048
441 BOARD_NAME := vr2600v
442 SUPPORTED_DEVICES += vr2600v
443 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
444 IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | \
445 append-rootfs | pad-rootfs | append-metadata
446 endef
447 TARGET_DEVICES += tplink_vr2600v
448
449 define Device/ubnt_unifi-ac-hd
450 $(call Device/FitImageLzma)
451 DEVICE_VENDOR := Ubiquiti
452 DEVICE_MODEL := UniFi AC HD
453 SOC := qcom-ipq8064
454 BLOCKSIZE := 64k
455 IMAGE_SIZE := 14784k
456 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
457 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
458 append-rootfs | pad-rootfs | check-size | append-metadata
459 endef
460 TARGET_DEVICES += ubnt_unifi-ac-hd
461
462 define Device/zyxel_nbg6817
463 DEVICE_VENDOR := ZyXEL
464 DEVICE_MODEL := NBG6817
465 SOC := qcom-ipq8065
466 KERNEL_SIZE := 4096k
467 BLOCKSIZE := 64k
468 BOARD_NAME := nbg6817
469 RAS_BOARD := NBG6817
470 RAS_ROOTFS_SIZE := 20934k
471 RAS_VERSION := "V1.99(OWRT.9999)C0"
472 SUPPORTED_DEVICES += nbg6817
473 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs \
474 kmod-fs-ext4 losetup
475 $(call Device/ZyXELImage)
476 endef
477 TARGET_DEVICES += zyxel_nbg6817