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