forked from Plutonium141/XiaoMi-R4A-Gigabit-Actions-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mt7621.mk
2057 lines (1867 loc) · 57.5 KB
/
mt7621.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# MT7621 Profiles
#
include ./common-tp-link.mk
DEFAULT_SOC := mt7621
KERNEL_DTB += -d21
DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME
define Build/elecom-wrc-gs-factory
$(eval product=$(word 1,$(1)))
$(eval version=$(word 2,$(1)))
$(eval hash_opt=$(word 3,$(1)))
$(MKHASH) md5 $(hash_opt) $@ >> $@
( \
echo -n "ELECOM $(product) v$(version)" | \
dd bs=32 count=1 conv=sync; \
dd if=$@; \
mv [email protected] $@
endef
define Build/gemtek-trailer
printf "%s%08X" ".GEMTEK." "$$(cksum $@ | cut -d ' ' -f1)" >> $@
endef
define Build/hatlab-gateboard-combined
rm -fR [email protected]
mkfs.fat [email protected] -C 16384
mcopy -i [email protected] $(IMAGE_KERNEL) ::vmlinux.itb
PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" \
GUID="$(IMG_PART_DISKGUID)" $(SCRIPT_DIR)/gen_image_generic.sh \
$@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) [email protected] \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
256
endef
define Build/h3c-blank-header
dd if=/dev/zero [email protected] bs=160 count=1
cat $@ >> [email protected]
mv [email protected] $@
endef
define Build/hatlab-gateboard-kernel
rm -fR [email protected]
rm -fR [email protected]
mkdir -p [email protected]/{bin,dev,proc,sys,lib,etc}
mkdir -p [email protected]/lib/modules/$(LINUX_VERSION)
$(CP) $(STAGING_DIR)/rdloader/bin/* [email protected]/bin/
$(CP) $(STAGING_DIR)/rdloader/lib/* [email protected]/lib/
$(CP) $(STAGING_DIR)/rdloader/etc/* [email protected]/etc/
$(RSTRIP) [email protected]/bin/
$(RSTRIP) [email protected]/lib/
chmod +x [email protected]/bin/*
ln -s ./bin/rdloader [email protected]/init
( \
KMODS=(usb-common nls_base usbcore xhci-hcd xhci-mtk jbd2 mbcache ext4 scsi_mod usb-storage sd_mod mmc_core mmc_block mtk_sd crc32c_generic); \
for kmod in "$${KMODS[@]}"; do \
$(CP) \
$(TARGET_DIR)/lib/modules/$(LINUX_VERSION)/$$kmod.ko \
[email protected]/lib/modules/$(LINUX_VERSION)/; \
echo /lib/modules/$(LINUX_VERSION)/$$kmod.ko \
>> [email protected]/etc/rdloader_list; \
done; \
)
( \
if [ -f $(STAGING_DIR_HOST)/bin/cpio ]; then \
CPIO=$(STAGING_DIR_HOST)/bin/cpio; \
else \
CPIO="cpio"; \
fi; \
cd [email protected]; \
find . | cpio -o -H newc -R 0:0 > [email protected]; \
)
$(TOPDIR)/scripts/mkits.sh \
-D $(DEVICE_NAME) -o [email protected] -k $@ \
-C gzip -d $(KDIR)/image-$(DEVICE_DTS).dtb \
-i [email protected] \
-a $(KERNEL_LOADADDR) -e $(KERNEL_LOADADDR) \
-c config-1 -A $(LINUX_KARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f [email protected] [email protected]
@mv [email protected] $@
endef
define Build/iodata-factory
$(eval fw_size=$(word 1,$(1)))
$(eval fw_type=$(word 2,$(1)))
$(eval product=$(word 3,$(1)))
$(eval factory_bin=$(word 4,$(1)))
if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \
$(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \
$(STAGING_DIR_HOST)/bin/mksenaofw \
-r 0x30a -p $(product) -t $(fw_type) \
-e $(factory_bin) -o $(factory_bin).new; \
mv $(factory_bin).new $(factory_bin); \
$(CP) $(factory_bin) $(BIN_DIR)/; \
else \
echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
fi
endef
define Build/iodata-mstc-header
( \
data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | gzip -c | \
tail -c 8 | od -An -tx8 --endian little | tr -d ' \n')"; \
echo -ne "$$(echo $$data_size_crc | sed 's/../\\x&/g')" | \
dd of=$@ bs=8 count=1 seek=7 conv=notrunc 2>/dev/null; \
)
dd if=/dev/zero of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null
( \
header_crc="$$(dd if=$@ bs=64 count=1 2>/dev/null | gzip -c | \
tail -c 8 | od -An -N4 -tx4 --endian little | tr -d ' \n')"; \
echo -ne "$$(echo $$header_crc | sed 's/../\\x&/g')" | \
dd of=$@ bs=4 count=1 seek=1 conv=notrunc 2>/dev/null; \
)
endef
define Build/sercomm-tag-factory
$(eval magic_const=$(word 1,$(1)))
dd if=/dev/zero count=$$((0x200)) bs=1 [email protected] 2>/dev/null
dd if=/dev/zero count=$$((0x70)) bs=1 2>/dev/null | tr '\000' '0' | \
dd [email protected] conv=notrunc 2>/dev/null
printf $(SERCOMM_HWVER) | dd [email protected] bs=1 conv=notrunc 2>/dev/null
printf $(SERCOMM_HWID) | dd [email protected] bs=1 seek=$$((0x8)) conv=notrunc 2>/dev/null
printf $(SERCOMM_SWVER) | dd [email protected] bs=1 seek=$$((0x64)) conv=notrunc \
2>/dev/null
dd if=$(IMAGE_KERNEL) skip=$$((0x100)) iflag=skip_bytes 2>/dev/null [email protected]
dd if=$(IMAGE_KERNEL) count=$$((0x100)) iflag=count_bytes 2>/dev/null [email protected]
dd if=/dev/zero count=$$((0x100)) iflag=count_bytes 2>/dev/null [email protected]
wc -c < [email protected] | tr -d '\n' | dd [email protected] bs=1 seek=$$((0x70)) \
conv=notrunc 2>/dev/null
stat -c%s $@ | tr -d '\n' | dd [email protected] bs=1 seek=$$((0x80)) \
conv=notrunc 2>/dev/null
printf $(magic_const) | dd [email protected] bs=1 seek=$$((0x90)) conv=notrunc 2>/dev/null
cat [email protected] $@ | md5sum | awk '{print $$1;}' | tr -d '\n' | dd [email protected] bs=1 \
seek=$$((0x1e0)) conv=notrunc 2>/dev/null
mv [email protected] $@
endef
define Build/ubnt-erx-factory-image
if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
echo '21001:7' > $(1).compat; \
$(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
\
$(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
$(MKHASH) md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \
$(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
\
echo "dummy" > $(1).rootfs; \
$(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
\
$(MKHASH) md5 $(1).rootfs > $(1).md5; \
$(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
\
echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
$(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
\
$(CP) $(1) $(BIN_DIR)/; \
else \
echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
fi
endef
define Build/zytrx-header
$(eval board=$(word 1,$(1)))
$(eval version=$(word 2,$(1)))
$(STAGING_DIR_HOST)/bin/zytrx -B '$(board)' -v '$(version)' -i $@ -o [email protected]
mv [email protected] $@
endef
define Device/dsa-migration
DEVICE_COMPAT_VERSION := 1.1
DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
endef
define Device/adslr_g7
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := ADSLR
DEVICE_MODEL := G7
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += adslr_g7
define Device/afoundry_ew1200
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := AFOUNDRY
DEVICE_MODEL := EW1200
DEVICE_PACKAGES := kmod-ata-ahci kmod-mt76x2 kmod-mt7603 kmod-usb3 \
kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += ew1200
endef
TARGET_DEVICES += afoundry_ew1200
define Device/alfa-network_quad-e4g
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := ALFA Network
DEVICE_MODEL := Quad-E4G
DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 uboot-envtools \
-wpad-openssl
SUPPORTED_DEVICES += quad-e4g
endef
TARGET_DEVICES += alfa-network_quad-e4g
define Device/ampedwireless_ally_common
$(Device/dsa-migration)
DEVICE_VENDOR := Amped Wireless
DEVICE_PACKAGES := kmod-mt7615-firmware uboot-envtools
IMAGE_SIZE := 32768k
KERNEL_SIZE := 4096k
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma -n 'flashable-initramfs' |\
edimax-header -s CSYS -m RN68 -f 0x001c0000 -S 0x01100000
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
define Device/ampedwireless_ally-r1900k
$(Device/ampedwireless_ally_common)
DEVICE_MODEL := ALLY-R1900K
DEVICE_PACKAGES += kmod-usb3
endef
TARGET_DEVICES += ampedwireless_ally-r1900k
define Device/ampedwireless_ally-00x19k
$(Device/ampedwireless_ally_common)
DEVICE_MODEL := ALLY-00X19K
endef
TARGET_DEVICES += ampedwireless_ally-00x19k
define Device/asiarf_ap7621-001
$(Device/dsa-migration)
IMAGE_SIZE := 16000k
DEVICE_VENDOR := AsiaRF
DEVICE_MODEL := AP7621-001
DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-openssl
endef
TARGET_DEVICES += asiarf_ap7621-001
define Device/asiarf_ap7621-nv1
$(Device/dsa-migration)
IMAGE_SIZE := 16000k
DEVICE_VENDOR := AsiaRF
DEVICE_MODEL := AP7621-NV1
DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-openssl
endef
TARGET_DEVICES += asiarf_ap7621-nv1
define Device/asus_rt-ac57u
$(Device/dsa-migration)
DEVICE_VENDOR := ASUS
DEVICE_MODEL := RT-AC57U
IMAGE_SIZE := 16064k
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += asus_rt-ac57u
define Device/asus_rt-ac65p
$(Device/dsa-migration)
DEVICE_VENDOR := ASUS
DEVICE_MODEL := RT-AC65P
IMAGE_SIZE := 51200k
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uboot-envtools
endef
TARGET_DEVICES += asus_rt-ac65p
define Device/asus_rt-ac85p
$(Device/dsa-migration)
DEVICE_VENDOR := ASUS
DEVICE_MODEL := RT-AC85P
IMAGE_SIZE := 51200k
UBINIZE_OPTS := -E 5
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_PACKAGES := kmod-usb3 kmod-mt7615-firmware uboot-envtools
endef
TARGET_DEVICES += asus_rt-ac85p
define Device/asus_rt-n56u-b1
$(Device/dsa-migration)
DEVICE_VENDOR := ASUS
DEVICE_MODEL := RT-N56U
DEVICE_VARIANT := B1
IMAGE_SIZE := 16064k
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += asus_rt-n56u-b1
define Device/beeline_smartbox-turbo-plus
$(Device/dsa-migration)
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
KERNEL_SIZE := 6144k
IMAGE_SIZE := 32768k
KERNEL_LOADADDR := 0x81001000
LZMA_TEXT_START := 0x82800000
SERCOMM_KERNEL_OFFSET := 0x400100
SERCOMM_ROOTFS_OFFSET := 0x1000000
KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | \
lzma | uImage lzma | sercomm-kernel
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | \
lzma | uImage lzma
LOADER_TYPE := bin
IMAGES += factory.img
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
SERCOMM_HWID := 435152
SERCOMM_HWVER := 0001
SERCOMM_SWVER := 9999
IMAGE/factory.img := append-ubi | sercomm-tag-factory
DEVICE_VENDOR := Beeline
DEVICE_MODEL := SmartBox TURBO+
DEVICE_PACKAGES := kmod-mt7603e kmod-mt7615d luci-app-mtwifi \
-wpad-openssl kmod-usb3 uboot-envtools
endef
TARGET_DEVICES += beeline_smartbox-turbo-plus
define Device/buffalo_wsr-1166dhp
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
IMAGE_SIZE := 15936k
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WSR-1166DHP
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
SUPPORTED_DEVICES += wsr-1166
endef
TARGET_DEVICES += buffalo_wsr-1166dhp
define Device/buffalo_wsr-2533dhpl
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 7936k
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WSR-2533DHPL
DEVICE_ALT0_VENDOR := Buffalo
DEVICE_ALT0_MODEL := WSR-2533DHP
IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += buffalo_wsr-2533dhpl
define Device/buffalo_wsr-600dhp
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Buffalo
DEVICE_MODEL := WSR-600DHP
DEVICE_PACKAGES := kmod-mt7603 kmod-rt2800-pci
SUPPORTED_DEVICES += wsr-600
endef
TARGET_DEVICES += buffalo_wsr-600dhp
define Device/c-life_xg1
$(Device/dsa-migration)
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
KERNEL_SIZE := 4096k
IMAGE_SIZE := 91136k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_VENDOR := C-Life
DEVICE_MODEL := XG1
DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools kmod-usb3
endef
TARGET_DEVICES += c-life_xg1
define Device/cudy_wr1300
$(Device/dsa-migration)
IMAGE_SIZE := 15872k
DEVICE_VENDOR := Cudy
DEVICE_MODEL := WR1300
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 kmod-usb3 \
kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += cudy_wr1300
define Device/cudy_wr2100
$(Device/dsa-migration)
DEVICE_VENDOR := Cudy
DEVICE_MODEL := WR2100
IMAGE_SIZE := 15872k
UIMAGE_NAME := R11
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef
TARGET_DEVICES += cudy_wr2100
define Device/dlink_dir-8xx-a1
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
define Device/dlink_dir-8xx-r1
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615-firmware
KERNEL_INITRAMFS := $$(KERNEL)
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
check-size | append-metadata
endef
define Device/dlink_dir-xx60-a1
$(Device/dsa-migration)
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
IMAGE_SIZE := 40960k
UBINIZE_OPTS := -E 5
DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport
KERNEL := $$(KERNEL) | uimage-padhdr 96
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
endef
define Device/dlink_dir-1960-a1
$(Device/dlink_dir-xx60-a1)
DEVICE_MODEL := DIR-1960
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-1960-a1
define Device/dlink_dir-2640-a1
$(Device/dlink_dir-xx60-a1)
DEVICE_MODEL := DIR-2640
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-2640-a1
define Device/dlink_dir-2660-a1
$(Device/dlink_dir-xx60-a1)
DEVICE_MODEL := DIR-2660
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-2660-a1
define Device/dlink_dir-853-a3
$(Device/dlink_dir-xx60-a1)
DEVICE_MODEL := DIR-853
DEVICE_VARIANT := A3
endef
TARGET_DEVICES += dlink_dir-853-a3
define Device/dlink_dir-853-r1
$(Device/dlink_dir-8xx-r1)
DEVICE_MODEL := DIR-853
DEVICE_VARIANT := R1
DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += dlink_dir-853-r1
define Device/dlink_dir-860l-b1
$(Device/dsa-migration)
$(Device/seama)
BLOCKSIZE := 64k
SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
LOADER_TYPE := bin
KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | relocate-kernel | \
lzma -a0 | uImage lzma
IMAGE_SIZE := 16064k
DEVICE_VENDOR := D-Link
DEVICE_MODEL := DIR-860L
DEVICE_VARIANT := B1
DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += dir-860l-b1
endef
TARGET_DEVICES += dlink_dir-860l-b1
define Device/dlink_dir-867-a1
$(Device/dlink_dir-8xx-a1)
DEVICE_MODEL := DIR-867
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-867-a1
define Device/dlink_dir-878-a1
$(Device/dlink_dir-8xx-a1)
DEVICE_MODEL := DIR-878
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-878-a1
define Device/dlink_dir-882-a1
$(Device/dlink_dir-8xx-a1)
DEVICE_MODEL := DIR-882
DEVICE_VARIANT := A1
DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += dlink_dir-882-a1
define Device/dlink_dir-882-r1
$(Device/dlink_dir-8xx-r1)
DEVICE_MODEL := DIR-882
DEVICE_VARIANT := R1
DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | append-rootfs | check-size | \
sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \
ab0dff19af8842cdb70a86b4b68d23f7
endef
TARGET_DEVICES += dlink_dir-882-r1
define Device/d-team_newifi-d2
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 32448k
DEVICE_VENDOR := Newifi
DEVICE_MODEL := D2
DEVICE_COMPAT_VERSION := 1.1
DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e kmod-usb3 \
kmod-usb-ledtrig-usbport luci-app-mtwifi -wpad-openssl
endef
TARGET_DEVICES += d-team_newifi-d2
define Device/d-team_pbr-m1
$(Device/dsa-migration)
IMAGE_SIZE := 32448k
DEVICE_VENDOR := PandoraBox
DEVICE_MODEL := PBR-M1
DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
kmod-usb3 kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += pbr-m1
endef
TARGET_DEVICES += d-team_pbr-m1
define Device/edimax_ra21s
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Edimax
DEVICE_MODEL := RA21S
DEVICE_ALT0_VENDOR := Edimax
DEVICE_ALT0_MODEL := Gemini RA21S
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 02020040 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += edimax_ra21s
define Device/edimax_re23s
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 15680k
DEVICE_VENDOR := Edimax
DEVICE_MODEL := RE23S
DEVICE_ALT0_VENDOR := Edimax
DEVICE_ALT0_MODEL := Gemini RE23S
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
edimax-header -s CSYS -m RN76 -f 0x70000 -S 0x01100000 | pad-rootfs | \
check-size | append-metadata
IMAGES += factory.bin
IMAGE/factory.bin := append-kernel | append-rootfs | \
edimax-header -s CSYS -m RN76 -f 0x70000 -S 0x01100000 | pad-rootfs | \
check-size
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += edimax_re23s
define Device/edimax_rg21s
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Edimax
DEVICE_MODEL := Gemini AC2600 RG21S
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 02020038 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += edimax_rg21s
define Device/elecom_wrc-1167ghbk2-s
$(Device/dsa-migration)
IMAGE_SIZE := 15488k
DEVICE_VENDOR := ELECOM
DEVICE_MODEL := WRC-1167GHBK2-S
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elecom-wrc-gs-factory WRC-1167GHBK2-S 0.00
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += elecom_wrc-1167ghbk2-s
define Device/elecom_wrc-gs
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := ELECOM
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elecom-wrc-gs-factory $$$$(ELECOM_HWNAME) 0.00 -N | \
append-string MT7621_ELECOM_$$$$(ELECOM_HWNAME)
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
define Device/elecom_wrc-1167gs2-b
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 11264k
DEVICE_MODEL := WRC-1167GS2-B
ELECOM_HWNAME := WRC-1167GS2
endef
TARGET_DEVICES += elecom_wrc-1167gs2-b
define Device/elecom_wrc-1167gst2
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 24576k
DEVICE_MODEL := WRC-1167GST2
ELECOM_HWNAME := WRC-1167GST2
endef
TARGET_DEVICES += elecom_wrc-1167gst2
define Device/elecom_wrc-1750gs
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 11264k
DEVICE_MODEL := WRC-1750GS
ELECOM_HWNAME := WRC-1750GS
endef
TARGET_DEVICES += elecom_wrc-1750gs
define Device/elecom_wrc-1750gst2
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 24576k
DEVICE_MODEL := WRC-1750GST2
ELECOM_HWNAME := WRC-1750GST2
endef
TARGET_DEVICES += elecom_wrc-1750gst2
define Device/elecom_wrc-1750gsv
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 11264k
DEVICE_MODEL := WRC-1750GSV
ELECOM_HWNAME := WRC-1750GSV
endef
TARGET_DEVICES += elecom_wrc-1750gsv
define Device/elecom_wrc-1900gst
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 11264k
DEVICE_MODEL := WRC-1900GST
ELECOM_HWNAME := WRC-1900GST
endef
TARGET_DEVICES += elecom_wrc-1900gst
define Device/elecom_wrc-2533ghbk-i
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := ELECOM
DEVICE_MODEL := WRC-2533GHBK-I
IMAGE_SIZE := 9856k
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 0107002d 8844A2D168B45A2D | \
elecom-product-header WRC-2533GHBK-I
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += elecom_wrc-2533ghbk-i
define Device/elecom_wrc-2533gst
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 11264k
DEVICE_MODEL := WRC-2533GST
ELECOM_HWNAME := WRC-2533GST
endef
TARGET_DEVICES += elecom_wrc-2533gst
define Device/elecom_wrc-2533gst2
$(Device/elecom_wrc-gs)
IMAGE_SIZE := 24576k
DEVICE_MODEL := WRC-2533GST2
ELECOM_HWNAME := WRC-2533GST2
endef
TARGET_DEVICES += elecom_wrc-2533gst2
define Device/firefly_firewrt
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := Firefly
DEVICE_MODEL := FireWRT
DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
SUPPORTED_DEVICES += firewrt
endef
TARGET_DEVICES += firefly_firewrt
define Device/gehua_ghl-r-001
IMAGE_SIZE := 32448k
DEVICE_VENDOR := GeHua
DEVICE_MODEL := GHL-R-001
DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e kmod-usb3 \
kmod-usb-ledtrig-usbport luci-app-mtwifi -wpad-openssl
endef
TARGET_DEVICES += gehua_ghl-r-001
define Device/glinet_gl-mt1300
$(Device/dsa-migration)
IMAGE_SIZE := 32448k
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-MT1300
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 -uboot-envtools
endef
TARGET_DEVICES += glinet_gl-mt1300
define Device/gnubee_gb-pc1
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := GnuBee
DEVICE_MODEL := Personal Cloud One
DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-openssl
IMAGE_SIZE := 32448k
endef
TARGET_DEVICES += gnubee_gb-pc1
define Device/gnubee_gb-pc2
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := GnuBee
DEVICE_MODEL := Personal Cloud Two
DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-openssl
IMAGE_SIZE := 32448k
endef
TARGET_DEVICES += gnubee_gb-pc2
define Device/h3c_tx180x
$(Device/dsa-migration)
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 8192k
IMAGE_SIZE := 120832k
UBINIZE_OPTS := -E 5
KERNEL_LOADADDR := 0x82000000
KERNEL_INITRAMFS := kernel-bin | relocate-kernel 0x80001000 | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL := $$(KERNEL_INITRAMFS) | h3c-blank-header
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
DEVICE_VENDOR := H3C
DEVICE_PACKAGES := kmod-mt7915e uboot-envtools
endef
define Device/h3c_tx1800-plus
$(Device/h3c_tx180x)
DEVICE_MODEL := TX1800 Plus
endef
TARGET_DEVICES += h3c_tx1800-plus
define Device/h3c_tx1801-plus
$(Device/h3c_tx180x)
DEVICE_MODEL := TX1801 Plus
endef
TARGET_DEVICES += h3c_tx1801-plus
define Device/h3c_tx1806
$(Device/h3c_tx180x)
DEVICE_MODEL := TX1806
endef
TARGET_DEVICES += h3c_tx1806
define Device/hatlab_gateboard-one
$(Device/dsa-migration)
DEVICE_VENDOR := HATLab
DEVICE_MODEL := GateBoard-One
DEVICE_PACKAGES := kmod-fs-ext4 kmod-gpio-pcf857x kmod-hwmon-gpiofan \
kmod-hwmon-lm75 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-sdhci-mt7620 \
kmod-sfp kmod-thermal kmod-usb3 kmod-usb-ledtrig-usbport rdloader
KERNEL := kernel-bin | gzip | hatlab-gateboard-kernel
IMAGE/kernel.itb := append-kernel
IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
IMAGE/combined.img := hatlab-gateboard-combined | append-metadata
IMAGE/combined.img.gz := hatlab-gateboard-combined | gzip | append-metadata
IMAGES := kernel.itb
ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
IMAGES += rootfs.img.gz combined.img.gz
else
IMAGES += rootfs.img combined.img
endif
endef
TARGET_DEVICES += hatlab_gateboard-one
define Device/hilink_hlk-7621a
IMAGE_SIZE := 32448k
DEVICE_VENDOR := HiLink
DEVICE_MODEL := HLK-7621A
DEVICE_PACKAGES := kmod-usb3
endef
TARGET_DEVICES += hilink_hlk-7621a
define Device/hiwifi_hc5962
$(Device/dsa-migration)
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
UBINIZE_OPTS := -E 5
IMAGE_SIZE := 32768k
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
DEVICE_VENDOR := HiWiFi
DEVICE_MODEL := HC5962
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3
endef
TARGET_DEVICES += hiwifi_hc5962
define Device/ht-jsh_0211
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
DEVICE_VENDOR := HT-JSH
DEVICE_MODEL := 0211
DEVICE_PACKAGES := kmod-mt7603
endef
TARGET_DEVICES += ht-jsh_0211
define Device/huasifei_ws1208v2
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 32448k
DEVICE_VENDOR := Huasifei
DEVICE_MODEL := WS1208V2
DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
kmod-usb3 kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan \
kmod-usb-serial-option luci-proto-qmi
endef
TARGET_DEVICES += huasifei_ws1208v2
define Device/iodata_wn-ax1167gr
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 15552k
KERNEL_INITRAMFS := $$(KERNEL) | \
iodata-factory 7864320 4 0x1055 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin
DEVICE_VENDOR := I-O DATA
DEVICE_MODEL := WN-AX1167GR
DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
endef
TARGET_DEVICES += iodata_wn-ax1167gr
define Device/iodata_nand
$(Device/dsa-migration)
DEVICE_VENDOR := I-O DATA
BLOCKSIZE := 128k
PAGESIZE := 2048
UBINIZE_OPTS := -E 5
KERNEL_SIZE := 4096k
IMAGE_SIZE := 51200k
LOADER_TYPE := bin
KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | lzma | uImage lzma
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
# The OEM webinterface expects an kernel with initramfs which has the uImage
# header field ih_name.
# We don't want to set the header name field for the kernel include in the
# sysupgrade image as well, as this image shouldn't be accepted by the OEM
# webinterface. It will soft-brick the board.
define Device/iodata_wn-ax1167gr2
$(Device/iodata_nand)
DEVICE_MODEL := WN-AX1167GR2
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d42 -n '3.10(XBC.1)b10' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += iodata_wn-ax1167gr2
define Device/iodata_wn-ax2033gr
$(Device/iodata_nand)
DEVICE_MODEL := WN-AX2033GR
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d42 -n '3.10(VST.1)C10' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615-firmware
endef
TARGET_DEVICES += iodata_wn-ax2033gr
define Device/iodata_wn-dx1167r
$(Device/iodata_nand)
DEVICE_MODEL := WN-DX1167R
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d43 -n '3.10(XIK.1)b10' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += iodata_wn-dx1167r
define Device/iodata_wn-dx1200gr
$(Device/iodata_nand)
DEVICE_MODEL := WN-DX1200GR
KERNEL_INITRAMFS := $(KERNEL_DTB) | loader-kernel | lzma | \
uImage lzma -M 0x434f4d43 -n '3.10(XIQ.0)b20' | iodata-mstc-header
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7663-firmware-ap
endef
TARGET_DEVICES += iodata_wn-dx1200gr
define Device/iodata_wn-gx300gr
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 7616k
DEVICE_VENDOR := I-O DATA
DEVICE_MODEL := WN-GX300GR
DEVICE_PACKAGES := kmod-mt7603
endef
TARGET_DEVICES += iodata_wn-gx300gr
define Device/iodata_wnpr2600g
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
DEVICE_VENDOR := I-O DATA
DEVICE_MODEL := WNPR2600G
IMAGE_SIZE := 13952k
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | \
elx-header 0104003a 8844A2D168B45A2D
DEVICE_PACKAGES := kmod-mt7615-firmware
endef
TARGET_DEVICES += iodata_wnpr2600g
define Device/iptime_a6ns-m
$(Device/dsa-migration)
IMAGE_SIZE := 16128k
UIMAGE_NAME := a6nm
DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A6ns-M
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += iptime_a6ns-m
define Device/iptime_a8004t
$(Device/dsa-migration)
IMAGE_SIZE := 16128k
UIMAGE_NAME := a8004t
DEVICE_VENDOR := ipTIME
DEVICE_MODEL := A8004T
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef
TARGET_DEVICES += iptime_a8004t
define Device/jcg_jhr-ac876m
$(Device/dsa-migration)
IMAGE_SIZE := 16064k
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | jcg-header 89.1
JCG_MAXSIZE := 16064k
DEVICE_VENDOR := JCG
DEVICE_MODEL := JHR-AC876M
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 \
kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += jcg_jhr-ac876m
define Device/jcg_jhr-ac945m
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 16064k
IMAGES += factory.bin
IMAGE/factory.bin := $$(sysupgrade_bin) | check-size | jcg-header 91.1
JCG_MAXSIZE := 16064k
DEVICE_VENDOR := JCG
DEVICE_MODEL := JHR-AC945M
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3
endef