4fdf656b4be218ebcbaa87fa1776adbf84871621
[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 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 endef
246 TARGET_DEVICES += netgear_d7800
247
248 define Device/netgear_r7500
249 $(call Device/DniImage)
250 DEVICE_VENDOR := NETGEAR
251 DEVICE_MODEL := Nighthawk X4 R7500
252 DEVICE_VARIANT := v1
253 SOC := qcom-ipq8064
254 KERNEL_SIZE := 4096k
255 NETGEAR_BOARD_ID := R7500
256 NETGEAR_HW_ID := 29764841+0+128+256+3x3+4x4
257 BLOCKSIZE := 128k
258 PAGESIZE := 2048
259 BOARD_NAME := r7500
260 SUPPORTED_DEVICES += r7500
261 DEVICE_PACKAGES := ath10k-firmware-qca988x-ct
262 endef
263 TARGET_DEVICES += netgear_r7500
264
265 define Device/netgear_r7500v2
266 $(call Device/DniImage)
267 DEVICE_VENDOR := NETGEAR
268 DEVICE_MODEL := Nighthawk X4 R7500
269 DEVICE_VARIANT := v2
270 SOC := qcom-ipq8064
271 KERNEL_SIZE := 4096k
272 NETGEAR_BOARD_ID := R7500v2
273 NETGEAR_HW_ID := 29764958+0+128+512+3x3+4x4
274 BLOCKSIZE := 128k
275 PAGESIZE := 2048
276 BOARD_NAME := r7500v2
277 SUPPORTED_DEVICES += r7500v2
278 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct \
279 ath10k-firmware-qca988x-ct
280 endef
281 TARGET_DEVICES += netgear_r7500v2
282
283 define Device/netgear_r7800
284 $(call Device/DniImage)
285 DEVICE_VENDOR := NETGEAR
286 DEVICE_MODEL := Nighthawk X4S R7800
287 SOC := qcom-ipq8065
288 KERNEL_SIZE := 4096k
289 NETGEAR_BOARD_ID := R7800
290 NETGEAR_HW_ID := 29764958+0+128+512+4x4+4x4+cascade
291 BLOCKSIZE := 128k
292 PAGESIZE := 2048
293 BOARD_NAME := r7800
294 SUPPORTED_DEVICES += r7800
295 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
296 endef
297 TARGET_DEVICES += netgear_r7800
298
299 define Device/netgear_xr500
300 $(call Device/DniImage)
301 DEVICE_VENDOR := NETGEAR
302 DEVICE_MODEL := Nighthawk XR500
303 SOC := qcom-ipq8065
304 KERNEL_SIZE := 4096k
305 NETGEAR_BOARD_ID := XR500
306 NETGEAR_HW_ID := 29764958+0+256+512+4x4+4x4+cascade
307 BLOCKSIZE := 128k
308 PAGESIZE := 2048
309 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
310 endef
311 TARGET_DEVICES += netgear_xr500
312
313 define Device/qcom_ipq8064-ap148
314 $(call Device/FitImage)
315 $(call Device/UbiFit)
316 DEVICE_VENDOR := Qualcomm
317 DEVICE_MODEL := AP148
318 DEVICE_VARIANT := standard
319 SOC := qcom-ipq8064
320 DEVICE_DTS := qcom-ipq8064-ap148
321 KERNEL_INSTALL := 1
322 BLOCKSIZE := 128k
323 PAGESIZE := 2048
324 BOARD_NAME := ap148
325 SUPPORTED_DEVICES += ap148
326 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
327 endef
328 TARGET_DEVICES += qcom_ipq8064-ap148
329
330 define Device/qcom_ipq8064-ap148-legacy
331 $(call Device/LegacyImage)
332 $(call Device/UbiFit)
333 DEVICE_VENDOR := Qualcomm
334 DEVICE_MODEL := AP148
335 DEVICE_VARIANT := legacy
336 SOC := qcom-ipq8064
337 DEVICE_DTS := qcom-ipq8064-ap148
338 BLOCKSIZE := 128k
339 PAGESIZE := 2048
340 BOARD_NAME := ap148
341 SUPPORTED_DEVICES := qcom,ipq8064-ap148 ap148
342 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
343 endef
344 TARGET_DEVICES += qcom_ipq8064-ap148-legacy
345
346 define Device/qcom_ipq8064-ap161
347 $(call Device/FitImage)
348 $(call Device/UbiFit)
349 DEVICE_VENDOR := Qualcomm
350 DEVICE_MODEL := AP161
351 SOC := qcom-ipq8064
352 DEVICE_DTS := qcom-ipq8064-ap161
353 KERNEL_INSTALL := 1
354 BLOCKSIZE := 128k
355 PAGESIZE := 2048
356 BOARD_NAME := ap161
357 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
358 endef
359 TARGET_DEVICES += qcom_ipq8064-ap161
360
361 define Device/qcom_ipq8064-db149
362 $(call Device/FitImage)
363 DEVICE_VENDOR := Qualcomm
364 DEVICE_MODEL := DB149
365 SOC := qcom-ipq8064
366 DEVICE_DTS := qcom-ipq8064-db149
367 KERNEL_INSTALL := 1
368 BOARD_NAME := db149
369 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
370 endef
371 TARGET_DEVICES += qcom_ipq8064-db149
372
373 define Device/tplink_ad7200
374 $(call Device/TpSafeImage)
375 DEVICE_VENDOR := TP-Link
376 DEVICE_MODEL := AD7200
377 DEVICE_VARIANT := v1/v2
378 DEVICE_ALT0_VENDOR := TP-Link
379 DEVICE_ALT0_MODEL := Talon AD7200
380 DEVICE_ALT0_VARIANT := v1/v2
381 SOC := qcom-ipq8064
382 BLOCKSIZE := 128k
383 PAGESIZE := 2048
384 TPLINK_BOARD_ID := AD7200
385 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct kmod-wil6210
386 endef
387 TARGET_DEVICES += tplink_ad7200
388
389 define Device/tplink_c2600
390 $(call Device/TpSafeImage)
391 DEVICE_VENDOR := TP-Link
392 DEVICE_MODEL := Archer C2600
393 DEVICE_VARIANT := v1
394 SOC := qcom-ipq8064
395 BLOCKSIZE := 128k
396 PAGESIZE := 2048
397 BOARD_NAME := c2600
398 SUPPORTED_DEVICES += c2600
399 TPLINK_BOARD_ID := C2600
400 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
401 endef
402 TARGET_DEVICES += tplink_c2600
403
404 define Device/tplink_vr2600v
405 DEVICE_VENDOR := TP-Link
406 DEVICE_MODEL := Archer VR2600v
407 DEVICE_VARIANT := v1
408 KERNEL_SUFFIX := -uImage
409 KERNEL = kernel-bin | append-dtb | uImage none
410 KERNEL_NAME := zImage
411 IMAGE_SIZE := 12672k
412 SOC := qcom-ipq8064
413 BLOCKSIZE := 128k
414 PAGESIZE := 2048
415 BOARD_NAME := vr2600v
416 SUPPORTED_DEVICES += vr2600v
417 DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
418 IMAGE/sysupgrade.bin := pad-extra 512 | append-kernel | \
419 append-rootfs | pad-rootfs | append-metadata
420 endef
421 TARGET_DEVICES += tplink_vr2600v
422
423 define Device/ubnt_unifi-ac-hd
424 $(call Device/FitImageLzma)
425 DEVICE_VENDOR := Ubiquiti
426 DEVICE_MODEL := UniFi AC HD
427 SOC := qcom-ipq8064
428 BLOCKSIZE := 64k
429 IMAGE_SIZE := 14784k
430 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
431 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
432 append-rootfs | pad-rootfs | check-size | append-metadata
433 endef
434 TARGET_DEVICES += ubnt_unifi-ac-hd
435
436 define Device/zyxel_nbg6817
437 DEVICE_VENDOR := ZyXEL
438 DEVICE_MODEL := NBG6817
439 SOC := qcom-ipq8065
440 KERNEL_SIZE := 4096k
441 BLOCKSIZE := 64k
442 BOARD_NAME := nbg6817
443 RAS_BOARD := NBG6817
444 RAS_ROOTFS_SIZE := 20934k
445 RAS_VERSION := "V1.99(OWRT.9999)C0"
446 SUPPORTED_DEVICES += nbg6817
447 DEVICE_PACKAGES := ath10k-firmware-qca9984-ct e2fsprogs \
448 kmod-fs-ext4 losetup
449 $(call Device/ZyXELImage)
450 endef
451 TARGET_DEVICES += zyxel_nbg6817