ipq806x: provide ramoops for R7800/XR500 by default
[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/askey_rt4230w-rev6
69 $(call Device/LegacyImage)
70 DEVICE_VENDOR := Askey
71 DEVICE_MODEL := RT4230W
72 DEVICE_VARIANT := REV6
73 SOC := qcom-ipq8065
74 BLOCKSIZE := 128k
75 PAGESIZE := 2048
76 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
77 KERNEL_IN_UBI := 1
78 endef
79 TARGET_DEVICES += askey_rt4230w-rev6
80
81 define Device/asrock_g10
82 $(call Device/FitImage)
83 $(call Device/UbiFit)
84 SOC := qcom-ipq8064
85 DEVICE_VENDOR := ASRock
86 DEVICE_MODEL := G10
87 BLOCKSIZE := 128k
88 PAGESIZE := 2048
89 KERNEL_SIZE := 5332k
90 DEVICE_PACKAGES := kmod-i2c-gpio ath10k-firmware-qca99x0-ct
91 IMAGE/nand-factory.bin := append-ubi | edimax-header RN67
92 endef
93 TARGET_DEVICES += asrock_g10
94
95 define Device/buffalo_wxr-2533dhp
96 $(call Device/LegacyImage)
97 SOC := qcom-ipq8064
98 DEVICE_VENDOR := Buffalo
99 DEVICE_MODEL := WXR-2533DHP
100 BLOCKSIZE := 128k
101 PAGESIZE := 2048
102 IMAGE_SIZE := 65536k
103 KERNEL_IN_UBI := 1
104 IMAGE/sysupgrade.bin := append-rootfs | buffalo-rootfs-cksum | \
105 sysupgrade-tar rootfs=$$$$@ | append-metadata
106 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
107 endef
108 TARGET_DEVICES += buffalo_wxr-2533dhp
109
110 define Device/compex_wpq864
111 $(call Device/FitImage)
112 $(call Device/UbiFit)
113 DEVICE_VENDOR := Compex
114 DEVICE_MODEL := WPQ864
115 BLOCKSIZE := 128k
116 PAGESIZE := 2048
117 SOC := qcom-ipq8064
118 DEVICE_PACKAGES := kmod-gpio-beeper
119 endef
120 TARGET_DEVICES += compex_wpq864
121
122 define Device/edgecore_ecw5410
123 $(call Device/FitImage)
124 $(call Device/UbiFit)
125 DEVICE_VENDOR := Edgecore
126 DEVICE_MODEL := ECW5410
127 SOC := qcom-ipq8068
128 BLOCKSIZE := 128k
129 PAGESIZE := 2048
130 DEVICE_DTS_CONFIG := config@v2.0-ap160
131 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct \
132 ipq-wifi-edgecore_ecw5410
133 endef
134 TARGET_DEVICES += edgecore_ecw5410
135
136 define Device/linksys_ea7500-v1
137 $(call Device/LegacyImage)
138 $(Device/kernel-size-migration)
139 DEVICE_VENDOR := Linksys
140 DEVICE_MODEL := EA7500
141 DEVICE_VARIANT := v1
142 SOC := qcom-ipq8064
143 PAGESIZE := 2048
144 BLOCKSIZE := 128k
145 KERNEL_SIZE := 4096k
146 KERNEL = kernel-bin | append-dtb | uImage none | \
147 append-uImage-fakehdr filesystem
148 UBINIZE_OPTS := -E 5
149 IMAGES := factory.bin sysupgrade.bin
150 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
151 append-ubi | pad-to $$$$(PAGESIZE)
152 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
153 endef
154 TARGET_DEVICES += linksys_ea7500-v1
155
156 define Device/linksys_ea8500
157 $(call Device/LegacyImage)
158 $(Device/kernel-size-migration)
159 DEVICE_VENDOR := Linksys
160 DEVICE_MODEL := EA8500
161 SOC := qcom-ipq8064
162 PAGESIZE := 2048
163 BLOCKSIZE := 128k
164 KERNEL_SIZE := 4096k
165 KERNEL = kernel-bin | append-dtb | uImage none | \
166 append-uImage-fakehdr filesystem
167 BOARD_NAME := ea8500
168 SUPPORTED_DEVICES += ea8500
169 UBINIZE_OPTS := -E 5
170 IMAGES += factory.bin
171 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
172 append-ubi
173 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
174 endef
175 TARGET_DEVICES += linksys_ea8500
176
177 define Device/meraki_mr42
178 $(call Device/FitImage)
179 DEVICE_VENDOR := Cisco Meraki
180 DEVICE_MODEL := MR42
181 SOC := qcom-ipq8068
182 BLOCKSIZE := 128k
183 PAGESIZE := 2048
184 KERNEL_LOADADDR = 0x44208000
185 DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
186 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
187 -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
188 -uboot-envtools ath10k-firmware-qca9887-ct \
189 ath10k-firmware-qca99x0-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
190 kmod-leds-tlc591xx
191 endef
192 TARGET_DEVICES += meraki_mr42
193
194 define Device/meraki_mr52
195 $(call Device/FitImage)
196 DEVICE_VENDOR := Cisco Meraki
197 DEVICE_MODEL := MR52
198 SOC := qcom-ipq8068
199 BLOCKSIZE := 128k
200 PAGESIZE := 2048
201 KERNEL_LOADADDR = 0x44208000
202 DEVICE_DTS_CONFIG := config@2
203 DEVICE_PACKAGES := -swconfig -kmod-ata-ahci -kmod-ata-ahci-platform \
204 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
205 -kmod-phy-qcom-ipq806x-usb -kmod-usb3 -kmod-usb-dwc3-qcom \
206 -uboot-envtools ath10k-firmware-qca9887-ct \
207 ath10k-firmware-qca9984-ct kmod-eeprom-at24 kmod-hwmon-ina2xx \
208 kmod-leds-tlc591xx
209 endef
210 TARGET_DEVICES += meraki_mr52
211
212 define Device/nec_wg2600hp
213 $(call Device/LegacyImage)
214 DEVICE_VENDOR := NEC
215 DEVICE_MODEL := Aterm WG2600HP
216 SOC := qcom-ipq8064
217 BLOCKSIZE := 64k
218 BOARD_NAME := wg2600hp
219 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
220 pad-rootfs | append-metadata
221 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
222 endef
223 TARGET_DEVICES += nec_wg2600hp
224
225 define Device/nec_wg2600hp3
226 $(call Device/LegacyImage)
227 DEVICE_VENDOR := NEC Platforms
228 DEVICE_MODEL := Aterm WG2600HP3
229 SOC := qcom-ipq8062
230 BLOCKSIZE := 64k
231 IMAGES := sysupgrade.bin
232 IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
233 pad-rootfs | append-metadata
234 DEVICE_PACKAGES := -kmod-ata-ahci -kmod-ata-ahci-platform \
235 -kmod-usb-ohci -kmod-usb2 -kmod-usb-ledtrig-usbport \
236 -kmod-usb-phy-qcom-dwc3 -kmod-usb3 -kmod-usb-dwc3-qcom \
237 ath10k-firmware-qca9984-ct ipq-wifi-nec_wg2600hp3
238 endef
239 TARGET_DEVICES += nec_wg2600hp3
240
241 define Device/netgear_d7800
242 $(call Device/DniImage)
243 DEVICE_VENDOR := NETGEAR
244 DEVICE_MODEL := Nighthawk X4 D7800
245 SOC := qcom-ipq8064
246 KERNEL_SIZE := 4096k
247 NETGEAR_BOARD_ID := D7800
248 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4
249 BLOCKSIZE := 128k
250 PAGESIZE := 2048
251 BOARD_NAME := d7800
252 SUPPORTED_DEVICES += d7800
253 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
254 DEVICE_COMPAT_VERSION := 2.0
255 DEVICE_COMPAT_MESSAGE := Sysupgrade does not work due to rootfs ubi partition size change. \
256 Use factory image with the TFTP recovery flash routine.
257 endef
258 TARGET_DEVICES += netgear_d7800
259
260 define Device/netgear_r7500
261 $(call Device/DniImage)
262 DEVICE_VENDOR := NETGEAR
263 DEVICE_MODEL := Nighthawk X4 R7500
264 DEVICE_VARIANT := v1
265 SOC := qcom-ipq8064
266 KERNEL_SIZE := 4096k
267 NETGEAR_BOARD_ID := R7500
268 NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
269 BLOCKSIZE := 128k
270 PAGESIZE := 2048
271 BOARD_NAME := r7500
272 SUPPORTED_DEVICES += r7500
273 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
274 endef
275 TARGET_DEVICES += netgear_r7500
276
277 define Device/netgear_r7500v2
278 $(call Device/DniImage)
279 DEVICE_VENDOR := NETGEAR
280 DEVICE_MODEL := Nighthawk X4 R7500
281 DEVICE_VARIANT := v2
282 SOC := qcom-ipq8064
283 KERNEL_SIZE := 4096k
284 NETGEAR_BOARD_ID := R7500v2
285 NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
286 BLOCKSIZE := 128k
287 PAGESIZE := 2048
288 BOARD_NAME := r7500v2
289 SUPPORTED_DEVICES += r7500v2
290 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct \
291 ath10k-firmware-qca988x-ct
292 endef
293 TARGET_DEVICES += netgear_r7500v2
294
295 define Device/netgear_r7800
296 $(call Device/DniImage)
297 DEVICE_VENDOR := NETGEAR
298 DEVICE_MODEL := Nighthawk X4S R7800
299 SOC := qcom-ipq8065
300 KERNEL_SIZE := 4096k
301 NETGEAR_BOARD_ID := R7800
302 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
303 BLOCKSIZE := 128k
304 PAGESIZE := 2048
305 BOARD_NAME := r7800
306 SUPPORTED_DEVICES += r7800
307 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
308 endef
309 TARGET_DEVICES += netgear_r7800
310
311 define Device/netgear_xr500
312 $(call Device/DniImage)
313 DEVICE_VENDOR := NETGEAR
314 DEVICE_MODEL := Nighthawk XR500
315 SOC := qcom-ipq8065
316 KERNEL_SIZE := 4096k
317 NETGEAR_BOARD_ID := XR500
318 NETGEAR_HW_ID := 29764958+0+256+512+4x4+4x4+cascade
319 BLOCKSIZE := 128k
320 PAGESIZE := 2048
321 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct kmod-ramoops
322 endef
323 TARGET_DEVICES += netgear_xr500
324
325 define Device/qcom_ipq8064-ap148
326 $(call Device/FitImage)
327 $(call Device/UbiFit)
328 DEVICE_VENDOR := Qualcomm
329 DEVICE_MODEL := AP148
330 DEVICE_VARIANT := standard
331 SOC := qcom-ipq8064
332 DEVICE_DTS := qcom-ipq8064-ap148
333 KERNEL_INSTALL := 1
334 BLOCKSIZE := 128k
335 PAGESIZE := 2048
336 BOARD_NAME := ap148
337 SUPPORTED_DEVICES += ap148
338 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
339 endef
340 TARGET_DEVICES += qcom_ipq8064-ap148
341
342 define Device/qcom_ipq8064-ap148-legacy
343 $(call Device/LegacyImage)
344 $(call Device/UbiFit)
345 DEVICE_VENDOR := Qualcomm
346 DEVICE_MODEL := AP148
347 DEVICE_VARIANT := legacy
348 SOC := qcom-ipq8064
349 DEVICE_DTS := qcom-ipq8064-ap148
350 BLOCKSIZE := 128k
351 PAGESIZE := 2048
352 BOARD_NAME := ap148
353 SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
354 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
355 endef
356 TARGET_DEVICES += qcom_ipq8064-ap148-legacy
357
358 define Device/qcom_ipq8064-ap161
359 $(call Device/FitImage)
360 $(call Device/UbiFit)
361 DEVICE_VENDOR := Qualcomm
362 DEVICE_MODEL := AP161
363 SOC := qcom-ipq8064
364 DEVICE_DTS := qcom-ipq8064-ap161
365 KERNEL_INSTALL := 1
366 BLOCKSIZE := 128k
367 PAGESIZE := 2048
368 BOARD_NAME := ap161
369 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
370 endef
371 TARGET_DEVICES += qcom_ipq8064-ap161
372
373 define Device/qcom_ipq8064-db149
374 $(call Device/FitImage)
375 DEVICE_VENDOR := Qualcomm
376 DEVICE_MODEL := DB149
377 SOC := qcom-ipq8064
378 DEVICE_DTS := qcom-ipq8064-db149
379 KERNEL_INSTALL := 1
380 BOARD_NAME := db149
381 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
382 endef
383 TARGET_DEVICES += qcom_ipq8064-db149
384
385 define Device/tplink_ad7200
386 $(call Device/TpSafeImage)
387 DEVICE_VENDOR := TP-Link
388 DEVICE_MODEL := AD7200
389 DEVICE_VARIANT := v1/v2
390 DEVICE_ALT0_VENDOR := TP-Link
391 DEVICE_ALT0_MODEL := Talon AD7200
392 DEVICE_ALT0_VARIANT := v1/v2
393 SOC := qcom-ipq8064
394 BLOCKSIZE := 128k
395 PAGESIZE := 2048
396 TPLINK_BOARD_ID := AD7200
397 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-wil6210
398 endef
399 TARGET_DEVICES += tplink_ad7200
400
401 define Device/tplink_c2600
402 $(call Device/TpSafeImage)
403 DEVICE_VENDOR := TP-Link
404 DEVICE_MODEL := Archer C2600
405 DEVICE_VARIANT := v1
406 SOC := qcom-ipq8064
407 BLOCKSIZE := 128k
408 PAGESIZE := 2048
409 BOARD_NAME := c2600
410 SUPPORTED_DEVICES += c2600
411 TPLINK_BOARD_ID := C2600
412 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
413 endef
414 TARGET_DEVICES += tplink_c2600
415
416 define Device/tplink_vr2600v
417 DEVICE_VENDOR := TP-Link
418 DEVICE_MODEL := Archer VR2600v
419 DEVICE_VARIANT := v1
420 KERNEL_SUFFIX := -uImage
421 KERNEL = kernel-bin | append-dtb | uImage none
422 KERNEL_NAME := zImage
423 IMAGE_SIZE := 12672k
424 SOC := qcom-ipq8064
425 BLOCKSIZE := 128k
426 PAGESIZE := 2048
427 BOARD_NAME := vr2600v
428 SUPPORTED_DEVICES += vr2600v
429 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
430 IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | \
431 append-rootfs | pad-rootfs | append-metadata
432 endef
433 TARGET_DEVICES += tplink_vr2600v
434
435 define Device/ubnt_unifi-ac-hd
436 $(call Device/FitImageLzma)
437 DEVICE_VENDOR := Ubiquiti
438 DEVICE_MODEL := UniFi AC HD
439 SOC := qcom-ipq8064
440 BLOCKSIZE := 64k
441 IMAGE_SIZE := 14784k
442 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
443 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
444 append-rootfs | pad-rootfs | check-size | append-metadata
445 endef
446 TARGET_DEVICES += ubnt_unifi-ac-hd
447
448 define Device/zyxel_nbg6817
449 DEVICE_VENDOR := ZyXEL
450 DEVICE_MODEL := NBG6817
451 SOC := qcom-ipq8065
452 KERNEL_SIZE := 4096k
453 BLOCKSIZE := 64k
454 BOARD_NAME := nbg6817
455 RAS_BOARD := NBG6817
456 RAS_ROOTFS_SIZE := 20934k
457 RAS_VERSION := "V1.99(OWRT.9999)C0"
458 SUPPORTED_DEVICES += nbg6817
459 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs \
460 kmod-fs-ext4 losetup
461 $(call Device/ZyXELImage)
462 endef
463 TARGET_DEVICES += zyxel_nbg6817