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