8980ff70d49d94a9f31af7cf693eb97334b9134b
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
1 #
2 # MT7621 Profiles
3 #
4
5 include ./common-tp-link.mk
6
7 DEFAULT_SOC := mt7621
8
9 KERNEL_DTB += -d21
10 DEVICE_VARS += UIMAGE_MAGIC SERCOMM_HWNAME
11
12 # The OEM webinterface expects an kernel with initramfs which has the uImage
13 # header field ih_name.
14 # We don't want to set the header name field for the kernel include in the
15 # sysupgrade image as well, as this image shouldn't be accepted by the OEM
16 # webinterface. It will soft-brick the board.
17 define Build/custom-initramfs-uimage
18 mkimage -A $(LINUX_KARCH) \
19 -O linux -T kernel \
20 -C lzma -a $(KERNEL_LOADADDR) $(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC),) \
21 -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
22 -n '$(1)' -d $@ $@.new
23 mv $@.new $@
24 endef
25
26 define Build/elecom-gst-factory
27 $(eval product=$(word 1,$(1)))
28 $(eval version=$(word 2,$(1)))
29 ( $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | tr -d '\n' ) >> $@
30 ( \
31 echo -n "ELECOM $(product) v$(version)" | \
32 dd bs=32 count=1 conv=sync; \
33 dd if=$@; \
34 ) > $@.new
35 mv $@.new $@
36 echo -n "MT7621_ELECOM_$(product)" >> $@
37 endef
38
39 define Build/elecom-wrc-factory
40 $(eval product=$(word 1,$(1)))
41 $(eval version=$(word 2,$(1)))
42 $(STAGING_DIR_HOST)/bin/mkhash md5 $@ >> $@
43 ( \
44 echo -n "ELECOM $(product) v$(version)" | \
45 dd bs=32 count=1 conv=sync; \
46 dd if=$@; \
47 ) > $@.new
48 mv $@.new $@
49 endef
50
51 define Build/iodata-factory
52 $(eval fw_size=$(word 1,$(1)))
53 $(eval fw_type=$(word 2,$(1)))
54 $(eval product=$(word 3,$(1)))
55 $(eval factory_bin=$(word 4,$(1)))
56 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \
57 $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \
58 $(STAGING_DIR_HOST)/bin/mksenaofw \
59 -r 0x30a -p $(product) -t $(fw_type) \
60 -e $(factory_bin) -o $(factory_bin).new; \
61 mv $(factory_bin).new $(factory_bin); \
62 $(CP) $(factory_bin) $(BIN_DIR)/; \
63 else \
64 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
65 fi
66 endef
67
68 define Build/iodata-mstc-header
69 ( \
70 data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | \
71 gzip -c | tail -c 8 | od -An -tx8 --endian little | tr -d ' \n')"; \
72 echo -ne "$$(echo $$data_size_crc | sed 's/../\\x&/g')" | \
73 dd of=$@ bs=8 count=1 seek=7 conv=notrunc 2>/dev/null; \
74 )
75 dd if=/dev/zero of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null
76 ( \
77 header_crc="$$(dd if=$@ bs=64 count=1 2>/dev/null | \
78 gzip -c | tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \
79 echo -ne "$$(echo $$header_crc | sed 's/../\\x&/g')" | \
80 dd of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null; \
81 )
82 endef
83
84 define Build/netis-tail
85 echo -n $(1) >> $@
86 echo -n $(UIMAGE_NAME)-yun | $(STAGING_DIR_HOST)/bin/mkhash md5 | \
87 sed 's/../\\\\x&/g' | xargs echo -ne >> $@
88 endef
89
90 define Build/ubnt-erx-factory-image
91 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
92 echo '21001:6' > $(1).compat; \
93 $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
94 \
95 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
96 mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \
97 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
98 \
99 echo "dummy" > $(1).rootfs; \
100 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
101 \
102 mkhash md5 $(1).rootfs > $(1).md5; \
103 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
104 \
105 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
106 $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
107 \
108 $(CP) $(1) $(BIN_DIR)/; \
109 else \
110 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
111 fi
112 endef
113
114 define Device/afoundry_ew1200
115 IMAGE_SIZE := 16064k
116 DEVICE_VENDOR := AFOUNDRY
117 DEVICE_MODEL := EW1200
118 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \
119 kmod-usb-ledtrig-usbport wpad-basic
120 SUPPORTED_DEVICES += ew1200
121 endef
122 TARGET_DEVICES += afoundry_ew1200
123
124 define Device/alfa-network_quad-e4g
125 IMAGE_SIZE := 16064k
126 DEVICE_VENDOR := ALFA Network
127 DEVICE_MODEL := Quad-E4G
128 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 uboot-envtools
129 endef
130 TARGET_DEVICES += alfa-network_quad-e4g
131
132 define Device/asiarf_ap7621-001
133 IMAGE_SIZE := 16000k
134 DEVICE_VENDOR := AsiaRF
135 DEVICE_MODEL := AP7621-001
136 DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3
137 endef
138 TARGET_DEVICES += asiarf_ap7621-001
139
140 define Device/asiarf_ap7621-nv1
141 IMAGE_SIZE := 16000k
142 DEVICE_VENDOR := AsiaRF
143 DEVICE_MODEL := AP7621-NV1
144 DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3
145 endef
146 TARGET_DEVICES += asiarf_ap7621-nv1
147
148 define Device/asus_rt-ac57u
149 DEVICE_VENDOR := ASUS
150 DEVICE_MODEL := RT-AC57U
151 IMAGE_SIZE := 16064k
152 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
153 kmod-usb-ledtrig-usbport wpad-basic
154 endef
155 TARGET_DEVICES += asus_rt-ac57u
156
157 define Device/asus_rt-ac65p
158 DEVICE_VENDOR := ASUS
159 DEVICE_MODEL := RT-AC65P
160 IMAGE_SIZE := 51200k
161 UBINIZE_OPTS := -E 5
162 BLOCKSIZE := 128k
163 PAGESIZE := 2048
164 KERNEL_SIZE := 4096k
165 IMAGES += factory.bin
166 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
167 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
168 check-size
169 DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e wpad-basic uboot-envtools
170 endef
171 TARGET_DEVICES += asus_rt-ac65p
172
173 define Device/asus_rt-ac85p
174 DEVICE_VENDOR := ASUS
175 DEVICE_MODEL := RT-AC85P
176 IMAGE_SIZE := 51200k
177 UBINIZE_OPTS := -E 5
178 BLOCKSIZE := 128k
179 PAGESIZE := 2048
180 KERNEL_SIZE := 4096k
181 IMAGES += factory.bin
182 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
183 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
184 check-size
185 DEVICE_PACKAGES := kmod-usb3 kmod-mt7615e wpad-basic uboot-envtools
186 endef
187 TARGET_DEVICES += asus_rt-ac85p
188
189 define Device/buffalo_wsr-1166dhp
190 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
191 IMAGE_SIZE := 15936k
192 DEVICE_VENDOR := Buffalo
193 DEVICE_MODEL := WSR-1166DHP
194 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
195 SUPPORTED_DEVICES += wsr-1166
196 endef
197 TARGET_DEVICES += buffalo_wsr-1166dhp
198
199 define Device/buffalo_wsr-2533dhpl
200 IMAGE_SIZE := 7936k
201 DEVICE_VENDOR := Buffalo
202 DEVICE_MODEL := WSR-2533DHPL
203 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
204 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
205 endef
206 TARGET_DEVICES += buffalo_wsr-2533dhpl
207
208 define Device/buffalo_wsr-600dhp
209 IMAGE_SIZE := 16064k
210 DEVICE_VENDOR := Buffalo
211 DEVICE_MODEL := WSR-600DHP
212 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-basic
213 SUPPORTED_DEVICES += wsr-600
214 endef
215 TARGET_DEVICES += buffalo_wsr-600dhp
216
217 define Device/dlink_dir-860l-b1
218 $(Device/seama)
219 BLOCKSIZE := 64k
220 SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
221 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
222 IMAGE_SIZE := 16064k
223 DEVICE_VENDOR := D-Link
224 DEVICE_MODEL := DIR-860L
225 DEVICE_VARIANT := B1
226 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
227 SUPPORTED_DEVICES += dir-860l-b1
228 endef
229 TARGET_DEVICES += dlink_dir-860l-b1
230
231 define Device/d-team_newifi-d2
232 IMAGE_SIZE := 32448k
233 DEVICE_VENDOR := Newifi
234 DEVICE_MODEL := D2
235 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
236 kmod-usb-ledtrig-usbport wpad-basic
237 endef
238 TARGET_DEVICES += d-team_newifi-d2
239
240 define Device/d-team_pbr-m1
241 IMAGE_SIZE := 16064k
242 DEVICE_VENDOR := PandoraBox
243 DEVICE_MODEL := PBR-M1
244 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
245 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
246 SUPPORTED_DEVICES += pbr-m1
247 endef
248 TARGET_DEVICES += d-team_pbr-m1
249
250 define Device/edimax_ra21s
251 IMAGE_SIZE := 16064k
252 DEVICE_VENDOR := Edimax
253 DEVICE_MODEL := RA21S
254 DEVICE_ALT0_VENDOR := Edimax
255 DEVICE_ALT0_MODEL := Gemini RA21S
256 IMAGES += factory.bin
257 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
258 elx-header 02020040 8844A2D168B45A2D
259 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
260 endef
261 TARGET_DEVICES += edimax_ra21s
262
263 define Device/edimax_rg21s
264 IMAGE_SIZE := 16064k
265 DEVICE_VENDOR := Edimax
266 DEVICE_MODEL := Gemini AC2600 RG21S
267 IMAGES += factory.bin
268 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
269 elx-header 02020038 8844A2D168B45A2D
270 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
271 endef
272 TARGET_DEVICES += edimax_rg21s
273
274 define Device/elecom_wrc-1167ghbk2-s
275 IMAGE_SIZE := 15488k
276 DEVICE_VENDOR := ELECOM
277 DEVICE_MODEL := WRC-1167GHBK2-S
278 IMAGES += factory.bin
279 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
280 elecom-wrc-factory WRC-1167GHBK2-S 0.00
281 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
282 endef
283 TARGET_DEVICES += elecom_wrc-1167ghbk2-s
284
285 define Device/elecom_wrc-1900gst
286 IMAGE_SIZE := 11264k
287 DEVICE_VENDOR := ELECOM
288 DEVICE_MODEL := WRC-1900GST
289 IMAGES += factory.bin
290 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
291 elecom-gst-factory WRC-1900GST 0.00
292 endef
293 TARGET_DEVICES += elecom_wrc-1900gst
294
295 define Device/elecom_wrc-2533gst
296 IMAGE_SIZE := 11264k
297 DEVICE_VENDOR := ELECOM
298 DEVICE_MODEL := WRC-2533GST
299 IMAGES += factory.bin
300 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
301 elecom-gst-factory WRC-2533GST 0.00
302 endef
303 TARGET_DEVICES += elecom_wrc-2533gst
304
305 define Device/firefly_firewrt
306 IMAGE_SIZE := 16064k
307 DEVICE_VENDOR := Firefly
308 DEVICE_MODEL := FireWRT
309 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
310 SUPPORTED_DEVICES += firewrt
311 endef
312 TARGET_DEVICES += firefly_firewrt
313
314 define Device/gehua_ghl-r-001
315 IMAGE_SIZE := 32448k
316 DEVICE_VENDOR := GeHua
317 DEVICE_MODEL := GHL-R-001
318 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
319 kmod-usb-ledtrig-usbport wpad-basic
320 endef
321 TARGET_DEVICES += gehua_ghl-r-001
322
323 define Device/gnubee_gb-pc1
324 DEVICE_VENDOR := GnuBee
325 DEVICE_MODEL := Personal Cloud One
326 DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
327 IMAGE_SIZE := 32448k
328 endef
329 TARGET_DEVICES += gnubee_gb-pc1
330
331 define Device/gnubee_gb-pc2
332 DEVICE_VENDOR := GnuBee
333 DEVICE_MODEL := Personal Cloud Two
334 DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
335 IMAGE_SIZE := 32448k
336 endef
337 TARGET_DEVICES += gnubee_gb-pc2
338
339 define Device/hiwifi_hc5962
340 BLOCKSIZE := 128k
341 PAGESIZE := 2048
342 KERNEL_SIZE := 2097152
343 UBINIZE_OPTS := -E 5
344 IMAGE_SIZE := 32768k
345 IMAGES += factory.bin
346 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
347 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
348 check-size
349 DEVICE_VENDOR := HiWiFi
350 DEVICE_MODEL := HC5962
351 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-basic
352 SUPPORTED_DEVICES += hc5962
353 # Kernel partition too small
354 DEFAULT := n
355 endef
356 TARGET_DEVICES += hiwifi_hc5962
357
358 define Device/iodata_wn-ax1167gr
359 IMAGE_SIZE := 15552k
360 KERNEL_INITRAMFS := $$(KERNEL) | \
361 iodata-factory 7864320 4 0x1055 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin
362 DEVICE_VENDOR := I-O DATA
363 DEVICE_MODEL := WN-AX1167GR
364 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
365 endef
366 TARGET_DEVICES += iodata_wn-ax1167gr
367
368 define Device/iodata_wn-ax1167gr2
369 BLOCKSIZE := 128k
370 PAGESIZE := 2048
371 UBINIZE_OPTS := -E 5
372 UIMAGE_MAGIC := 0x434f4d42
373 KERNEL_SIZE := 4096k
374 IMAGE_SIZE := 51200k
375 DEVICE_VENDOR := I-O DATA
376 DEVICE_MODEL := WN-AX1167GR2
377 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(XBC.1)b10 | \
378 iodata-mstc-header
379 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
380 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
381 endef
382 TARGET_DEVICES += iodata_wn-ax1167gr2
383
384 define Device/iodata_wn-ax2033gr
385 BLOCKSIZE := 128k
386 PAGESIZE := 2048
387 UBINIZE_OPTS := -E 5
388 UIMAGE_MAGIC := 0x434f4d42
389 KERNEL_SIZE := 4096k
390 IMAGE_SIZE := 51200k
391 DEVICE_VENDOR := I-O DATA
392 DEVICE_MODEL := WN-AX2033GR
393 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(VST.1)C10 | \
394 iodata-mstc-header
395 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
396 DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e wpad-basic
397 endef
398 TARGET_DEVICES += iodata_wn-ax2033gr
399
400 define Device/iodata_wn-dx1167r
401 BLOCKSIZE := 128k
402 PAGESIZE := 2048
403 UBINIZE_OPTS := -E 5
404 UIMAGE_MAGIC := 0x434f4d43
405 KERNEL_SIZE := 4096k
406 IMAGE_SIZE := 51200k
407 DEVICE_VENDOR := I-O DATA
408 DEVICE_MODEL := WN-DX1167R
409 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(XIK.1)b10 | \
410 iodata-mstc-header
411 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
412 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
413 endef
414 TARGET_DEVICES += iodata_wn-dx1167r
415
416 define Device/iodata_wn-gx300gr
417 IMAGE_SIZE := 7616k
418 DEVICE_VENDOR := I-O DATA
419 DEVICE_MODEL := WN-GX300GR
420 DEVICE_PACKAGES := kmod-mt7603 wpad-basic
421 endef
422 TARGET_DEVICES += iodata_wn-gx300gr
423
424 define Device/iodata_wnpr2600g
425 DEVICE_VENDOR := I-O DATA
426 DEVICE_MODEL := WNPR2600G
427 IMAGE_SIZE := 13952k
428 IMAGES += factory.bin
429 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
430 elx-header 0104003a 8844A2D168B45A2D
431 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
432 endef
433 TARGET_DEVICES += iodata_wnpr2600g
434
435 define Device/iptime_a6ns-m
436 IMAGE_SIZE := 16128k
437 UIMAGE_NAME := a6nm
438 DEVICE_VENDOR := ipTIME
439 DEVICE_MODEL := A6ns-M
440 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
441 endef
442 TARGET_DEVICES += iptime_a6ns-m
443
444 define Device/iptime_a8004t
445 IMAGE_SIZE := 16128k
446 UIMAGE_NAME := a8004t
447 DEVICE_VENDOR := ipTIME
448 DEVICE_MODEL := A8004T
449 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 wpad-basic
450 endef
451 TARGET_DEVICES += iptime_a8004t
452
453 define Device/jcg_jhr-ac876m
454 IMAGE_SIZE := 16064k
455 IMAGES += factory.bin
456 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
457 jcg-header 89.1
458 JCG_MAXSIZE := 16064k
459 DEVICE_VENDOR := JCG
460 DEVICE_MODEL := JHR-AC876M
461 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
462 endef
463 TARGET_DEVICES += jcg_jhr-ac876m
464
465 define Device/lenovo_newifi-d1
466 IMAGE_SIZE := 32448k
467 DEVICE_VENDOR := Newifi
468 DEVICE_MODEL := D1
469 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 \
470 kmod-usb-ledtrig-usbport wpad-basic
471 SUPPORTED_DEVICES += newifi-d1
472 endef
473 TARGET_DEVICES += lenovo_newifi-d1
474
475 define Device/linksys_re6500
476 IMAGE_SIZE := 7872k
477 DEVICE_VENDOR := Linksys
478 DEVICE_MODEL := RE6500
479 DEVICE_PACKAGES := kmod-mt76x2 wpad-basic
480 SUPPORTED_DEVICES += re6500
481 endef
482 TARGET_DEVICES += linksys_re6500
483
484 define Device/mediatek_ap-mt7621a-v60
485 IMAGE_SIZE := 7872k
486 DEVICE_VENDOR := Mediatek
487 DEVICE_MODEL := AP-MT7621A-V60 EVB
488 DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620
489 endef
490 TARGET_DEVICES += mediatek_ap-mt7621a-v60
491
492 define Device/mediatek_mt7621-eval-board
493 BLOCKSIZE := 64k
494 IMAGE_SIZE := 15104k
495 DEVICE_VENDOR := MediaTek
496 DEVICE_MODEL := MT7621 EVB
497 SUPPORTED_DEVICES += mt7621
498 endef
499 TARGET_DEVICES += mediatek_mt7621-eval-board
500
501 define Device/MikroTik
502 DEVICE_VENDOR := MikroTik
503 BLOCKSIZE := 64k
504 IMAGE_SIZE := 16128k
505 DEVICE_PACKAGES := kmod-usb3
506 LOADER_TYPE := elf
507 KERNEL := $(KERNEL_DTB) | loader-kernel
508 IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 | \
509 pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | \
510 check-size
511 endef
512
513 define Device/mikrotik_routerboard-750gr3
514 $(Device/MikroTik)
515 DEVICE_MODEL := RouterBOARD 750Gr3
516 DEVICE_PACKAGES += kmod-gpio-beeper
517 SUPPORTED_DEVICES += mikrotik,rb750gr3
518 endef
519 TARGET_DEVICES += mikrotik_routerboard-750gr3
520
521 define Device/mikrotik_routerboard-m11g
522 $(Device/MikroTik)
523 DEVICE_MODEL := RouterBOARD M11G
524 SUPPORTED_DEVICES += mikrotik,rbm11g
525 endef
526 TARGET_DEVICES += mikrotik_routerboard-m11g
527
528 define Device/mikrotik_routerboard-m33g
529 $(Device/MikroTik)
530 DEVICE_MODEL := RouterBOARD M33G
531 SUPPORTED_DEVICES += mikrotik,rbm33g
532 endef
533 TARGET_DEVICES += mikrotik_routerboard-m33g
534
535 define Device/mqmaker_witi
536 IMAGE_SIZE := 16064k
537 DEVICE_VENDOR := MQmaker
538 DEVICE_MODEL := WiTi
539 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
540 kmod-usb-ledtrig-usbport wpad-basic
541 SUPPORTED_DEVICES += witi mqmaker,witi-256m mqmaker,witi-512m
542 endef
543 TARGET_DEVICES += mqmaker_witi
544
545 define Device/mtc_wr1201
546 IMAGE_SIZE := 16000k
547 DEVICE_VENDOR := MTC
548 DEVICE_MODEL := Wireless Router WR1201
549 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage WR1201_8_128
550 DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
551 kmod-usb-ledtrig-usbport wpad-basic
552 endef
553 TARGET_DEVICES += mtc_wr1201
554
555 define Device/netgear_ex6150
556 DEVICE_VENDOR := NETGEAR
557 DEVICE_MODEL := EX6150
558 DEVICE_PACKAGES := kmod-mt76x2 wpad-basic
559 NETGEAR_BOARD_ID := U12H318T00_NETGEAR
560 IMAGE_SIZE := 14848k
561 IMAGES += factory.chk
562 IMAGE/factory.chk := $$(sysupgrade_bin) | check-size | \
563 netgear-chk
564 endef
565 TARGET_DEVICES += netgear_ex6150
566
567 define Device/netgear_sercomm_nand
568 BLOCKSIZE := 128k
569 PAGESIZE := 2048
570 KERNEL_SIZE := 4096k
571 UBINIZE_OPTS := -E 5
572 IMAGES += factory.img kernel.bin rootfs.bin
573 IMAGE/factory.img := pad-extra 2048k | append-kernel | pad-to 6144k | \
574 append-ubi | pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | \
575 zip $$$$(SERCOMM_HWNAME).bin | sercom-seal
576 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
577 IMAGE/kernel.bin := append-kernel
578 IMAGE/rootfs.bin := append-ubi | check-size
579 DEVICE_VENDOR := NETGEAR
580 DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
581 endef
582
583 define Device/netgear_r6220
584 $(Device/netgear_sercomm_nand)
585 DEVICE_MODEL := R6220
586 SERCOMM_HWNAME := R6220
587 SERCOMM_HWID := AYA
588 SERCOMM_HWVER := A001
589 SERCOMM_SWVER := 0x0086
590 IMAGE_SIZE := 28672k
591 DEVICE_PACKAGES += kmod-mt76x2
592 SUPPORTED_DEVICES += r6220
593 endef
594 TARGET_DEVICES += netgear_r6220
595
596
597 define Device/netgear_r6260
598 $(Device/netgear_sercomm_nand)
599 DEVICE_MODEL := R6260
600 SERCOMM_HWNAME := R6260
601 SERCOMM_HWID := CHJ
602 SERCOMM_HWVER := A001
603 SERCOMM_SWVER := 0x0052
604 IMAGE_SIZE := 40960k
605 DEVICE_PACKAGES += kmod-mt7615e
606 endef
607 TARGET_DEVICES += netgear_r6260
608
609 define Device/netgear_r6350
610 $(Device/netgear_sercomm_nand)
611 DEVICE_MODEL := R6350
612 SERCOMM_HWNAME := R6350
613 SERCOMM_HWID := CHJ
614 SERCOMM_HWVER := A001
615 SERCOMM_SWVER := 0x0052
616 IMAGE_SIZE := 40960k
617 DEVICE_PACKAGES += kmod-mt7615e
618 endef
619 TARGET_DEVICES += netgear_r6350
620
621 define Device/netgear_r6700-v2
622 $(Device/netgear_sercomm_nand)
623 DEVICE_MODEL := R6700
624 DEVICE_VARIANT := v2
625 DEVICE_ALT0_VENDOR := NETGEAR
626 DEVICE_ALT0_MODEL := Nighthawk AC2400
627 SERCOMM_HWNAME := R6950
628 SERCOMM_HWID := BZV
629 SERCOMM_HWVER := A001
630 SERCOMM_SWVER := 0x1032
631 IMAGE_SIZE := 40960k
632 DEVICE_PACKAGES += kmod-mt7615e
633 endef
634 TARGET_DEVICES += netgear_r6700-v2
635
636 define Device/netgear_r6800
637 $(Device/netgear_sercomm_nand)
638 DEVICE_MODEL := R6800
639 SERCOMM_HWNAME := R6950
640 SERCOMM_HWID := BZV
641 SERCOMM_HWVER := A001
642 SERCOMM_SWVER := 0x0062
643 IMAGE_SIZE := 40960k
644 DEVICE_PACKAGES += kmod-mt7615e
645 endef
646 TARGET_DEVICES += netgear_r6800
647
648 define Device/netgear_r6850
649 $(Device/netgear_sercomm_nand)
650 DEVICE_MODEL := R6850
651 SERCOMM_HWNAME := R6850
652 SERCOMM_HWID := CHJ
653 SERCOMM_HWVER := A001
654 SERCOMM_SWVER := 0x0052
655 IMAGE_SIZE := 40960k
656 DEVICE_PACKAGES += kmod-mt7615e
657 endef
658 TARGET_DEVICES += netgear_r6850
659
660 define Device/netgear_wndr3700-v5
661 BLOCKSIZE := 64k
662 IMAGE_SIZE := 15232k
663 SERCOMM_HWID := AYB
664 SERCOMM_HWVER := A001
665 SERCOMM_SWVER := 0x1054
666 IMAGES += factory.img
667 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
668 pad-rootfs
669 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
670 check-size
671 IMAGE/factory.img := pad-extra 320k | $$(IMAGE/default) | \
672 pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | \
673 zip WNDR3700v5.bin | sercom-seal
674 DEVICE_VENDOR := NETGEAR
675 DEVICE_MODEL := WNDR3700
676 DEVICE_VARIANT := v5
677 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
678 kmod-usb-ledtrig-usbport wpad-basic
679 SUPPORTED_DEVICES += wndr3700v5
680 endef
681 TARGET_DEVICES += netgear_wndr3700-v5
682
683 define Device/netis_wf2881
684 BLOCKSIZE := 128k
685 PAGESIZE := 2048
686 FILESYSTEMS := squashfs
687 KERNEL_SIZE := 4096k
688 IMAGE_SIZE := 129280k
689 UBINIZE_OPTS := -E 5
690 UIMAGE_NAME := WF2881_0.0.00
691 KERNEL_INITRAMFS := $(KERNEL_DTB) | netis-tail WF2881 | uImage lzma
692 IMAGES += factory.bin
693 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
694 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
695 check-size
696 DEVICE_VENDOR := NETIS
697 DEVICE_MODEL := WF2881
698 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
699 endef
700 TARGET_DEVICES += netis_wf2881
701
702 define Device/phicomm_k2p
703 IMAGE_SIZE := 15744k
704 DEVICE_VENDOR := Phicomm
705 DEVICE_MODEL := K2P
706 DEVICE_ALT0_VENDOR := Phicomm
707 DEVICE_ALT0_MODEL := KE 2P
708 SUPPORTED_DEVICES += k2p
709 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
710 endef
711 TARGET_DEVICES += phicomm_k2p
712
713 define Device/planex_vr500
714 IMAGE_SIZE := 65216k
715 DEVICE_VENDOR := Planex
716 DEVICE_MODEL := VR500
717 DEVICE_PACKAGES := kmod-usb3
718 SUPPORTED_DEVICES += vr500
719 endef
720 TARGET_DEVICES += planex_vr500
721
722 define Device/samknows_whitebox-v8
723 IMAGE_SIZE := 16064k
724 DEVICE_VENDOR := SamKnows
725 DEVICE_MODEL := Whitebox 8
726 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
727 kmod-usb-ledtrig-usbport uboot-envtools wpad-basic
728 SUPPORTED_DEVICES += sk-wb8
729 endef
730 TARGET_DEVICES += samknows_whitebox-v8
731
732 define Device/storylink_sap-g3200u3
733 IMAGE_SIZE := 7872k
734 DEVICE_VENDOR := STORYLiNK
735 DEVICE_MODEL := SAP-G3200U3
736 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
737 SUPPORTED_DEVICES += sap-g3200u3
738 endef
739 TARGET_DEVICES += storylink_sap-g3200u3
740
741 define Device/telco-electronics_x1
742 IMAGE_SIZE := 16064k
743 DEVICE_VENDOR := Telco Electronics
744 DEVICE_MODEL := X1
745 DEVICE_PACKAGES := kmod-usb3 kmod-mt76 wpad-basic
746 endef
747 TARGET_DEVICES += telco-electronics_x1
748
749 define Device/thunder_timecloud
750 IMAGE_SIZE := 16064k
751 DEVICE_VENDOR := Thunder
752 DEVICE_MODEL := Timecloud
753 DEVICE_PACKAGES := kmod-usb3
754 SUPPORTED_DEVICES += timecloud
755 endef
756 TARGET_DEVICES += thunder_timecloud
757
758 define Device/totolink_a7000r
759 IMAGE_SIZE := 16064k
760 UIMAGE_NAME := C8340R1C-9999
761 DEVICE_VENDOR := TOTOLINK
762 DEVICE_MODEL := A7000R
763 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
764 endef
765 TARGET_DEVICES += totolink_a7000r
766
767 define Device/adslr_g7
768 IMAGE_SIZE := 16064k
769 DEVICE_VENDOR := ADSLR
770 DEVICE_MODEL := G7
771 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
772 endef
773 TARGET_DEVICES += adslr_g7
774
775 define Device/tplink_re350-v1
776 $(Device/tplink-safeloader)
777 DEVICE_MODEL := RE350
778 DEVICE_VARIANT := v1
779 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
780 TPLINK_BOARD_ID := RE350-V1
781 IMAGE_SIZE := 6016k
782 SUPPORTED_DEVICES += re350-v1
783 endef
784 TARGET_DEVICES += tplink_re350-v1
785
786 define Device/tplink_re650-v1
787 $(Device/tplink-safeloader)
788 DEVICE_MODEL := RE650
789 DEVICE_VARIANT := v1
790 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
791 TPLINK_BOARD_ID := RE650-V1
792 IMAGE_SIZE := 14208k
793 endef
794 TARGET_DEVICES += tplink_re650-v1
795
796 define Device/ubnt_edgerouter_common
797 DEVICE_VENDOR := Ubiquiti
798 IMAGE_SIZE := 256768k
799 FILESYSTEMS := squashfs
800 KERNEL_SIZE := 3145728
801 KERNEL_INITRAMFS := $$(KERNEL) | \
802 ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
803 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
804 endef
805
806 define Device/ubnt_edgerouter-x
807 $(Device/ubnt_edgerouter_common)
808 DEVICE_MODEL := EdgeRouter X
809 SUPPORTED_DEVICES += ubnt-erx ubiquiti,edgerouterx
810 endef
811 TARGET_DEVICES += ubnt_edgerouter-x
812
813 define Device/ubnt_edgerouter-x-sfp
814 $(Device/ubnt_edgerouter_common)
815 DEVICE_MODEL := EdgeRouter X SFP
816 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x
817 SUPPORTED_DEVICES += ubnt-erx-sfp ubiquiti,edgerouterx-sfp
818 endef
819 TARGET_DEVICES += ubnt_edgerouter-x-sfp
820
821 define Device/ubnt_unifi-nanohd
822 DEVICE_VENDOR := Ubiquiti
823 DEVICE_MODEL := UniFi nanoHD
824 DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e wpad-basic
825 IMAGE_SIZE := 15552k
826 endef
827 TARGET_DEVICES += ubnt_unifi-nanohd
828
829 define Device/unielec_u7621-06-16m
830 IMAGE_SIZE := 16064k
831 DEVICE_VENDOR := UniElec
832 DEVICE_MODEL := U7621-06
833 DEVICE_VARIANT := 16M
834 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
835 SUPPORTED_DEVICES += u7621-06-256M-16M unielec,u7621-06-256m-16m
836 endef
837 TARGET_DEVICES += unielec_u7621-06-16m
838
839 define Device/unielec_u7621-06-64m
840 IMAGE_SIZE := 65216k
841 DEVICE_VENDOR := UniElec
842 DEVICE_MODEL := U7621-06
843 DEVICE_VARIANT := 64M
844 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
845 SUPPORTED_DEVICES += unielec,u7621-06-512m-64m
846 endef
847 TARGET_DEVICES += unielec_u7621-06-64m
848
849 define Device/wevo_11acnas
850 IMAGE_SIZE := 16064k
851 UIMAGE_NAME := 11AC-NAS-Router(0.0.0)
852 DEVICE_VENDOR := WeVO
853 DEVICE_MODEL := 11AC NAS Router
854 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
855 kmod-usb-ledtrig-usbport wpad-basic
856 SUPPORTED_DEVICES += 11acnas
857 endef
858 TARGET_DEVICES += wevo_11acnas
859
860 define Device/wevo_w2914ns-v2
861 IMAGE_SIZE := 16064k
862 UIMAGE_NAME := W2914NS-V2(0.0.0)
863 DEVICE_VENDOR := WeVO
864 DEVICE_MODEL := W2914NS
865 DEVICE_VARIANT := v2
866 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
867 kmod-usb-ledtrig-usbport wpad-basic
868 SUPPORTED_DEVICES += w2914nsv2
869 endef
870 TARGET_DEVICES += wevo_w2914ns-v2
871
872 define Device/xiaomi_mir3g
873 BLOCKSIZE := 128k
874 PAGESIZE := 2048
875 KERNEL_SIZE := 4096k
876 IMAGE_SIZE := 124416k
877 UBINIZE_OPTS := -E 5
878 IMAGES += kernel1.bin rootfs0.bin
879 IMAGE/kernel1.bin := append-kernel
880 IMAGE/rootfs0.bin := append-ubi | check-size
881 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
882 DEVICE_VENDOR := Xiaomi
883 DEVICE_MODEL := Mi Router 3G
884 SUPPORTED_DEVICES += R3G
885 SUPPORTED_DEVICES += mir3g
886 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
887 kmod-usb-ledtrig-usbport wpad-basic uboot-envtools
888 endef
889 TARGET_DEVICES += xiaomi_mir3g
890
891 define Device/xiaomi_mir3g-v2
892 IMAGE_SIZE := 14848k
893 DEVICE_VENDOR := Xiaomi
894 DEVICE_MODEL := Mi Router 3G
895 DEVICE_VARIANT := v2
896 DEVICE_ALT0_VENDOR := Xiaomi
897 DEVICE_ALT0_MODEL := Mi Router 4A
898 DEVICE_ALT0_VARIANT := Gigabit Edition
899 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
900 endef
901 TARGET_DEVICES += xiaomi_mir3g-v2
902
903 define Device/xiaomi_mir3p
904 BLOCKSIZE := 128k
905 PAGESIZE := 2048
906 KERNEL_SIZE:= 4096k
907 UBINIZE_OPTS := -E 5
908 IMAGE_SIZE := 255488k
909 DEVICE_VENDOR := Xiaomi
910 DEVICE_MODEL := Mi Router 3 Pro
911 IMAGES += factory.bin
912 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
913 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
914 check-size
915 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport \
916 wpad-basic uboot-envtools
917 endef
918 TARGET_DEVICES += xiaomi_mir3p
919
920 define Device/xiaoyu_xy-c5
921 IMAGE_SIZE := 32448k
922 DEVICE_VENDOR := XiaoYu
923 DEVICE_MODEL := XY-C5
924 DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3
925 endef
926 TARGET_DEVICES += xiaoyu_xy-c5
927
928 define Device/xzwifi_creativebox-v1
929 IMAGE_SIZE := 32448k
930 DEVICE_VENDOR := CreativeBox
931 DEVICE_MODEL := v1
932 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
933 kmod-usb3
934 endef
935 TARGET_DEVICES += xzwifi_creativebox-v1
936
937 define Device/youhua_wr1200js
938 IMAGE_SIZE := 16064k
939 DEVICE_VENDOR := YouHua
940 DEVICE_MODEL := WR1200JS
941 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
942 kmod-usb-ledtrig-usbport wpad-basic
943 endef
944 TARGET_DEVICES += youhua_wr1200js
945
946 define Device/youku_yk-l2
947 IMAGE_SIZE := 16064k
948 DEVICE_VENDOR := Youku
949 DEVICE_MODEL := YK-L2
950 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
951 kmod-usb-ledtrig-usbport wpad-basic
952 endef
953 TARGET_DEVICES += youku_yk-l2
954
955 define Device/zbtlink_zbt-we1326
956 IMAGE_SIZE := 16064k
957 DEVICE_VENDOR := Zbtlink
958 DEVICE_MODEL := ZBT-WE1326
959 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 \
960 wpad-basic
961 SUPPORTED_DEVICES += zbt-we1326
962 endef
963 TARGET_DEVICES += zbtlink_zbt-we1326
964
965 define Device/zbtlink_zbt-we3526
966 IMAGE_SIZE := 16064k
967 DEVICE_VENDOR := Zbtlink
968 DEVICE_MODEL := ZBT-WE3526
969 DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 kmod-usb3 \
970 kmod-usb-ledtrig-usbport wpad-basic
971 endef
972 TARGET_DEVICES += zbtlink_zbt-we3526
973
974 define Device/zbtlink_zbt-wg2626
975 IMAGE_SIZE := 16064k
976 DEVICE_VENDOR := Zbtlink
977 DEVICE_MODEL := ZBT-WG2626
978 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
979 kmod-usb-ledtrig-usbport wpad-basic
980 SUPPORTED_DEVICES += zbt-wg2626
981 endef
982 TARGET_DEVICES += zbtlink_zbt-wg2626
983
984 define Device/zbtlink_zbt-wg3526-16m
985 IMAGE_SIZE := 16064k
986 DEVICE_VENDOR := Zbtlink
987 DEVICE_MODEL := ZBT-WG3526
988 DEVICE_VARIANT := 16M
989 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
990 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
991 SUPPORTED_DEVICES += zbt-wg3526 zbt-wg3526-16M
992 endef
993 TARGET_DEVICES += zbtlink_zbt-wg3526-16m
994
995 define Device/zbtlink_zbt-wg3526-32m
996 IMAGE_SIZE := 32448k
997 DEVICE_VENDOR := Zbtlink
998 DEVICE_MODEL := ZBT-WG3526
999 DEVICE_VARIANT := 32M
1000 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
1001 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
1002 SUPPORTED_DEVICES += ac1200pro zbt-wg3526-32M
1003 endef
1004 TARGET_DEVICES += zbtlink_zbt-wg3526-32m
1005
1006 define Device/zio_freezio
1007 IMAGE_SIZE := 16064k
1008 DEVICE_VENDOR := ZIO
1009 DEVICE_MODEL := FREEZIO
1010 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
1011 kmod-usb-ledtrig-usbport wpad-basic
1012 endef
1013 TARGET_DEVICES += zio_freezio