treewide: gather DEVICE_VARS into one place
[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 $$$$(IMAGE_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 $$$$(IMAGE_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-600dhp
200 IMAGE_SIZE := 16064k
201 DEVICE_VENDOR := Buffalo
202 DEVICE_MODEL := WSR-600DHP
203 DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci wpad-basic
204 SUPPORTED_DEVICES += wsr-600
205 endef
206 TARGET_DEVICES += buffalo_wsr-600dhp
207
208 define Device/dlink_dir-860l-b1
209 $(Device/seama)
210 BLOCKSIZE := 64k
211 SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
212 KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
213 IMAGE_SIZE := 16064k
214 DEVICE_VENDOR := D-Link
215 DEVICE_MODEL := DIR-860L
216 DEVICE_VARIANT := B1
217 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
218 SUPPORTED_DEVICES += dir-860l-b1
219 endef
220 TARGET_DEVICES += dlink_dir-860l-b1
221
222 define Device/d-team_newifi-d2
223 IMAGE_SIZE := 32448k
224 DEVICE_VENDOR := Newifi
225 DEVICE_MODEL := D2
226 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
227 kmod-usb-ledtrig-usbport wpad-basic
228 endef
229 TARGET_DEVICES += d-team_newifi-d2
230
231 define Device/d-team_pbr-m1
232 IMAGE_SIZE := 16064k
233 DEVICE_VENDOR := PandoraBox
234 DEVICE_MODEL := PBR-M1
235 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
236 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
237 SUPPORTED_DEVICES += pbr-m1
238 endef
239 TARGET_DEVICES += d-team_pbr-m1
240
241 define Device/edimax_ra21s
242 IMAGE_SIZE := 16064k
243 DEVICE_VENDOR := Edimax
244 DEVICE_MODEL := RA21S
245 DEVICE_ALT0_VENDOR := Edimax
246 DEVICE_ALT0_MODEL := Gemini RA21S
247 IMAGES += factory.bin
248 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
249 elx-header 02020040 8844A2D168B45A2D
250 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
251 endef
252 TARGET_DEVICES += edimax_ra21s
253
254 define Device/edimax_rg21s
255 IMAGE_SIZE := 16064k
256 DEVICE_VENDOR := Edimax
257 DEVICE_MODEL := Gemini AC2600 RG21S
258 IMAGES += factory.bin
259 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
260 elx-header 02020038 8844A2D168B45A2D
261 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
262 endef
263 TARGET_DEVICES += edimax_rg21s
264
265 define Device/elecom_wrc-1167ghbk2-s
266 IMAGE_SIZE := 15488k
267 DEVICE_VENDOR := ELECOM
268 DEVICE_MODEL := WRC-1167GHBK2-S
269 IMAGES += factory.bin
270 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
271 elecom-wrc-factory WRC-1167GHBK2-S 0.00
272 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
273 endef
274 TARGET_DEVICES += elecom_wrc-1167ghbk2-s
275
276 define Device/elecom_wrc-1900gst
277 IMAGE_SIZE := 11264k
278 DEVICE_VENDOR := ELECOM
279 DEVICE_MODEL := WRC-1900GST
280 IMAGES += factory.bin
281 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
282 elecom-gst-factory WRC-1900GST 0.00
283 endef
284 TARGET_DEVICES += elecom_wrc-1900gst
285
286 define Device/elecom_wrc-2533gst
287 IMAGE_SIZE := 11264k
288 DEVICE_VENDOR := ELECOM
289 DEVICE_MODEL := WRC-2533GST
290 IMAGES += factory.bin
291 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
292 elecom-gst-factory WRC-2533GST 0.00
293 endef
294 TARGET_DEVICES += elecom_wrc-2533gst
295
296 define Device/firefly_firewrt
297 IMAGE_SIZE := 16064k
298 DEVICE_VENDOR := Firefly
299 DEVICE_MODEL := FireWRT
300 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
301 SUPPORTED_DEVICES += firewrt
302 endef
303 TARGET_DEVICES += firefly_firewrt
304
305 define Device/gehua_ghl-r-001
306 IMAGE_SIZE := 32448k
307 DEVICE_VENDOR := GeHua
308 DEVICE_MODEL := GHL-R-001
309 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
310 kmod-usb-ledtrig-usbport wpad-basic
311 DEFAULT := n
312 endef
313 TARGET_DEVICES += gehua_ghl-r-001
314
315 define Device/gnubee_gb-pc1
316 DEVICE_VENDOR := GnuBee
317 DEVICE_MODEL := Personal Cloud One
318 DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
319 IMAGE_SIZE := 32448k
320 endef
321 TARGET_DEVICES += gnubee_gb-pc1
322
323 define Device/gnubee_gb-pc2
324 DEVICE_VENDOR := GnuBee
325 DEVICE_MODEL := Personal Cloud Two
326 DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
327 IMAGE_SIZE := 32448k
328 endef
329 TARGET_DEVICES += gnubee_gb-pc2
330
331 define Device/hiwifi_hc5962
332 BLOCKSIZE := 128k
333 PAGESIZE := 2048
334 KERNEL_SIZE := 2097152
335 UBINIZE_OPTS := -E 5
336 IMAGE_SIZE := 32768k
337 IMAGES += factory.bin
338 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
339 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
340 check-size $$$$(IMAGE_SIZE)
341 DEVICE_VENDOR := HiWiFi
342 DEVICE_MODEL := HC5962
343 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 wpad-basic
344 SUPPORTED_DEVICES += hc5962
345 # Kernel partition too small
346 DEFAULT := n
347 endef
348 TARGET_DEVICES += hiwifi_hc5962
349
350 define Device/iodata_wn-ax1167gr
351 IMAGE_SIZE := 15552k
352 KERNEL_INITRAMFS := $$(KERNEL) | \
353 iodata-factory 7864320 4 0x1055 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin
354 DEVICE_VENDOR := I-O DATA
355 DEVICE_MODEL := WN-AX1167GR
356 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
357 endef
358 TARGET_DEVICES += iodata_wn-ax1167gr
359
360 define Device/iodata_wn-ax1167gr2
361 BLOCKSIZE := 128k
362 PAGESIZE := 2048
363 UBINIZE_OPTS := -E 5
364 UIMAGE_MAGIC := 0x434f4d42
365 KERNEL_SIZE := 4096k
366 IMAGE_SIZE := 51200k
367 DEVICE_VENDOR := I-O DATA
368 DEVICE_MODEL := WN-AX1167GR2
369 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(XBC.1)b10 | \
370 iodata-mstc-header
371 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
372 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
373 endef
374 TARGET_DEVICES += iodata_wn-ax1167gr2
375
376 define Device/iodata_wn-dx1167r
377 BLOCKSIZE := 128k
378 PAGESIZE := 2048
379 UBINIZE_OPTS := -E 5
380 UIMAGE_MAGIC := 0x434f4d43
381 KERNEL_SIZE := 4096k
382 IMAGE_SIZE := 51200k
383 DEVICE_VENDOR := I-O DATA
384 DEVICE_MODEL := WN-DX1167R
385 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage 3.10(XIK.1)b10 | \
386 iodata-mstc-header
387 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
388 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
389 endef
390 TARGET_DEVICES += iodata_wn-dx1167r
391
392 define Device/iodata_wn-gx300gr
393 IMAGE_SIZE := 7616k
394 DEVICE_VENDOR := I-O DATA
395 DEVICE_MODEL := WN-GX300GR
396 DEVICE_PACKAGES := kmod-mt7603 wpad-basic
397 endef
398 TARGET_DEVICES += iodata_wn-gx300gr
399
400 define Device/iodata_wnpr2600g
401 DEVICE_VENDOR := I-O DATA
402 DEVICE_MODEL := WNPR2600G
403 IMAGE_SIZE := 13952k
404 IMAGES += factory.bin
405 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
406 elx-header 0104003a 8844A2D168B45A2D
407 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
408 endef
409 TARGET_DEVICES += iodata_wnpr2600g
410
411 define Device/iptime_a6ns-m
412 IMAGE_SIZE := 16128k
413 UIMAGE_NAME := a6nm
414 DEVICE_VENDOR := ipTIME
415 DEVICE_MODEL := A6ns-M
416 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
417 endef
418 TARGET_DEVICES += iptime_a6ns-m
419
420 define Device/iptime_a8004t
421 IMAGE_SIZE := 16128k
422 UIMAGE_NAME := a8004t
423 DEVICE_VENDOR := ipTIME
424 DEVICE_MODEL := A8004T
425 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 wpad-basic
426 endef
427 TARGET_DEVICES += iptime_a8004t
428
429 define Device/jcg_jhr-ac876m
430 IMAGE_SIZE := 16064k
431 IMAGES += factory.bin
432 IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
433 jcg-header 89.1
434 JCG_MAXSIZE := 16064k
435 DEVICE_VENDOR := JCG
436 DEVICE_MODEL := JHR-AC876M
437 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
438 endef
439 TARGET_DEVICES += jcg_jhr-ac876m
440
441 define Device/lenovo_newifi-d1
442 IMAGE_SIZE := 32448k
443 DEVICE_VENDOR := Newifi
444 DEVICE_MODEL := D1
445 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 \
446 kmod-usb-ledtrig-usbport wpad-basic
447 SUPPORTED_DEVICES += newifi-d1
448 endef
449 TARGET_DEVICES += lenovo_newifi-d1
450
451 define Device/linksys_re6500
452 IMAGE_SIZE := 7872k
453 DEVICE_VENDOR := Linksys
454 DEVICE_MODEL := RE6500
455 DEVICE_PACKAGES := kmod-mt76x2 wpad-basic
456 SUPPORTED_DEVICES += re6500
457 endef
458 TARGET_DEVICES += linksys_re6500
459
460 define Device/mediatek_ap-mt7621a-v60
461 IMAGE_SIZE := 7872k
462 DEVICE_VENDOR := Mediatek
463 DEVICE_MODEL := AP-MT7621A-V60 EVB
464 DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620
465 endef
466 TARGET_DEVICES += mediatek_ap-mt7621a-v60
467
468 define Device/mediatek_mt7621-eval-board
469 BLOCKSIZE := 64k
470 IMAGE_SIZE := 15104k
471 DEVICE_VENDOR := MediaTek
472 DEVICE_MODEL := MT7621 EVB
473 SUPPORTED_DEVICES += mt7621
474 endef
475 TARGET_DEVICES += mediatek_mt7621-eval-board
476
477 define Device/MikroTik
478 DEVICE_VENDOR := MikroTik
479 BLOCKSIZE := 64k
480 IMAGE_SIZE := 16128k
481 DEVICE_PACKAGES := kmod-usb3
482 LOADER_TYPE := elf
483 PLATFORM := mt7621
484 KERNEL := $(KERNEL_DTB) | loader-kernel
485 IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 | \
486 pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | \
487 check-size $$$$(IMAGE_SIZE)
488 endef
489
490 define Device/mikrotik_rb750gr3
491 $(Device/MikroTik)
492 DEVICE_MODEL := RouterBOARD RB750G
493 DEVICE_VARIANT := r3
494 DEVICE_PACKAGES += kmod-gpio-beeper
495 endef
496 TARGET_DEVICES += mikrotik_rb750gr3
497
498 define Device/mikrotik_rbm11g
499 $(Device/MikroTik)
500 DEVICE_MODEL := RouterBOARD M11G
501 endef
502 TARGET_DEVICES += mikrotik_rbm11g
503
504 define Device/mikrotik_rbm33g
505 $(Device/MikroTik)
506 DEVICE_MODEL := RouterBOARD M33G
507 endef
508 TARGET_DEVICES += mikrotik_rbm33g
509
510 define Device/mqmaker_witi
511 IMAGE_SIZE := 16064k
512 DEVICE_VENDOR := MQmaker
513 DEVICE_MODEL := WiTi
514 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt76x2 kmod-sdhci-mt7620 kmod-usb3 \
515 kmod-usb-ledtrig-usbport wpad-basic
516 SUPPORTED_DEVICES += witi mqmaker,witi-256m mqmaker,witi-512m
517 endef
518 TARGET_DEVICES += mqmaker_witi
519
520 define Device/mtc_wr1201
521 IMAGE_SIZE := 16000k
522 DEVICE_VENDOR := MTC
523 DEVICE_MODEL := Wireless Router WR1201
524 KERNEL_INITRAMFS := $(KERNEL_DTB) | custom-initramfs-uimage WR1201_8_128
525 DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
526 kmod-usb-ledtrig-usbport wpad-basic
527 endef
528 TARGET_DEVICES += mtc_wr1201
529
530 define Device/netgear_ex6150
531 DEVICE_VENDOR := NETGEAR
532 DEVICE_MODEL := EX6150
533 DEVICE_PACKAGES := kmod-mt76x2 wpad-basic
534 NETGEAR_BOARD_ID := U12H318T00_NETGEAR
535 IMAGE_SIZE := 14848k
536 IMAGES += factory.chk
537 IMAGE/factory.chk := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
538 netgear-chk
539 endef
540 TARGET_DEVICES += netgear_ex6150
541
542 define Device/netgear_sercomm_nand
543 BLOCKSIZE := 128k
544 PAGESIZE := 2048
545 KERNEL_SIZE := 4096k
546 UBINIZE_OPTS := -E 5
547 IMAGES += factory.img kernel.bin rootfs.bin
548 IMAGE/factory.img := pad-extra 2048k | append-kernel | pad-to 6144k | \
549 append-ubi | pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | \
550 zip $$$$(SERCOMM_HWNAME).bin | sercom-seal
551 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
552 IMAGE/kernel.bin := append-kernel
553 IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
554 DEVICE_VENDOR := NETGEAR
555 DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
556 endef
557
558 define Device/netgear_r6220
559 $(Device/netgear_sercomm_nand)
560 DEVICE_MODEL := R6220
561 SERCOMM_HWNAME := R6220
562 SERCOMM_HWID := AYA
563 SERCOMM_HWVER := A001
564 SERCOMM_SWVER := 0x0086
565 IMAGE_SIZE := 28672k
566 DEVICE_PACKAGES += kmod-mt76x2
567 SUPPORTED_DEVICES += r6220
568 endef
569 TARGET_DEVICES += netgear_r6220
570
571
572 define Device/netgear_r6260
573 $(Device/netgear_sercomm_nand)
574 DEVICE_MODEL := R6260
575 SERCOMM_HWNAME := R6260
576 SERCOMM_HWID := CHJ
577 SERCOMM_HWVER := A001
578 SERCOMM_SWVER := 0x0052
579 IMAGE_SIZE := 40960k
580 DEVICE_PACKAGES += kmod-mt7615e
581 endef
582 TARGET_DEVICES += netgear_r6260
583
584 define Device/netgear_r6350
585 $(Device/netgear_sercomm_nand)
586 DEVICE_MODEL := R6350
587 SERCOMM_HWNAME := R6350
588 SERCOMM_HWID := CHJ
589 SERCOMM_HWVER := A001
590 SERCOMM_SWVER := 0x0052
591 IMAGE_SIZE := 40960k
592 DEVICE_PACKAGES += kmod-mt7615e
593 endef
594 TARGET_DEVICES += netgear_r6350
595
596 define Device/netgear_r6700-v2
597 $(Device/netgear_sercomm_nand)
598 DEVICE_MODEL := R6700
599 DEVICE_VARIANT := v2
600 DEVICE_ALT0_VENDOR := NETGEAR
601 DEVICE_ALT0_MODEL := Nighthawk AC2400
602 SERCOMM_HWNAME := R6950
603 SERCOMM_HWID := BZV
604 SERCOMM_HWVER := A001
605 SERCOMM_SWVER := 0x1032
606 IMAGE_SIZE := 40960k
607 DEVICE_PACKAGES += kmod-mt7615e
608 endef
609 TARGET_DEVICES += netgear_r6700-v2
610
611 define Device/netgear_r6800
612 $(Device/netgear_sercomm_nand)
613 DEVICE_MODEL := R6800
614 SERCOMM_HWNAME := R6950
615 SERCOMM_HWID := BZV
616 SERCOMM_HWVER := A001
617 SERCOMM_SWVER := 0x0062
618 IMAGE_SIZE := 40960k
619 DEVICE_PACKAGES += kmod-mt7615e
620 endef
621 TARGET_DEVICES += netgear_r6800
622
623 define Device/netgear_r6850
624 $(Device/netgear_sercomm_nand)
625 DEVICE_MODEL := R6850
626 SERCOMM_HWNAME := R6850
627 SERCOMM_HWID := CHJ
628 SERCOMM_HWVER := A001
629 SERCOMM_SWVER := 0x0052
630 IMAGE_SIZE := 40960k
631 DEVICE_PACKAGES += kmod-mt7615e
632 endef
633 TARGET_DEVICES += netgear_r6850
634
635 define Device/netgear_wndr3700-v5
636 BLOCKSIZE := 64k
637 IMAGE_SIZE := 15232k
638 SERCOMM_HWID := AYB
639 SERCOMM_HWVER := A001
640 SERCOMM_SWVER := 0x1054
641 IMAGES += factory.img
642 IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | \
643 pad-rootfs
644 IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | \
645 check-size $$$$(IMAGE_SIZE)
646 IMAGE/factory.img := pad-extra 320k | $$(IMAGE/default) | \
647 pad-to $$$$(BLOCKSIZE) | sercom-footer | pad-to 128 | \
648 zip WNDR3700v5.bin | sercom-seal
649 DEVICE_VENDOR := NETGEAR
650 DEVICE_MODEL := WNDR3700
651 DEVICE_VARIANT := v5
652 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
653 kmod-usb-ledtrig-usbport wpad-basic
654 SUPPORTED_DEVICES += wndr3700v5
655 endef
656 TARGET_DEVICES += netgear_wndr3700-v5
657
658 define Device/netis_wf2881
659 BLOCKSIZE := 128k
660 PAGESIZE := 2048
661 FILESYSTEMS := squashfs
662 KERNEL_SIZE := 4096k
663 IMAGE_SIZE := 129280k
664 UBINIZE_OPTS := -E 5
665 UIMAGE_NAME := WF2881_0.0.00
666 KERNEL_INITRAMFS := $(KERNEL_DTB) | netis-tail WF2881 | uImage lzma
667 IMAGES += factory.bin
668 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
669 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \
670 check-size $$$$(IMAGE_SIZE)
671 DEVICE_VENDOR := NETIS
672 DEVICE_MODEL := WF2881
673 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
674 endef
675 TARGET_DEVICES += netis_wf2881
676
677 define Device/phicomm_k2p
678 IMAGE_SIZE := 15744k
679 DEVICE_VENDOR := Phicomm
680 DEVICE_MODEL := K2P
681 DEVICE_ALT0_VENDOR := Phicomm
682 DEVICE_ALT0_MODEL := KE 2P
683 SUPPORTED_DEVICES += k2p
684 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
685 endef
686 TARGET_DEVICES += phicomm_k2p
687
688 define Device/planex_vr500
689 IMAGE_SIZE := 65216k
690 DEVICE_VENDOR := Planex
691 DEVICE_MODEL := VR500
692 DEVICE_PACKAGES := kmod-usb3
693 SUPPORTED_DEVICES += vr500
694 endef
695 TARGET_DEVICES += planex_vr500
696
697 define Device/samknows_whitebox-v8
698 IMAGE_SIZE := 16064k
699 DEVICE_VENDOR := SamKnows
700 DEVICE_MODEL := Whitebox 8
701 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
702 kmod-usb-ledtrig-usbport uboot-envtools wpad-basic
703 SUPPORTED_DEVICES += sk-wb8
704 endef
705 TARGET_DEVICES += samknows_whitebox-v8
706
707 define Device/storylink_sap-g3200u3
708 IMAGE_SIZE := 7872k
709 DEVICE_VENDOR := STORYLiNK
710 DEVICE_MODEL := SAP-G3200U3
711 DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
712 SUPPORTED_DEVICES += sap-g3200u3
713 endef
714 TARGET_DEVICES += storylink_sap-g3200u3
715
716 define Device/telco-electronics_x1
717 IMAGE_SIZE := 16064k
718 DEVICE_VENDOR := Telco Electronics
719 DEVICE_MODEL := X1
720 DEVICE_PACKAGES := kmod-usb3 kmod-mt76 wpad-basic
721 endef
722 TARGET_DEVICES += telco-electronics_x1
723
724 define Device/thunder_timecloud
725 IMAGE_SIZE := 16064k
726 DEVICE_VENDOR := Thunder
727 DEVICE_MODEL := Timecloud
728 DEVICE_PACKAGES := kmod-usb3
729 SUPPORTED_DEVICES += timecloud
730 endef
731 TARGET_DEVICES += thunder_timecloud
732
733 define Device/totolink_a7000r
734 IMAGE_SIZE := 16064k
735 UIMAGE_NAME := C8340R1C-9999
736 DEVICE_VENDOR := TOTOLINK
737 DEVICE_MODEL := A7000R
738 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
739 endef
740 TARGET_DEVICES += totolink_a7000r
741
742 define Device/adslr_g7
743 IMAGE_SIZE := 16064k
744 DEVICE_VENDOR := ADSLR
745 DEVICE_MODEL := G7
746 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
747 endef
748 TARGET_DEVICES += adslr_g7
749
750 define Device/tplink_re350-v1
751 $(Device/tplink-safeloader)
752 DEVICE_MODEL := RE350
753 DEVICE_VARIANT := v1
754 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
755 TPLINK_BOARD_ID := RE350-V1
756 IMAGE_SIZE := 6016k
757 SUPPORTED_DEVICES += re350-v1
758 endef
759 TARGET_DEVICES += tplink_re350-v1
760
761 define Device/tplink_re650-v1
762 $(Device/tplink-safeloader)
763 DEVICE_MODEL := RE650
764 DEVICE_VARIANT := v1
765 DEVICE_PACKAGES := kmod-mt7615e wpad-basic
766 TPLINK_BOARD_ID := RE650-V1
767 IMAGE_SIZE := 14208k
768 endef
769 TARGET_DEVICES += tplink_re650-v1
770
771 define Device/ubiquiti_edgerouterx
772 IMAGE_SIZE := 256768k
773 FILESYSTEMS := squashfs
774 KERNEL_SIZE := 3145728
775 KERNEL_INITRAMFS := $$(KERNEL) | \
776 ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
777 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
778 DEVICE_VENDOR := Ubiquiti
779 DEVICE_MODEL := EdgeRouter X
780 SUPPORTED_DEVICES += ubnt-erx
781 endef
782 TARGET_DEVICES += ubiquiti_edgerouterx
783
784 define Device/ubiquiti_edgerouterx-sfp
785 $(Device/ubiquiti_edgerouterx)
786 DEVICE_VENDOR := Ubiquiti
787 DEVICE_MODEL := EdgeRouter X-SFP
788 DEVICE_PACKAGES += kmod-i2c-algo-pca kmod-gpio-pca953x kmod-i2c-gpio-custom
789 SUPPORTED_DEVICES += ubnt-erx-sfp
790 endef
791 TARGET_DEVICES += ubiquiti_edgerouterx-sfp
792
793 define Device/ubnt_unifi-nanohd
794 DEVICE_VENDOR := Ubiquiti
795 DEVICE_MODEL := UniFi nanoHD
796 DEVICE_PACKAGES += kmod-mt7603 kmod-mt7615e wpad-basic
797 IMAGE_SIZE := 15552k
798 endef
799 TARGET_DEVICES += ubnt_unifi-nanohd
800
801 define Device/unielec_u7621-06-16m
802 IMAGE_SIZE := 16064k
803 DEVICE_VENDOR := UniElec
804 DEVICE_MODEL := U7621-06
805 DEVICE_VARIANT := 16M
806 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
807 SUPPORTED_DEVICES += u7621-06-256M-16M unielec,u7621-06-256m-16m
808 endef
809 TARGET_DEVICES += unielec_u7621-06-16m
810
811 define Device/unielec_u7621-06-64m
812 IMAGE_SIZE := 65216k
813 DEVICE_VENDOR := UniElec
814 DEVICE_MODEL := U7621-06
815 DEVICE_VARIANT := 64M
816 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
817 SUPPORTED_DEVICES += unielec,u7621-06-512m-64m
818 endef
819 TARGET_DEVICES += unielec_u7621-06-64m
820
821 define Device/wevo_11acnas
822 IMAGE_SIZE := 16064k
823 UIMAGE_NAME := 11AC-NAS-Router(0.0.0)
824 DEVICE_VENDOR := WeVO
825 DEVICE_MODEL := 11AC NAS Router
826 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
827 kmod-usb-ledtrig-usbport wpad-basic
828 SUPPORTED_DEVICES += 11acnas
829 endef
830 TARGET_DEVICES += wevo_11acnas
831
832 define Device/wevo_w2914ns-v2
833 IMAGE_SIZE := 16064k
834 UIMAGE_NAME := W2914NS-V2(0.0.0)
835 DEVICE_VENDOR := WeVO
836 DEVICE_MODEL := W2914NS
837 DEVICE_VARIANT := v2
838 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
839 kmod-usb-ledtrig-usbport wpad-basic
840 SUPPORTED_DEVICES += w2914nsv2
841 endef
842 TARGET_DEVICES += wevo_w2914ns-v2
843
844 define Device/xiaomi_mir3g
845 BLOCKSIZE := 128k
846 PAGESIZE := 2048
847 KERNEL_SIZE := 4096k
848 IMAGE_SIZE := 124416k
849 UBINIZE_OPTS := -E 5
850 IMAGES += kernel1.bin rootfs0.bin
851 IMAGE/kernel1.bin := append-kernel
852 IMAGE/rootfs0.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
853 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
854 DEVICE_VENDOR := Xiaomi
855 DEVICE_MODEL := Mi Router 3G
856 SUPPORTED_DEVICES += R3G
857 SUPPORTED_DEVICES += mir3g
858 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
859 kmod-usb-ledtrig-usbport wpad-basic uboot-envtools
860 endef
861 TARGET_DEVICES += xiaomi_mir3g
862
863 define Device/xiaomi_mir3g-v2
864 IMAGE_SIZE := 14848k
865 DEVICE_VENDOR := Xiaomi
866 DEVICE_MODEL := Mi Router 3G
867 DEVICE_VARIANT := v2
868 DEVICE_ALT0_VENDOR := Xiaomi
869 DEVICE_ALT0_MODEL := Mi Router 4A
870 DEVICE_ALT0_VARIANT := Gigabit Edition
871 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-basic
872 endef
873 TARGET_DEVICES += xiaomi_mir3g-v2
874
875 define Device/xiaomi_mir3p
876 BLOCKSIZE := 128k
877 PAGESIZE := 2048
878 KERNEL_SIZE:= 4096k
879 UBINIZE_OPTS := -E 5
880 IMAGE_SIZE := 255488k
881 DEVICE_VENDOR := Xiaomi
882 DEVICE_MODEL := Mi Router 3 Pro
883 IMAGES += factory.bin
884 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
885 IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
886 check-size $$$$(IMAGE_SIZE)
887 DEVICE_PACKAGES := kmod-mt7615e kmod-usb3 kmod-usb-ledtrig-usbport \
888 wpad-basic uboot-envtools
889 endef
890 TARGET_DEVICES += xiaomi_mir3p
891
892 define Device/xiaoyu_xy-c5
893 IMAGE_SIZE := 32448k
894 DEVICE_VENDOR := XiaoYu
895 DEVICE_MODEL := XY-C5
896 DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3
897 endef
898 TARGET_DEVICES += xiaoyu_xy-c5
899
900 define Device/xzwifi_creativebox-v1
901 IMAGE_SIZE := 32448k
902 DEVICE_VENDOR := CreativeBox
903 DEVICE_MODEL := v1
904 DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
905 kmod-usb3
906 endef
907 TARGET_DEVICES += xzwifi_creativebox-v1
908
909 define Device/youhua_wr1200js
910 IMAGE_SIZE := 16064k
911 DEVICE_VENDOR := YouHua
912 DEVICE_MODEL := WR1200JS
913 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
914 kmod-usb-ledtrig-usbport wpad-basic
915 endef
916 TARGET_DEVICES += youhua_wr1200js
917
918 define Device/youku_yk-l2
919 IMAGE_SIZE := 16064k
920 DEVICE_VENDOR := Youku
921 DEVICE_MODEL := YK-L2
922 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
923 kmod-usb-ledtrig-usbport wpad-basic
924 endef
925 TARGET_DEVICES += youku_yk-l2
926
927 define Device/zbtlink_zbt-we1326
928 IMAGE_SIZE := 16064k
929 DEVICE_VENDOR := Zbtlink
930 DEVICE_MODEL := ZBT-WE1326
931 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620 \
932 wpad-basic
933 SUPPORTED_DEVICES += zbt-we1326
934 endef
935 TARGET_DEVICES += zbtlink_zbt-we1326
936
937 define Device/zbtlink_zbt-we3526
938 IMAGE_SIZE := 16064k
939 DEVICE_VENDOR := Zbtlink
940 DEVICE_MODEL := ZBT-WE3526
941 DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 kmod-usb3 \
942 kmod-usb-ledtrig-usbport wpad-basic
943 endef
944 TARGET_DEVICES += zbtlink_zbt-we3526
945
946 define Device/zbtlink_zbt-wg2626
947 IMAGE_SIZE := 16064k
948 DEVICE_VENDOR := Zbtlink
949 DEVICE_MODEL := ZBT-WG2626
950 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 \
951 kmod-usb-ledtrig-usbport wpad-basic
952 SUPPORTED_DEVICES += zbt-wg2626
953 endef
954 TARGET_DEVICES += zbtlink_zbt-wg2626
955
956 define Device/zbtlink_zbt-wg3526-16m
957 IMAGE_SIZE := 16064k
958 DEVICE_VENDOR := Zbtlink
959 DEVICE_MODEL := ZBT-WG3526
960 DEVICE_VARIANT := 16M
961 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
962 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
963 SUPPORTED_DEVICES += zbt-wg3526 zbt-wg3526-16M
964 endef
965 TARGET_DEVICES += zbtlink_zbt-wg3526-16m
966
967 define Device/zbtlink_zbt-wg3526-32m
968 IMAGE_SIZE := 32448k
969 DEVICE_VENDOR := Zbtlink
970 DEVICE_MODEL := ZBT-WG3526
971 DEVICE_VARIANT := 32M
972 DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \
973 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic
974 SUPPORTED_DEVICES += ac1200pro zbt-wg3526-32M
975 endef
976 TARGET_DEVICES += zbtlink_zbt-wg3526-32m
977
978 define Device/zio_freezio
979 IMAGE_SIZE := 16064k
980 DEVICE_VENDOR := ZIO
981 DEVICE_MODEL := FREEZIO
982 DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
983 kmod-usb-ledtrig-usbport wpad-basic
984 endef
985 TARGET_DEVICES += zio_freezio