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