kiddin9 1 an în urmă
părinte
comite
a6613bea37
29 a modificat fișierele cu 2388 adăugiri și 706 ștergeri
  1. 2 2
      devices/armsr_armv8/patches/rootfs.patch
  2. 1 1
      devices/ath79_nand/.config
  3. 1 1
      devices/common/diy.sh
  4. 10 1
      devices/mediatek_filogic/.config
  5. 3 1
      devices/mediatek_filogic/diy.sh
  6. 42 0
      devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dts
  7. 92 0
      devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dts
  8. 0 0
      devices/mediatek_filogic/patches/01-360t7.patch
  9. 2 14
      devices/mediatek_filogic/patches/02-ax6000.patch
  10. 0 0
      devices/mediatek_filogic/patches/03-nx30.patch
  11. 3 14
      devices/mediatek_filogic/patches/04-ax3000t.patch
  12. 105 0
      devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch
  13. 40 0
      devices/mediatek_filogic/patches/09-jcg_q30-pro.patch
  14. 462 0
      devices/mediatek_filogic/patches/10-re-cp-03.patch
  15. 279 0
      devices/mediatek_filogic/patches/11-gl-mt2500.patch
  16. 365 0
      devices/mediatek_filogic/patches/12-asr3000.patch
  17. 404 0
      devices/mediatek_filogic/patches/13-rg-x60-pro.patch
  18. 359 0
      devices/mediatek_filogic/patches/14-netcore-n60.patch
  19. 0 379
      devices/mediatek_filogic/patches/7-jdcloud_re-cs-05.patch
  20. 0 6
      devices/mediatek_mt7981/.config
  21. 5 0
      devices/qualcommax_ipq60xx/.config
  22. BIN
      devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-cmiot_ax18.ipq6018
  23. BIN
      devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-qihoo_360v6.ipq6018
  24. BIN
      devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-qihoo_v6.ipq6018
  25. 206 0
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts
  26. 0 22
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi
  27. 0 253
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-v6.dts
  28. 6 6
      devices/qualcommax_ipq60xx/patches/v6m2.patch
  29. 1 6
      devices/rockchip_armv8/patches/99-more.patch

+ 2 - 2
devices/armsr_armv8/patches/rootfs.patch

@@ -42,13 +42,13 @@
  
 +define Device/box
 +  DEVICE_TITLE := 电视盒子全系列 / N1
-+  DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount -luci-app-attendedsysupgrade -luci-app-gpsysupgrade
++  DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount
 +endef
 +TARGET_DEVICES += box
 +
 +define Device/h28k
 +  DEVICE_TITLE := HinLink H28K
-+  DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount -luci-app-attendedsysupgrade -luci-app-gpsysupgrade
++  DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount
 +endef
 +TARGET_DEVICES += h28k
 +

+ 1 - 1
devices/ath79_nand/.config

@@ -13,9 +13,9 @@ CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300-v2=y
 CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300sw=y
 CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300tn=y
 CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4500-v3=y
-CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_linksys_ea4500-v3=y
 CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_zte_mf286=y
 CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_zte_mf281=y
+CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_domywifi_dw33d=y
 
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
 

+ 1 - 1
devices/common/diy.sh

@@ -16,7 +16,7 @@ sed -i '/	refresh_config();/d' scripts/feeds
 echo "$(date +"%s")" >version.date
 sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' package/Makefile
 sed -i 's/$(TARGET_DIR)) install/$(TARGET_DIR)) install --force-overwrite --force-depends/' package/Makefile
-sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advanced luci-app-firewall luci-app-gpsysupgrade luci-app-opkg luci-app-upnp luci-app-autoreboot \
+sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-opkg luci-app-upnp luci-app-autoreboot \
 luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs \
 coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan /" include/target.mk
 sed -i "s/procd-ujail//" include/target.mk

+ 10 - 1
devices/mediatek_filogic/.config

@@ -3,6 +3,8 @@ CONFIG_TARGET_mediatek=y
 CONFIG_TARGET_mediatek_filogic=y
 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_asus_tuf-ax4200=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_asus_rt-ax59u=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_asus_tuf-ax6000=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_bananapi_bpi-r3=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_tplink_tl-xdr4288=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_tplink_tl-xdr6086=y
@@ -14,6 +16,13 @@ CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_qihoo_360t7=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-ax3000t=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jcg_q30-pro=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cetron_ct3003=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt6000=y
-CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jdcloud_re-cs-05=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt2500=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m-emmc=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jdcloud_re-cp-03=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_abt_asr3000=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_ruijie_rg-x60-pro=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_netcore_n60=y
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

+ 3 - 1
devices/mediatek_filogic/diy.sh

@@ -4,4 +4,6 @@ shopt -s extglob
 
 sed -i "/mt7986_xiaomi_redmi-router-ax6000 /d" package/boot/uboot-mediatek/Makefile
 sed -i "/mt7981_h3c_magic-nx30-pro /d" package/boot/uboot-mediatek/Makefile
-sed -i "/mt7981_qihoo_360t7 /d" package/boot/uboot-mediatek/Makefile
+sed -i "/mt7981_qihoo_360t7 /d" package/boot/uboot-mediatek/Makefile
+sed -i "/cmcc_rax3000m.* /d" package/boot/uboot-mediatek/Makefile
+sed -i "/mt7981_jcg_q30-pro /d" package/boot/uboot-mediatek/Makefile

+ 42 - 0
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-emmc.dts

@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include "mt7981b-cmcc-rax3000m.dts"
+
+/ {
+	model = "CMCC RAX3000M (eMMC version)";
+	compatible = "cmcc,rax3000m-emmc", "mediatek,mt7981";
+
+	chosen {
+		bootargs = "root=PARTLABEL=rootfs rootwait rootfstype=squashfs,f2fs";
+	};
+};
+
+&mmc0 {
+	bus-width = <8>;
+	max-frequency = <26000000>;
+	no-sd;
+	no-sdio;
+	non-removable;
+	pinctrl-names = "default", "state_uhs";
+	pinctrl-0 = <&mmc0_pins_default>;
+	pinctrl-1 = <&mmc0_pins_uhs>;
+	vmmc-supply = <&reg_3p3v>;
+	status = "okay";
+};
+
+&pio {
+	mmc0_pins_default: mmc0-pins {
+		mux {
+			function = "flash";
+			groups = "emmc_45";
+		};
+	};
+
+	mmc0_pins_uhs: mmc0-uhs-pins {
+		mux {
+			function = "flash";
+			groups = "emmc_45";
+		};
+	};
+};

+ 92 - 0
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dts

@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include "mt7981b-cmcc-rax3000m.dts"
+
+/ {
+	model = "CMCC RAX3000M (NAND version)";
+	compatible = "cmcc,rax3000m-nand", "mediatek,mt7981";
+
+	aliases {
+		label-mac-device = &gmac1;
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_flash_pins>;
+	status = "okay";
+
+	spi_nand: flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "spi-nand";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+		mediatek,nmbm;
+		mediatek,bmt-max-ratio = <1>;
+		mediatek,bmt-max-reserved-blocks = <64>;
+
+		partitions {
+					compatible = "fixed-partitions";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					partition@0 {
+						label = "bl2";
+						reg = <0x00000 0x0100000>;
+						read-only;
+					};
+
+					partition@100000 {
+						label = "u-boot-env";
+						reg = <0x100000 0x80000>;
+					};
+
+					factory: partition@180000 {
+						label = "factory";
+						reg = <0x180000 0x200000>;
+						read-only;
+					};
+
+					partition@380000 {
+						label = "fip";
+						reg = <0x380000 0x200000>;
+						read-only;
+					};
+
+					partition@580000 {
+						label = "ubi";
+						reg = <0x580000 0x7200000>;
+					};
+		};
+	};
+};
+
+&pio {
+	spi0_flash_pins: spi0-pins {
+				mux {
+					function = "spi";
+					groups = "spi0", "spi0_wp_hold";
+				};
+
+				conf-pu {
+					pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
+					drive-strength = <8>;
+					mediatek,pull-up-adv = <0>; /* bias-disable */
+				};
+
+				conf-pd {
+					pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+					drive-strength = <8>;
+					mediatek,pull-up-adv = <0>; /* bias-disable */
+				};
+	};
+};
+
+&wifi {
+	mediatek,mtd-eeprom = <&factory 0x0>;
+};

+ 0 - 0
devices/mediatek_filogic/patches/1-360t7.patch → devices/mediatek_filogic/patches/01-360t7.patch


+ 2 - 14
devices/mediatek_filogic/patches/2-ax6000.patch → devices/mediatek_filogic/patches/02-ax6000.patch

@@ -26,19 +26,6 @@
    DEVICE_VENDOR := Xiaomi
    DEVICE_MODEL := Redmi Router AX6000 (stock layout)
 
---- a/package/boot/uboot-envtools/files/mediatek_filogic
-+++ b/package/boot/uboot-envtools/files/mediatek_filogic
-@@ -67,6 +66,9 @@ xiaomi,redmi-router-ax6000-ubootmod)
- 	ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
- 	ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
- 	;;
-+xiaomi,redmi-router-ax6000)
-+	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x10000" "0x20000" "1"
-+	;;
- zyxel,ex5601-t0)
- 	local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
- 	ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x40000" "2"
-
 new file mode 100644
 index 0000000000000..759baae3aeb18
 --- /dev/null
@@ -79,10 +66,11 @@ index 0000000000000..759baae3aeb18
 
 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
-@@ -95,6 +95,7 @@ platform_do_upgrade() {
+@@ -95,6 +95,8 @@ platform_do_upgrade() {
  	tplink,tl-xdr6088|\
  	xiaomi,mi-router-wr30u-112m-nmbm|\
  	xiaomi,mi-router-wr30u-ubootmod|\
++	xiaomi,mi-router-ax3000t|\
 +	xiaomi,redmi-router-ax6000|\
  	xiaomi,redmi-router-ax6000-ubootmod)
  		CI_KERNPART="fit"

+ 0 - 0
devices/mediatek_filogic/patches/3-nx30.patch → devices/mediatek_filogic/patches/03-nx30.patch


+ 3 - 14
devices/mediatek_filogic/patches/4-ax3000t.patch → devices/mediatek_filogic/patches/04-ax3000t.patch

@@ -13,19 +13,6 @@ Subject: [PATCH] mediatek: add Xiaomi AX3000T support
  create mode 100644 target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts
  create mode 100644 target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi
 
-diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic
-index a8def1d00b764..3ad8f80c750e0 100644
---- a/package/boot/uboot-envtools/files/mediatek_filogic
-+++ b/package/boot/uboot-envtools/files/mediatek_filogic
-@@ -62,6 +62,7 @@
- tplink,tl-xdr4288|\
- tplink,tl-xdr6086|\
- tplink,tl-xdr6088|\
-+xiaomi,mi-router-ax3000t|\
- xiaomi,mi-router-wr30u-ubootmod|\
- xiaomi,redmi-router-ax6000-ubootmod)
- 	. /lib/upgrade/nand.sh
-
 diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts b/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts
 new file mode 100644
 index 0000000000000..96f7680ef23a8
@@ -352,7 +339,7 @@ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/imag
 index 282054886b56e..413860a1a672c 100644
 --- a/target/linux/mediatek/image/filogic.mk
 +++ b/target/linux/mediatek/image/filogic.mk
-@@ -417,6 +417,20 @@
+@@ -417,6 +417,22 @@
  endef
  TARGET_DEVICES += tplink_tl-xdr6088
  
@@ -366,6 +353,8 @@ index 282054886b56e..413860a1a672c 100644
 +  PAGESIZE := 2048
 +  KERNEL_IN_UBI := 1
 +  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
++  IMAGES += factory.bin
++  IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
 +  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 +endef
 +TARGET_DEVICES += xiaomi_mi-router-ax3000t

+ 105 - 0
devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch

@@ -0,0 +1,105 @@
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -34,7 +34,7 @@ mediatek_setup_interfaces()
+ 	bananapi,bpi-r3)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
+ 		;;
+-	cmcc,rax3000m|\
++	cmcc,rax3000m*|\
+ 	h3c,magic-nx30-pro)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
+ 		;;
+@@ -103,12 +103,16 @@ mediatek_setup_macs()
+ 		wan_mac=$(macaddr_add "$lan_mac" 3)
+ 		label_mac=$lan_mac
+ 		;;
+-	cmcc,rax3000m)
++	cmcc,rax3000m*)
+ 		case "$(cmdline_get_var root)" in
+ 		/dev/mmc*)
+ 			wan_mac=$(mmc_get_mac_binary factory 0x2a)
+ 			lan_mac=$(mmc_get_mac_binary factory 0x24)
+ 			label_mac=$wan_mac
++		*)
++			wan_mac=$(mtd_get_mac_binary factory 0x2a)
++			lan_mac=$(mtd_get_mac_binary factory 0x24)
++			label_mac=$lan_mac
+ 		;;
+ 		esac
+ 		;;
+
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+@@ -46,7 +46,7 @@ case "$board" in
+ 		[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
+ 		[ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress
+ 		;;
+-	cmcc,rax3000m)
++	cmcc,rax3000m*)
+ 		case "$(cmdline_get_var root)" in
+ 		/dev/mmc*)
+ 			addr=$(mmc_get_mac_binary factory 0xa)
+
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -251,37 +251,36 @@ TARGET_DEVICES += cetron_ct3003
+ 
+ define Device/cmcc_rax3000m
+   DEVICE_VENDOR := CMCC
+-  DEVICE_MODEL := RAX3000M
+-  DEVICE_DTS := mt7981b-cmcc-rax3000m
+-  DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand
++  DEVICE_MODEL := RAX3000M NAND
++  DEVICE_DTS := mt7981b-cmcc-rax3000m-nand
+   DEVICE_DTS_DIR := ../dts
+-  DEVICE_DTC_FLAGS := --pad 4096
+-  DEVICE_DTS_LOADADDR := 0x43f00000
+   DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \
+ 	e2fsprogs f2fsck mkf2fs
+-  KERNEL_LOADADDR := 0x44000000
+-  KERNEL := kernel-bin | gzip
+-  KERNEL_INITRAMFS := kernel-bin | lzma | \
+-	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+-  KERNEL_INITRAMFS_SUFFIX := -recovery.itb
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  IMAGE_SIZE := 116736k
+   KERNEL_IN_UBI := 1
+-  UBOOTENV_IN_UBI := 1
+-  IMAGES := sysupgrade.itb
+-  IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
+-  IMAGE/sysupgrade.itb := append-kernel | \
+-	 fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
+-	 pad-rootfs | append-metadata
+-  ARTIFACTS := \
+-	emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
+-	nand-preloader.bin nand-bl31-uboot.fip
+-  ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
+-  ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr4
+-  ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc
+-  ARTIFACT/nand-preloader.bin := mt7981-bl2 spim-nand-ddr4
+-  ARTIFACT/nand-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand
++  IMAGES += factory.bin
++  IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ endef
+ TARGET_DEVICES += cmcc_rax3000m
+ 
++define Device/cmcc_rax3000m-emmc
++  DEVICE_VENDOR := CMCC
++  DEVICE_MODEL := RAX3000M eMMC
++  DEVICE_DTS := mt7981b-cmcc-rax3000m-emmc
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \
++	e2fsprogs f2fsck mkf2fs losetup kmod-fs-f2fs kmod-mmc
++  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
++  KERNEL_INITRAMFS := kernel-bin | lzma | \
++	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += cmcc_rax3000m-emmc
++
+ define Device/confiabits_mt7981
+   DEVICE_VENDOR := Confiabits
+   DEVICE_MODEL := MT7981

+ 40 - 0
devices/mediatek_filogic/patches/09-jcg_q30-pro.patch

@@ -0,0 +1,40 @@
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -381,19 +381,12 @@ define Device/jcg_q30-pro
+   UBINIZE_OPTS := -E 5
+   BLOCKSIZE := 128k
+   PAGESIZE := 2048
++  IMAGE_SIZE := 114816k
+   KERNEL_IN_UBI := 1
+-  UBOOTENV_IN_UBI := 1
+-  IMAGES := sysupgrade.itb
+-  KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+-  KERNEL := kernel-bin | gzip
+-  KERNEL_INITRAMFS := kernel-bin | lzma | \
+-        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+-  IMAGE/sysupgrade.itb := append-kernel | \
+-        fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
+   DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
+-  ARTIFACTS := preloader.bin bl31-uboot.fip
+-  ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
+-  ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30-pro
++  IMAGES += factory.bin
++  IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+ endef
+ TARGET_DEVICES += jcg_q30-pro
+ 
+
+--- a/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts
++++ b/target/linux/mediatek/dts/mt7981b-jcg-q30-pro.dts
+@@ -98,6 +98,10 @@
+ 		spi-tx-bus-width = <4>;
+ 		spi-rx-bus-width = <4>;
+ 
++		mediatek,nmbm;
++		mediatek,bmt-max-ratio = <1>;
++		mediatek,bmt-max-reserved-blocks = <64>;
++
+ 		partitions {
+ 			compatible = "fixed-partitions";
+ 			#address-cells = <1>;

+ 462 - 0
devices/mediatek_filogic/patches/10-re-cp-03.patch

@@ -0,0 +1,462 @@
+From c0c3234e17207a9287a08757fc1752490144a1cd Mon Sep 17 00:00:00 2001
+From: Tianling Shen <[email protected]>
+Date: Wed, 1 Nov 2023 14:46:15 +0800
+Subject: [PATCH] mediatek: add support for JDCloud RE-CP-03
+
+Hardware specification:
+  SoC: MediaTek MT7986A 4x A53
+  Flash: 128GB eMMC
+  RAM: 1GB DDR4
+  Ethernet: 4x 1GbE, 1x 2.5GbE (RTL8221B)
+  Switch: MediaTek MT7531AE
+  WiFi: MediaTek MT7976C
+  Button: Reset, Joylink
+  Power: DC 12V 2A
+
+Flash instructions:
+1. Download and flash the vendor migration firmware via webUI:
+   https://firmware.download.immortalwrt.eu.org/cnsztl/mediatek/filogic/openwrt-mediatek-mt7986-jdcloud_re-cp-03-vendor-migration.bin
+   (Default address is 192.168.68.1, user root, no password)
+2. After device has booted up, write new GPT table:
+   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-gpt.bin of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
+3. Erase and write new BL2:
+   echo 0 > /sys/block/mmcblk0boot0/force_ro
+   dd if=/dev/zero of=/dev/mmcblk0boot0 bs=512 count=8192 conv=fsync
+   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-preloader.bin of=/dev/mmcblk0boot0 bs=512 conv=fsync
+4. Erase and write new FIP:
+   dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=13312 count=8192 conv=fsync
+   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-bl31-uboot.fip of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
+5. Set static IP on your PC:
+   IP 192.168.1.254/24, GW 192.168.1.1
+6. Serve OpenWrt initramfs image using TFTP server.
+7. Cut off the power and re-engage, wait for TFTP recovery to complete.
+8. After OpenWrt has booted, perform sysupgrade.
+9. Additionally, if you want to have eMMC recovery boot feature:
+     (Don't worry! You will always have TFTP recovery boot feature.)
+   dd if=openwrt-mediatek-filogic-jdcloud_re-cp-03-initramfs-recovery.itb of=/dev/mmcblk0p4 bs=512 conv=fsync
+
+Signed-off-by: Tianling Shen <[email protected]>
+---
+ .../uboot-envtools/files/mediatek_filogic     |   5 +
+ .../mediatek/dts/mt7986a-jdcloud-re-cp-03.dts | 294 ++++++++++++++++++
+ .../filogic/base-files/etc/board.d/02_network |   6 +
+ .../etc/hotplug.d/firmware/11-mt76-caldata    |   3 +-
+ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac   |   3 +
+ .../base-files/lib/upgrade/platform.sh        |   5 +
+ target/linux/mediatek/image/filogic.mk        |  26 ++
+ 7 files changed, 341 insertions(+), 1 deletion(-)
+ create mode 100644 target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts
+
+diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic
+index 1e7b42b634189..cae761b4f9f1f 100644
+--- a/package/boot/uboot-envtools/files/mediatek_filogic
++++ b/package/boot/uboot-envtools/files/mediatek_filogic
+@@ -87,6 +87,11 @@ glinet,gl-mt6000)
+ glinet,gl-mt3000)
+ 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
+ 	;;
++jdcloud,re-cp-03)
++	local envdev=$(find_mmc_part "ubootenv" "mmcblk0")
++	ubootenv_add_uci_config "$envdev" "0x0" "0x40000" "0x40000" "1"
++	ubootenv_add_uci_config "$envdev" "0x40000" "0x40000" "0x40000" "1"
++	;;
+ mercusys,mr90x-v1|\
+ routerich,ax3000)
+ 	local envdev=/dev/mtd$(find_mtd_index "u-boot-env")
+diff --git a/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts
+new file mode 100644
+index 0000000000000..b62c2f421516a
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cp-03.dts
+@@ -0,0 +1,294 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright (C) 2023 Tianling Shen <[email protected]>
++ */
++
++/dts-v1/;
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
++
++#include "mt7986a.dtsi"
++
++/ {
++	model = "JDCloud RE-CP-03";
++	compatible = "jdcloud,re-cp-03", "mediatek,mt7986a";
++
++	aliases {
++		led-boot = &red_led;
++		led-failsafe = &red_led;
++		led-running = &green_led;
++		led-upgrade = &green_led;
++		serial0 = &uart0;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++	};
++
++	memory@40000000 {
++		reg = <0 0x40000000 0 0x40000000>;
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		button-joylink {
++			label = "joylink";
++			linux,code = <BTN_0>;
++			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
++		};
++
++		button-reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	gpio-leds {
++		compatible = "gpio-leds";
++
++		led-0 {
++			color = <LED_COLOR_ID_BLUE>;
++			function = LED_FUNCTION_STATUS;
++			gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
++		};
++
++		red_led: led-1 {
++			color = <LED_COLOR_ID_RED>;
++			function = LED_FUNCTION_STATUS;
++			gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
++		};
++
++		green_led: led-2 {
++			color = <LED_COLOR_ID_GREEN>;
++			function = LED_FUNCTION_STATUS;
++			gpios = <&pio 12 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	reg_1p8v: regulator-1p8v {
++		compatible = "regulator-fixed";
++		regulator-name = "fixed-1.8V";
++		regulator-min-microvolt = <1800000>;
++		regulator-max-microvolt = <1800000>;
++		regulator-boot-on;
++		regulator-always-on;
++	};
++
++	reg_3p3v: regulator-3p3v {
++		compatible = "regulator-fixed";
++		regulator-name = "fixed-3.3V";
++		regulator-min-microvolt = <3300000>;
++		regulator-max-microvolt = <3300000>;
++		regulator-boot-on;
++		regulator-always-on;
++	};
++};
++
++&crypto {
++	status = "okay";
++};
++
++&eth {
++	status = "okay";
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++		phy-mode = "2500base-x";
++
++		fixed-link {
++			speed = <2500>;
++			full-duplex;
++			pause;
++		};
++	};
++
++	gmac1: mac@1 {
++		compatible = "mediatek,eth-mac";
++		reg = <1>;
++		phy-mode = "2500base-x";
++		phy-handle = <&phy6>;
++	};
++
++	mdio: mdio-bus {
++		#address-cells = <1>;
++		#size-cells = <0>;
++	};
++};
++
++&mdio {
++	phy6: phy@6 {
++		compatible = "ethernet-phy-ieee802.3-c45";
++		reg = <6>;
++
++		reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
++		reset-assert-us = <10000>;
++		reset-deassert-us = <50000>;
++		realtek,aldps-enable;
++	};
++
++	switch: switch@1f {
++		compatible = "mediatek,mt7531";
++		reg = <31>;
++		reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
++		interrupt-controller;
++		#interrupt-cells = <1>;
++		interrupt-parent = <&pio>;
++		interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
++	};
++};
++
++&mmc0 {
++	bus-width = <8>;
++	cap-mmc-highspeed;
++	hs400-ds-delay = <0x14014>;
++	max-frequency = <200000000>;
++	mmc-hs200-1_8v;
++	mmc-hs400-1_8v;
++	no-sd;
++	no-sdio;
++	non-removable;
++	pinctrl-names = "default", "state_uhs";
++	pinctrl-0 = <&mmc0_pins_default>;
++	pinctrl-1 = <&mmc0_pins_uhs>;
++	vmmc-supply = <&reg_3p3v>;
++	vqmmc-supply = <&reg_1p8v>;
++	status = "okay";
++};
++
++&pio {
++	mmc0_pins_default: mmc0-pins-default {
++		mux {
++			function = "emmc";
++			groups = "emmc_51";
++		};
++		conf-cmd-dat {
++			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
++			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
++			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
++			input-enable;
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;
++		};
++		conf-clk {
++			pins = "EMMC_CK";
++			drive-strength = <6>;
++			mediatek,pull-down-adv = <2>;
++		};
++		conf-ds {
++			pins = "EMMC_DSL";
++			mediatek,pull-down-adv = <2>;
++		};
++		conf-rst {
++			pins = "EMMC_RSTB";
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;
++		};
++	};
++
++	mmc0_pins_uhs: mmc0-uhs-pins {
++		mux {
++			function = "emmc";
++			groups = "emmc_51";
++		};
++		conf-cmd-dat {
++			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
++			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
++			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
++			input-enable;
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;
++		};
++		conf-clk {
++			pins = "EMMC_CK";
++			drive-strength = <6>;
++			mediatek,pull-down-adv = <2>;
++		};
++		conf-ds {
++			pins = "EMMC_DSL";
++			mediatek,pull-down-adv = <2>;
++		};
++		conf-rst {
++			pins = "EMMC_RSTB";
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;
++		};
++	};
++
++	wf_2g_5g_pins: wf-2g-5g-pins {
++		mux {
++			function = "wifi";
++			groups = "wf_2g", "wf_5g";
++		};
++		conf {
++			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
++			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
++			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
++			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
++			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
++			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
++			       "WF1_TOP_CLK", "WF1_TOP_DATA";
++			drive-strength = <4>;
++		};
++	};
++};
++
++&switch {
++	ports {
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		port@1 {
++			reg = <1>;
++			label = "lan1";
++		};
++
++		port@2 {
++			reg = <2>;
++			label = "lan2";
++		};
++
++		port@3 {
++			reg = <3>;
++			label = "lan3";
++		};
++
++		port@4 {
++			reg = <4>;
++			label = "lan4";
++		};
++
++		port@6 {
++			reg = <6>;
++			ethernet = <&gmac0>;
++			phy-mode = "2500base-x";
++
++			fixed-link {
++				speed = <2500>;
++				full-duplex;
++				pause;
++			};
++		};
++	};
++};
++
++&trng {
++	status = "okay";
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
++
++&wifi {
++	pinctrl-names = "default";
++	pinctrl-0 = <&wf_2g_5g_pins>;
++	status = "okay";
++};
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+index b86c376d74176..47e7be971e7bb 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -24,6 +24,7 @@ mediatek_setup_interfaces()
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
+ 		;;
+ 	asus,tuf-ax4200|\
++	jdcloud,re-cp-03|\
+ 	mediatek,mt7981-rfb|\
+ 	zbtlink,zbt-z8102ax)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
+@@ -135,6 +136,11 @@ mediatek_setup_macs()
+ 		lan_mac=$(macaddr_add "$wan_mac" 1)
+ 		label_mac=$wan_mac
+ 		;;
++	jdcloud,re-cp-03)
++		wan_mac=$(mmc_get_mac_binary factory 0x2a)
++		lan_mac=$(mmc_get_mac_binary factory 0x24)
++		label_mac=$lan_mac
++		;;
+ 	mercusys,mr90x-v1)
+ 		label_mac=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
+ 		lan_mac=$label_mac
+diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
+index cbbf1871a5d69..22ab26608f8ab 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
+@@ -55,7 +55,8 @@ case "$FIRMWARE" in
+ 	;;
+ "mediatek/mt7986_eeprom_mt7976_dual.bin")
+ 	case "$board" in
+-	glinet,gl-mt6000)
++	glinet,gl-mt6000|\
++	jdcloud,re-cp-03)
+ 		caldata_extract_mmc "factory" 0x0 0x1000
+ 		;;
+ 	esac
+diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+index d9e0335b67f3b..937d39066c0fd 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+@@ -80,6 +80,9 @@ case "$board" in
+ 		# addresses on multiple VIFs with the other radio. Use label mac to set LA bit.
+ 		[ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress
+ 		;;
++	jdcloud,re-cp-03)
++		[ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress
++		;;
+ 	mercusys,mr90x-v1)
+ 		addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
+ 		[ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
+diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+index 517f4520e143c..97c09f35a8302 100755
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -134,6 +134,10 @@ platform_do_upgrade() {
+ 		CI_KERNPART="fit"
+ 		nand_do_upgrade "$1"
+ 		;;
++	jdcloud,re-cp-03)
++		CI_KERNPART="production"
++		emmc_do_upgrade "$1"
++		;;
+ 	mercusys,mr90x-v1)
+ 		CI_UBIPART="ubi0"
+ 		nand_do_upgrade "$1"
+@@ -200,6 +204,7 @@ platform_copy_config() {
+ 	acer,predator-w6|\
+ 	glinet,gl-mt2500|\
+ 	glinet,gl-mt6000|\
++	jdcloud,re-cp-03|\
+ 	ubnt,unifi-6-plus)
+ 		emmc_copy_config
+ 		;;
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index d0c9907635fb3..8a8879ca32b0d 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -450,6 +450,17 @@ define Device/jcg_q30-pro
+ endef
+ TARGET_DEVICES += jcg_q30-pro
+ 
++define Device/jdcloud_re-cp-03
++  DEVICE_VENDOR := JDCloud
++  DEVICE_MODEL := AX6000 Baili(RE-CP-03)
++  DEVICE_DTS := mt7986a-jdcloud-re-cp-03
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware \
++	e2fsprogs f2fsck mkf2fs losetup kmod-mmc kmod-nls-cp437 kmod-nls-iso8859-1 blkid blockdev
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += jdcloud_re-cp-03
++
+ define Device/mediatek_mt7981-rfb
+   DEVICE_VENDOR := MediaTek
+   DEVICE_MODEL := MT7981 rfb

+ 279 - 0
devices/mediatek_filogic/patches/11-gl-mt2500.patch

@@ -0,0 +1,279 @@
+From 12396686484a488dff1c4a1ee8b5197c552572fe Mon Sep 17 00:00:00 2001
+From: David Bauer <[email protected]>
+Date: Thu, 20 Apr 2023 19:49:55 +0200
+Subject: [PATCH] mediatek: add support for GL.iNet GL-MT2500
+
+Hardware
+--------
+SoC:  MediaTek MT7981BA
+RAM:  1GB DDR4 (NANYA NT5AD512M16C4-JR)
+MMC:  8GB eMMC (Samsung 8GTF4R)
+ETH:  1000Base-T LAN (ePHY)
+      2500Base-T WAN (MaxLinear GPY211C)
+BTN:  1x Reset Button
+LED:  System (blue/white)
+      VPN (white)
+USB:  1x USB-A (USB 3.0)
+UART: 115200 8N1 - Pinout on board next to LAN port
+      Don't connect 3.3V!
+
+Known Issues
+------------
+U-Boot vendor recovery does not seem to accept any images, neither
+GL.iNet images nor OpenWrt images. Recovery requires serial access!
+
+Installation
+------------
+Upload the OpenWrt sysupgrade image to the Gl.iNet Web-UI. Make sure to
+not retain existing settings.
+
+Signed-off-by: David Bauer <[email protected]>
+---
+ .../uboot-envtools/files/mediatek_filogic     |   4 +
+ .../mediatek/dts/mt7981b-glinet-gl-mt2500.dts | 151 ++++++++++++++++++
+ .../filogic/base-files/etc/board.d/02_network |   6 +
+ .../base-files/lib/upgrade/platform.sh        |   2 +
+ target/linux/mediatek/image/filogic.mk        |  17 ++
+ 5 files changed, 180 insertions(+)
+ create mode 100644 target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts
+
+diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic
+index ae8e1589a024b..4d37828f1db95 100644
+--- a/package/boot/uboot-envtools/files/mediatek_filogic
++++ b/package/boot/uboot-envtools/files/mediatek_filogic
+@@ -74,6 +74,10 @@ xiaomi,redmi-router-ax6000-ubootmod)
+ 	ubootenv_add_uci_config "$envdev" "0x0" "0x1f000" "0x20000" "1"
+ 	ubootenv_add_uci_config "$envdev2" "0x0" "0x1f000" "0x20000" "1"
+ 	;;
++glinet,gl-mt2500)
++	local envdev=$(find_mmc_part "u-boot-env")
++	ubootenv_add_uci_config "$envdev" "0x400000" "0x80000"
++	;;
+ glinet,gl-mt3000)
+ 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
+ 	;;
+diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts
+new file mode 100644
+index 0000000000000..068dd0f236e28
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts
+@@ -0,0 +1,151 @@
++// SPDX-License-Identifier: (GPL-2.0 OR MIT)
++
++/dts-v1/;
++#include "mt7981.dtsi"
++
++/ {
++	model = "GL.iNet GL-MT2500";
++	compatible = "glinet,gl-mt2500", "mediatek,mt7981";
++
++	aliases {
++		label-mac-device = &gmac0;
++		led-boot = &led_sys_white;
++		led-failsafe = &led_sys_blue;
++		led-running = &led_sys_white;
++		led-upgrade = &led_sys_blue;
++		serial0 = &uart0;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++		bootargs-append = " root=PARTLABEL=rootfs rootwait";
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led-vpn {
++			label = "white:vpn";
++			gpios = <&pio 31 GPIO_ACTIVE_LOW>;
++		};
++
++		led_sys_white: led-system-white {
++			label = "white:system";
++			gpios = <&pio 30 GPIO_ACTIVE_LOW>;
++		};
++
++		led_sys_blue: led-system-blue {
++			label = "blue:system";
++			gpios = <&pio 29 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	usb_vbus: regulstor-usb {
++		compatible = "regulator-fixed";
++
++		regulator-name = "usb-vbus";
++		regulator-min-microvolt = <5000000>;
++		regulator-max-microvolt = <5000000>;
++
++		gpio = <&pio 12 GPIO_ACTIVE_HIGH>;
++		enable-active-high;
++		regulator-boot-on;
++	};
++
++	reg_3p3v: regulator-3p3v {
++		compatible = "regulator-fixed";
++		regulator-name = "fixed-3.3V";
++		regulator-min-microvolt = <3300000>;
++		regulator-max-microvolt = <3300000>;
++		regulator-boot-on;
++		regulator-always-on;
++	};
++};
++
++&pio {
++	mmc0_pins_default: mmc0-pins-default {
++		mux {
++			function = "flash";
++			groups = "emmc_45";
++		};
++	};
++	mmc0_pins_uhs: mmc0-pins-uhs {
++		mux {
++			function = "flash";
++			groups = "emmc_45";
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
++
++&eth {
++	status = "okay";
++
++	pinctrl-names = "default";
++	pinctrl-0 = <&mdio_pins>;
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++
++		phy-mode = "2500base-x";
++		phy-handle = <&phy5>;
++	};
++
++	gmac1: mac@1 {
++		compatible = "mediatek,eth-mac";
++		reg = <1>;
++		phy-mode = "gmii";
++		phy-handle = <&int_gbe_phy>;
++	};
++};
++
++&mdio_bus {
++	reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>;
++	reset-delay-us = <600>;
++	reset-post-delay-us = <20000>;
++
++	phy5: ethernet-phy@5 {
++		reg = <5>;
++		compatible = "ethernet-phy-ieee802.3-c45";
++	};
++};
++
++&usb_phy {
++	status = "okay";
++};
++
++&xhci {
++	status = "okay";
++	vbus-supply = <&usb_vbus>;
++};
++
++&mmc0 {
++	status = "okay";
++
++	pinctrl-names = "default", "state_uhs";
++	pinctrl-0 = <&mmc0_pins_default>;
++	pinctrl-1 = <&mmc0_pins_uhs>;
++	bus-width = <8>;
++	max-frequency = <52000000>;
++	vmmc-supply = <&reg_3p3v>;
++	cap-mmc-highspeed;
++	non-removable;
++};
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+index 5153c156f65bd..0675e87853ac7 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -32,6 +32,7 @@ mediatek_setup_interfaces()
+ 	h3c,magic-nx30-pro)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
+ 		;;
++	glinet,gl-mt2500|\
+ 	glinet,gl-mt3000)
+ 		ucidef_set_interfaces_lan_wan eth1 eth0
+ 		;;
+@@ -109,6 +110,11 @@ mediatek_setup_macs()
+ 		;;
+ 		esac
+ 		;;
++	glinet,gl-mt2500)
++		label_mac="$(get_mac_binary "/dev/mmcblk0boot1" 0xA)"
++		wan_mac="$label_mac"
++		lan_mac="$(macaddr_add $label_mac 1)"
++		;;
+ 	glinet,gl-mt6000)
+ 		label_mac=$(mmc_get_mac_binary factory 0x0a)
+ 		wan_mac=$label_mac
+diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+index 3c278d5faf2c4..6130768cb4c66 100755
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -97,6 +97,7 @@ platform_do_upgrade() {
+ 	cudy,wr3000-v1)
+ 		default_do_upgrade "$1"
+ 		;;
++	glinet,gl-mt2500|\
+ 	glinet,gl-mt6000)
+ 		CI_KERNPART="kernel"
+ 		CI_ROOTPART="rootfs"
+@@ -176,6 +177,7 @@ platform_copy_config() {
+ 			;;
+ 		esac
+ 		;;
++	glinet,gl-mt2500|\
+ 	glinet,gl-mt6000|\
+ 	ubnt,unifi-6-plus)
+ 		emmc_copy_config
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index 4886db11419e5..a0a5f944a8f69 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -274,6 +274,19 @@ define Device/cudy_wr3000-v1
+ endef
+ TARGET_DEVICES += cudy_wr3000-v1
+ 
++define Device/glinet_gl-mt2500
++  DEVICE_VENDOR := GL.iNet
++  DEVICE_MODEL := GL-MT2500
++  DEVICE_DTS := mt7981b-glinet-gl-mt2500
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_DTS_LOADADDR := 0x47000000
++  DEVICE_PACKAGES := -kmod-mt7915e -wpad-basic-mbedtls e2fsprogs f2fsck mkf2fs kmod-usb3
++  SUPPORTED_DEVICES += glinet,mt2500-emmc
++  IMAGES := sysupgrade.bin
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-gl-metadata
++endef
++TARGET_DEVICES += glinet_gl-mt2500
++
+ define Device/glinet_gl-mt3000
+   DEVICE_VENDOR := GL.iNet
+   DEVICE_MODEL := GL-MT3000

+ 365 - 0
devices/mediatek_filogic/patches/12-asr3000.patch

@@ -0,0 +1,365 @@
+From 02f7ea25d6612180b3a97b688d6e69cfe7af2f0d Mon Sep 17 00:00:00 2001
+From: Tianling Shen <[email protected]>
+Date: Thu, 19 Oct 2023 15:14:45 +0800
+Subject: [PATCH] mediatek: add ABT ASR3000 support
+
+Signed-off-by: Tianling Shen <[email protected]>
+---
+ .../dts/mt7981b-abt-asr3000.dts      | 267 ++++++++++++++++++
+ .../filogic/base-files/etc/board.d/01_leds    |   5 +
+ .../filogic/base-files/etc/board.d/02_network |  17 +-
+ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac   |   5 +
+ target/linux/mediatek/image/filogic.mk        |  21 ++
+ 5 files changed, 307 insertions(+), 8 deletions(-)
+ create mode 100644 target/linux/mediatek/dts/mt7981b-abt-asr3000.dts
+
+diff --git a/target/linux/mediatek/dts/mt7981b-abt-asr3000.dts b/target/linux/mediatek/dts/mt7981b-abt-asr3000.dts
+new file mode 100644
+index 00000000000..605721f2d08
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7981b-abt-asr3000.dts
+@@ -0,0 +1,268 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright (C) 2023 Tianling Shen <[email protected]>
++ */
++
++/dts-v1/;
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++
++#include "mt7981.dtsi"
++
++/ {
++	model = "ABT ASR3000 (custom U-Boot layout)";
++	compatible = "abt,asr3000", "mediatek,mt7981";
++
++	aliases {
++		led-boot = &mesh_led;
++		led-failsafe = &mesh_led;
++		led-upgrade = &mesh_led;
++		serial0 = &uart0;
++		label-mac-device = &gmac1;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++	};
++
++	memory {
++		reg = <0 0x40000000 0 0x10000000>;
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		button-reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
++		};
++
++		button-mesh {
++			label = "mesh";
++			linux,code = <BTN_9>;
++			linux,input-type = <EV_SW>;
++			gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
++		};
++	};
++
++	gpio-leds {
++		compatible = "gpio-leds";
++
++		led-0 {
++			label = "red:wan";
++			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
++		};
++
++		led-1 {
++			label = "green:wan";
++			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
++		};
++
++		mesh_led: led-2 {
++			label = "green:mesh";
++			gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
++		};
++
++		led-3 {
++			label = "green:wlan2g";
++			gpios = <&pio 34 GPIO_ACTIVE_LOW>;
++		};
++
++		led-4 {
++			label = "green:wlan5g";
++			gpios = <&pio 35 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&eth {
++	pinctrl-names = "default";
++	pinctrl-0 = <&mdio_pins>;
++
++	status = "okay";
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++		phy-mode = "2500base-x";
++
++		nvmem-cells = <&macaddr_art_0 0>;
++		nvmem-cell-names = "mac-address";
++
++		fixed-link {
++			speed = <2500>;
++			full-duplex;
++			pause;
++		};
++	};
++
++	gmac1: mac@1 {
++		compatible = "mediatek,eth-mac";
++		reg = <1>;
++		phy-mode = "gmii";
++		phy-handle = <&int_gbe_phy>;
++
++		nvmem-cells = <&macaddr_art_0 0>;
++		nvmem-cell-names = "mac-address";
++	};
++};
++
++&mdio_bus {
++	switch: switch@0 {
++		compatible = "mediatek,mt7531";
++		reg = <31>;
++		reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
++		interrupt-controller;
++		#interrupt-cells = <1>;
++		interrupt-parent = <&pio>;
++		interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
++	};
++};
++
++&spi0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi0_flash_pins>;
++	status = "okay";
++
++	spi_nand: flash@0 {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		compatible = "spi-nand";
++		reg = <0>;
++		spi-max-frequency = <52000000>;
++
++		spi-cal-enable;
++		spi-cal-mode = "read-data";
++		spi-cal-datalen = <7>;
++		spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
++		spi-cal-addrlen = <5>;
++		spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
++
++		spi-tx-bus-width = <4>;
++		spi-rx-bus-width = <4>;
++		mediatek,nmbm;
++		mediatek,bmt-max-ratio = <1>;
++		mediatek,bmt-max-reserved-blocks = <64>;
++
++		partitions: partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "BL2";
++				reg = <0x00000 0x100000>;
++				read-only;
++			};
++
++			partition@100000 {
++				label = "u-boot-env";
++				reg = <0x100000 0x80000>;
++			};
++
++			partition@180000 {
++				label = "art";
++				reg = <0x180000 0x100000>;
++				read-only;
++
++				compatible = "nvmem-cells";
++				nvmem-layout {
++					compatible = "fixed-layout";
++					#address-cells = <1>;
++					#size-cells = <1>;
++
++					macaddr_art_0: macaddr@0 {
++						compatible = "mac-base";
++						reg = <0x0 0x6>;
++						#nvmem-cell-cells = <1>;
++					};
++				};
++			};
++
++			factory: partition@280000 {
++				label = "Factory";
++				reg = <0x280000 0x100000>;
++			};
++
++			partition@380000 {
++				label = "FIP";
++				reg = <0x380000 0x200000>;
++			};
++
++			partition@580000 {
++				label = "ubi";
++				reg = <0x580000 0x6e80000>;
++			};
++		};
++	};
++};
++
++&switch {
++	ports {
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		port@0 {
++			reg = <0>;
++			label = "lan1";
++		};
++
++		port@1 {
++			reg = <1>;
++			label = "lan2";
++		};
++
++		port@2 {
++			reg = <2>;
++			label = "lan3";
++		};
++
++		port@6 {
++			reg = <6>;
++			ethernet = <&gmac0>;
++			phy-mode = "2500base-x";
++
++			fixed-link {
++				speed = <2500>;
++				full-duplex;
++				pause;
++			};
++		};
++	};
++};
++
++&pio {
++	spi0_flash_pins: spi0-pins {
++		mux {
++			function = "spi";
++			groups = "spi0", "spi0_wp_hold";
++		};
++
++		conf-pu {
++			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
++			drive-strength = <MTK_DRIVE_8mA>;
++			bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
++		};
++
++		conf-pd {
++			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
++			drive-strength = <MTK_DRIVE_8mA>;
++			bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
++
++&wifi {
++	status = "okay";
++
++	mediatek,mtd-eeprom = <&factory 0x0>;
++};
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+index 2e978be6804bf..429c6f359fed4 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -34,6 +34,7 @@ mediatek_setup_interfaces()
+ 	bananapi,bpi-r3)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
+ 		;;
++	abt,asr3000|\
+ 	cmcc,rax3000m*|\
+ 	h3c,magic-nx30-pro)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+index 3d625a820d6..9290afe4c31 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+@@ -6,6 +6,11 @@ board=$(board_name)
+ board_config_update
+ 
+ case $board in
++abt,asr3000)
++	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
++	ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wlan2g" "phy0-ap0"
++	ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wlan5g" "phy1-ap0"
++	;;
+ confiabits,mt7981)
+ 	ucidef_set_led_netdev "lan1" "lan1" "blue:lan-1" "lan1" "link tx rx"
+ 	ucidef_set_led_netdev "lan2" "lan2" "blue:lan-2" "lan2" "link tx rx"
+diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+index 6a513c74fb9..f586edf525f 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+@@ -10,6 +10,11 @@ PHYNBR=${DEVPATH##*/phy}
+ board=$(board_name)
+ 
+ case "$board" in
++	abt,asr3000)
++		addr=$(get_mac_label)
++		[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
++		[ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
++		;;
+ 	acer,predator-w6)
+ 		key_path="/var/qcidata/data"
+ 		[ "$PHYNBR" = "0" ] && cat $key_path/2gMAC > /sys${DEVPATH}/macaddress
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index 95aee51b689..7f28be90a7b 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -105,6 +105,27 @@ define Build/cetron-header
+ 	rm [email protected]
+ endef
+ 
++define Device/abt_asr3000
++  DEVICE_VENDOR := ABT
++  DEVICE_MODEL := ASR3000
++  DEVICE_DTS := mt7981b-abt-asr3000
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  IMAGE_SIZE := 113152k
++  KERNEL_IN_UBI := 1
++  IMAGES += factory.bin
++  IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++  KERNEL = kernel-bin | lzma | \
++	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
++  KERNEL_INITRAMFS = kernel-bin | lzma | \
++	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
++endef
++TARGET_DEVICES += abt_asr3000
++
+ define Device/asus_tuf-ax4200
+   DEVICE_VENDOR := ASUS
+   DEVICE_MODEL := TUF-AX4200

+ 404 - 0
devices/mediatek_filogic/patches/13-rg-x60-pro.patch

@@ -0,0 +1,404 @@
+From 0cf380b2ca1002f4a73d3626322ee5a7a5cf7628 Mon Sep 17 00:00:00 2001
+From: Ashley Lee <[email protected]>
+Date: Sat, 30 Dec 2023 22:54:54 +0800
+Subject: [PATCH] mediatek: add support for Ruijie RG-X60 Pro
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This pull request ports Ruijie RG-X60 Pro router support to the main branch.
+
+Parameters:
+- SoC       : MediaTek MT7986A Quad-core ARM Cortex-A53 2.0GHz
+- RAM       : DDR3 512MiB (W634GU6QB)
+- Flash     : SPI-NAND 128 MiB (W25N01GVZEIG)
+- WLAN      : MediaTek MT7986A integration dual-band WiFi 6
+  - 2.4 GHz : b/g/n/ax, MIMO 4x4
+  - 5 GHz   : a/n/ac/ax, MIMO 4x4
+- Ethernet  : 10/100/1000 Mbps x4 (MediaTek MT7531AE)
+                    2500Mbps x 1 (Realtek RTL8221B-VB-CG)
+- UART      : through-hole on PCB
+  - [J500] GND, TX, RX, 3.3V (115200n1)
+- Buttons   : Mesh, Reset
+- LEDs      : 1x Power (Blue)
+                  1x Turbo (Purple)
+- Power     : 12 VDC, 3 A
+
+How to Installation:
+1. Remove the case and connect the TTL cable to the corresponding position.
+2. Power on the device and quickly press "down" on the keyboard, then
+   U-Boot will stay in the menu.
+3. Select "1. Upgrade Firmware", select "0. TFTP Client(Default)".
+4. Input the IP address, input the Openwrt image file name to be
+   flashed, start the TFTP server, and press "Enter".
+5. Wait for the flashing to complete.
+
+How return to stock:
+
+1. Remove the case and connect the TTL cable to the corresponding
+   position.
+2. Power on the device and quickly press "down" on the keyboard, then
+   U-Boot will stay in the menu.
+3. Select "1. Upgrade Firmware", select "0. TFTP Client(Default)".
+4. Input the IP address, input the Stock “E-WEBOS” image file name to
+   be flashed, start the TFTP server, and press "Enter".
+5. Wait for the flashing to complete.
+
+About recovery:
+Connect uart, use u-boot menu to flash stock firmware image or boot
+OpenWrt initramfs image.
+
+About MAC Address:
++---------+-------------------+-----------+
+|         | MAC               | Algorithm |
++---------+-------------------+-----------+
+| WAN     | 10:82:3D:XX:XX:9E | label     |
+| LAN     | 10:82:3D:XX:XX:9F | label+1   |
+| WLAN 2g | 10:82:3D:XX:XX:A0 | label+2   |
+| WLAN 5g | 10:82:3D:XX:XX:A1 | label+3   |
++---------+-------------------+-----------+
+
+Signed-off-by: Ashley Lee <[email protected]>
+---
+ .../dts/mt7986a-ruijie-rg-x60-pro.dts         | 280 ++++++++++++++++++
+ .../filogic/base-files/etc/board.d/02_network |   6 +
+ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac   |   5 +
+ target/linux/mediatek/image/filogic.mk        |  10 +
+ 4 files changed, 301 insertions(+)
+ create mode 100644 target/linux/mediatek/dts/mt7986a-ruijie-rg-x60-pro.dts
+
+diff --git a/target/linux/mediatek/dts/mt7986a-ruijie-rg-x60-pro.dts b/target/linux/mediatek/dts/mt7986a-ruijie-rg-x60-pro.dts
+new file mode 100644
+index 0000000000000..80b614ac2282d
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7986a-ruijie-rg-x60-pro.dts
+@@ -0,0 +1,268 @@
++// SPDX-License-Identifier: (GPL-2.0 OR MIT)
++
++/dts-v1/;
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
++
++#include "mt7986a.dtsi"
++
++/ {
++	model = "Ruijie RG-X60 Pro";
++	compatible = "ruijie,rg-x60-pro", "mediatek,mt7986a";
++
++	aliases {
++		serial0 = &uart0;
++		led-boot = &led_system;
++		led-failsafe = &led_alarm;
++		led-running = &led_system;
++		led-upgrade = &led_alarm;
++	};
++
++	chosen {
++		bootargs = "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0x11002000";
++	};
++
++	memory {
++		reg = <0 0x40000000 0 0x20000000>;
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
++			linux,code = <KEY_RESTART>;
++		};
++
++		mesh {
++			label = "mesh";
++			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
++			linux,code = <BTN_MISC>;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led_alarm: status_purple {
++			label = "purple:status";
++			gpios = <&pio 11 GPIO_ACTIVE_LOW>;
++		};
++
++		led_system: status_white {
++			label = "white:status";
++			gpios = <&pio 22 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&eth {
++	status = "okay";
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++		phy-mode = "2500base-x";
++
++		fixed-link {
++			speed = <2500>;
++			full-duplex;
++			pause;
++		};
++	};
++
++	gmac1: mac@1 {
++		compatible = "mediatek,eth-mac";
++		reg = <1>;
++		phy-handle = <&phy7>;
++		phy-mode = "2500base-x";
++	};
++
++	mdio: mdio-bus {
++		#address-cells = <1>;
++		#size-cells = <0>;
++	};
++};
++
++&mdio {
++	switch: switch@1f {
++		compatible = "mediatek,mt7531";
++		reg = <31>;
++		reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
++		interrupt-controller;
++		#interrupt-cells = <1>;
++		interrupt-parent = <&pio>;
++		interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
++	};
++
++	phy7: phy@7 {
++		compatible = "ethernet-phy-ieee802.3-c45";
++		reg = <7>;
++		reset-assert-us = <100000>;
++		reset-deassert-us = <100000>;
++		reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
++		realtek,aldps-enable;
++	};
++};
++
++&pio {
++	spi_flash_pins: spi-flash-pins-33-to-38 {
++		mux {
++			function = "spi";
++			groups = "spi0", "spi0_wp_hold";
++		};
++		conf-pu {
++			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
++			drive-strength = <8>;
++			mediatek,pull-up-adv = <0>; /* bias-disable */
++		};
++		conf-pd {
++			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
++			drive-strength = <8>;
++			mediatek,pull-down-adv = <0>; /* bias-disable */
++		};
++	};
++
++	wf_2g_5g_pins: wf_2g_5g-pins {
++		mux {
++			function = "wifi";
++			groups = "wf_2g", "wf_5g";
++		};
++		conf {
++			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
++			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
++			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
++			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
++			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
++			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
++			       "WF1_TOP_CLK", "WF1_TOP_DATA";
++			drive-strength = <4>;
++		};
++	};
++};
++
++&spi0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi_flash_pins>;
++	status = "okay";
++
++	flash@0 {
++		compatible = "spi-nand";
++		#address-cells = <1>;
++		#size-cells = <1>;
++		reg = <0>;
++
++		spi-max-frequency = <20000000>;
++		spi-tx-bus-width = <4>;
++		spi-rx-bus-width = <4>;
++
++		mediatek,nmbm;
++		mediatek,bmt-max-ratio = <1>;
++		mediatek,bmt-max-reserved-blocks = <64>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "BL2";
++				reg = <0x000000 0x100000>;
++				read-only;
++			};
++
++			partition@100000 {
++				label = "u-boot-env";
++				reg = <0x100000 0x80000>;
++				read-only;
++			};
++
++			factory: partition@180000 {
++				label = "Factory";
++				reg = <0x180000 0x200000>;
++				read-only;
++			};
++
++			partition@380000 {
++				label = "FIP";
++				reg = <0x380000 0x200000>;
++				read-only;
++			};
++
++			partition@580000 {
++				label = "product_info";
++				reg = <0x580000 0x80000>;
++				read-only;
++			};
++
++			partition@600000 {
++				label = "kdump";
++				reg = <0x600000 0x80000>;
++				read-only;
++			};
++
++			partition@680000 {
++				label = "ubi";
++				reg = <0x680000 0x3f00000>;
++			};
++		};
++	};
++};
++
++&switch {
++	ports {
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		port@0 {
++			reg = <0>;
++			label = "lan1";
++		};
++
++		port@1 {
++			reg = <1>;
++			label = "lan2";
++		};
++
++		port@2 {
++			reg = <2>;
++			label = "lan3";
++		};
++
++		port@3 {
++			reg = <3>;
++			label = "lan4";
++		};
++
++		port@6 {
++			reg = <6>;
++			label = "cpu";
++			ethernet = <&gmac0>;
++			phy-mode = "2500base-x";
++
++			fixed-link {
++				speed = <2500>;
++				full-duplex;
++				pause;
++			};
++		};
++	};
++};
++
++&wifi {
++	status = "okay";
++	pinctrl-names = "default";
++	pinctrl-0 = <&wf_2g_5g_pins>;
++
++	mediatek,mtd-eeprom = <&factory 0x0>;
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+index b86c376d74176..28e5f26958567 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -26,6 +26,7 @@
+ 	asus,tuf-ax4200|\
+ 	jdcloud,re-cp-03|\
+ 	mediatek,mt7981-rfb|\
++	ruijie,rg-x60-pro|\
+ 	zbtlink,zbt-z8102ax)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
+ 		;;
+@@ -150,6 +151,11 @@
+ 		wan_mac=$(macaddr_add "$lan_mac" 1)
+ 		label_mac=$wan_mac
+ 		;;
++	ruijie,rg-x60-pro)
++		label_mac=$(mtd_get_mac_ascii product_info ethaddr)
++		wan_mac=$label_mac
++		lan_mac=$(macaddr_add "$label_mac" 1)
++		;;
+ 	xiaomi,mi-router-ax3000t|\
+ 	xiaomi,mi-router-wr30u-112m-nmbm|\
+ 	xiaomi,mi-router-wr30u-stock|\
+diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+index d9e0335b67f3b..0e6c3c1dbcb56 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+@@ -104,6 +104,11 @@
+ 		[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
+ 		[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
+ 		;;
++	ruijie,rg-x60-pro)
++		addr=$(mtd_get_mac_ascii product_info ethaddr)
++		[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
++		[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
++		;;
+ 	tplink,tl-xdr4288|\
+ 	tplink,tl-xdr6086|\
+ 	tplink,tl-xdr6088)
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index d0c9907635fb3..3bd6b3e1303e5 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -674,6 +674,16 @@ define Device/routerich_ax3000
+ endef
+ TARGET_DEVICES += routerich_ax3000
+ 
++define Device/ruijie_rg-x60-pro
++  DEVICE_VENDOR := Ruijie
++  DEVICE_MODEL := RG-X60 Pro
++  DEVICE_DTS := mt7986a-ruijie-rg-x60-pro
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += ruijie_rg-x60-pro
++
+ define Device/tplink_tl-xdr-common
+   DEVICE_VENDOR := TP-Link
+   DEVICE_DTS_DIR := ../dts

+ 359 - 0
devices/mediatek_filogic/patches/14-netcore-n60.patch

@@ -0,0 +1,359 @@
+From a8ddfc2e1025e2f35099b8757c7cf581cc87716b Mon Sep 17 00:00:00 2001
+From: aiamadeus <[email protected]>
+Date: Wed, 1 Nov 2023 20:25:18 +0800
+Subject: [PATCH] mediatek: add Netcore N60 support
+
+Connect to the router using ssh or telnet,
+username: useradmin, password is the web
+login password of the router.
+
+Signed-off-by: AnYun <[email protected]>
+---
+ .../mediatek/dts/mt7986a-netcore-n60.dts      | 284 ++++++++++++++++++
+ .../filogic/base-files/etc/board.d/02_network |   3 +-
+ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac   |   3 +-
+ target/linux/mediatek/image/filogic.mk        |  14 +
+ 4 files changed, 302 insertions(+), 2 deletions(-)
+ create mode 100644 target/linux/mediatek/dts/mt7986a-netcore-n60.dts
+
+diff --git a/target/linux/mediatek/dts/mt7986a-netcore-n60.dts b/target/linux/mediatek/dts/mt7986a-netcore-n60.dts
+new file mode 100644
+index 0000000000000..4cbd9bdf0deb9
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7986a-netcore-n60.dts
+@@ -0,0 +1,284 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++/dts-v1/;
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++
++#include "mt7986a.dtsi"
++
++/ {
++	model = "Netcore N60";
++	compatible = "netcore,n60", "mediatek,mt7986a";
++
++	aliases {
++		serial0 = &uart0;
++		label-mac-device = &gmac0;
++		led-boot = &led_status_red;
++		led-failsafe = &led_status_red;
++		led-running = &led_status_blue;
++		led-upgrade = &led_status_blue;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++	};
++
++	memory {
++		reg = <0 0x40000000 0 0x10000000>;
++	};
++
++	keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
++		};
++
++		mesh {
++			label = "mesh";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led_status_red: status_red {
++			label = "red:status";
++			gpios = <&pio 29 GPIO_ACTIVE_LOW>;
++		};
++
++		led_status_blue: status_blue {
++			label = "blue:status";
++			gpios = <&pio 32 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&crypto {
++	status = "okay";
++};
++
++&eth {
++	status = "okay";
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++		phy-mode = "2500base-x";
++
++		nvmem-cells = <&macaddr_lan>;
++		nvmem-cell-names = "mac-address";
++
++		fixed-link {
++			speed = <2500>;
++			full-duplex;
++			pause;
++		};
++	};
++
++	gmac1: mac@1 {
++		compatible = "mediatek,eth-mac";
++		reg = <1>;
++		phy-handle = <&phy6>;
++		phy-mode = "2500base-x";
++
++		nvmem-cells = <&macaddr_wan>;
++		nvmem-cell-names = "mac-address";
++	};
++
++	mdio: mdio-bus {
++		#address-cells = <1>;
++		#size-cells = <0>;
++	};
++};
++
++&mdio {
++	reset-delay-us = <600>;
++	reset-post-delay-us = <20000>;
++	reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
++
++	phy6: phy@6 {
++		compatible = "ethernet-phy-ieee802.3-c45";
++		reg = <6>;
++		mxl,led-config = <0x0 0x0 0x0 0x3f0>;
++	};
++
++	switch: switch@0 {
++		compatible = "mediatek,mt7531";
++		reg = <31>;
++		reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
++		interrupt-controller;
++		#interrupt-cells = <1>;
++		interrupt-parent = <&pio>;
++		interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
++	};
++};
++
++&switch {
++	ports {
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		port@0 {
++			reg = <0>;
++			label = "lan1";
++		};
++
++		port@1 {
++			reg = <1>;
++			label = "lan2";
++		};
++
++		port@3 {
++			reg = <3>;
++			label = "lan3";
++		};
++
++		port@4 {
++			reg = <4>;
++			label = "lan4";
++		};
++
++		port@6 {
++			reg = <6>;
++			label = "cpu";
++			ethernet = <&gmac0>;
++			phy-mode = "2500base-x";
++
++			fixed-link {
++				speed = <2500>;
++				full-duplex;
++				pause;
++			};
++		};
++	};
++};
++
++&spi0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi_flash_pins>;
++	status = "okay";
++
++	flash@0 {
++		compatible = "spi-nand";
++		#address-cells = <1>;
++		#size-cells = <1>;
++		reg = <0>;
++
++		spi-max-frequency = <20000000>;
++		spi-tx-bus-width = <4>;
++		spi-rx-bus-width = <4>;
++
++		mediatek,nmbm;
++		mediatek,bmt-max-ratio = <1>;
++		mediatek,bmt-max-reserved-blocks = <64>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "BL2";
++				reg = <0x0000000 0x0100000>;
++				read-only;
++			};
++
++			partition@100000 {
++				label = "u-boot-env";
++				reg = <0x0100000 0x0080000>;
++			};
++
++			factory: partition@180000 {
++				label = "Factory";
++				reg = <0x0180000 0x0200000>;
++				read-only;
++			};
++
++			partition@380000 {
++				label = "FIP";
++				reg = <0x0380000 0x0200000>;
++				read-only;
++			};
++
++			partition@580000 {
++				label = "ubi";
++				reg = <0x0580000 0x7280000>;
++			};
++		};
++	};
++};
++
++&pio {
++	spi_flash_pins: spi-flash-pins-33-to-38 {
++		mux {
++			function = "spi";
++			groups = "spi0", "spi0_wp_hold";
++		};
++		conf-pu {
++			pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
++			drive-strength = <8>;
++			mediatek,pull-up-adv = <0>; /* bias-disable */
++		};
++		conf-pd {
++			pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
++			drive-strength = <8>;
++			mediatek,pull-down-adv = <0>; /* bias-disable */
++		};
++	};
++
++	wf_2g_5g_pins: wf_2g_5g-pins {
++		mux {
++			function = "wifi";
++			groups = "wf_2g", "wf_5g";
++		};
++		conf {
++			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
++			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
++			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
++			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
++			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
++			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
++			       "WF1_TOP_CLK", "WF1_TOP_DATA";
++			drive-strength = <4>;
++		};
++	};
++};
++
++&trng {
++	status = "okay";
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
++
++&wifi {
++	status = "okay";
++	pinctrl-names = "default";
++	pinctrl-0 = <&wf_2g_5g_pins>;
++
++	mediatek,mtd-eeprom = <&factory 0x0>;
++};
++
++&factory {
++	compatible = "nvmem-cells";
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	macaddr_lan: macaddr@1fef20 {
++		reg = <0x1fef20 0x6>;
++	};
++
++	macaddr_wan: macaddr@1fef26 {
++		reg = <0x1fef26 0x6>;
++	};
++};
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+index 6fa3a9218c629..b8ac6337bd15f 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -26,6 +26,7 @@
+ 	asus,tuf-ax4200|\
+ 	jdcloud,re-cp-03|\
+ 	mediatek,mt7981-rfb|\
++	netcore,n60|\
+ 	ruijie,rg-x60-pro|\
+ 	zbtlink,zbt-z8102ax)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
+diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+index 7f97e55f1f973..9e35c61434be3 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+@@ -34,7 +34,8 @@ case "$board" in
+ 		[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
+ 		[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
+ 		;;
+-	jcg,q30-pro)
++	jcg,q30-pro|\
++	netcore,n60)
+ 		# Originally, phy1 is phy0 mac with LA bit set. However, this would conflict
+ 		# addresses on multiple VIFs with the other radio. Use label mac to set LA bit.
+ 		[ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index ee29b1b5c6660..9cfd720e138df 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -273,6 +273,20 @@ define Device/mediatek_mt7986b-rfb
+ endef
+ TARGET_DEVICES += mediatek_mt7986b-rfb
+ 
++define Device/netcore_n60
++  DEVICE_VENDOR := Netcore
++  DEVICE_MODEL := N60
++  DEVICE_DTS := mt7986a-netcore-n60
++  DEVICE_DTS_DIR := ../dts
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  KERNEL_IN_UBI := 1
++  DEVICE_PACKAGES := kmod-mt7986-firmware mt7986-wo-firmware
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += netcore_n60
++
+ define Device/qihoo_360t7
+   DEVICE_VENDOR := Qihoo
+   DEVICE_MODEL := 360T7

+ 0 - 379
devices/mediatek_filogic/patches/7-jdcloud_re-cs-05.patch

@@ -1,379 +0,0 @@
-From 09d5ae78b47a9d893a570c1d5ef69cba5680565c Mon Sep 17 00:00:00 2001
-From: coolsnowwolf <[email protected]>
-Date: Thu, 16 Nov 2023 23:02:33 +0800
-Subject: [PATCH] mediatek: add support for JDCloud AX6000
-
----
- .../mediatek/dts/mt7986a-jdcloud-re-cs-05.dts | 281 ++++++++++++++++++
- .../filogic/base-files/etc/board.d/02_network |   6 +
- .../etc/hotplug.d/firmware/11-mt76-caldata    |   3 +-
- .../base-files/lib/preinit/81_fix_eeprom      |   3 +-
- .../base-files/lib/upgrade/platform.sh        |   6 +-
- 5 files changed, 295 insertions(+), 4 deletions(-)
- create mode 100644 target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts
-
-diff --git a/target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts
-new file mode 100644
-index 0000000000000..00b4c79c6bf8f
---- /dev/null
-+++ b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts
-@@ -0,0 +1,275 @@
-+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-+
-+/dts-v1/;
-+#include <dt-bindings/gpio/gpio.h>
-+#include <dt-bindings/input/input.h>
-+
-+#include "mt7986a.dtsi"
-+
-+/ {
-+	model = "JDCloud RE-CS-05";
-+	compatible = "jdcloud,re-cs-05", "mediatek,mt7986a";
-+
-+	aliases {
-+		serial0 = &uart0;
-+		led-boot = &led_status_green;
-+		led-failsafe = &led_status_red;
-+		led-running = &led_status_blue;
-+		led-upgrade = &led_status_red;
-+	};
-+
-+	chosen {
-+		stdout-path = "serial0:115200n8";
-+		bootargs = "console=ttyS0,115200n8 root=PARTLABEL=rootfs rootwait";
-+	};
-+
-+	keys {
-+		compatible = "gpio-keys";
-+
-+		reset {
-+			label = "reset";
-+			linux,code = <KEY_RESTART>;
-+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
-+		};
-+
-+		wps {
-+			label = "wps";
-+			linux,code = <KEY_WPS_BUTTON>;
-+			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
-+		};
-+	};
-+
-+	leds {
-+		compatible = "gpio-leds";
-+
-+		led_status_blue: blue {
-+			label = "blue:status";
-+			gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
-+		};
-+
-+		led_status_red: red {
-+			label = "red:status";
-+			gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
-+		};
-+
-+		led_status_green: green {
-+			label = "green:status";
-+			gpios = <&pio 12 GPIO_ACTIVE_LOW>;
-+		};
-+	};
-+
-+	reg_1p8v: regulator-1p8v {
-+		compatible = "regulator-fixed";
-+		regulator-name = "fixed-1.8V";
-+		regulator-min-microvolt = <1800000>;
-+		regulator-max-microvolt = <1800000>;
-+		regulator-boot-on;
-+		regulator-always-on;
-+	};
-+
-+	reg_3p3v: regulator-3p3v {
-+		compatible = "regulator-fixed";
-+		regulator-name = "fixed-3.3V";
-+		regulator-min-microvolt = <3300000>;
-+		regulator-max-microvolt = <3300000>;
-+		regulator-boot-on;
-+		regulator-always-on;
-+	};
-+};
-+
-+&crypto {
-+	status = "okay";
-+};
-+
-+&eth {
-+	status = "okay";
-+
-+	gmac0: mac@0 {
-+		compatible = "mediatek,eth-mac";
-+		reg = <0>;
-+		phy-mode = "2500base-x";
-+
-+		fixed-link {
-+			speed = <2500>;
-+			full-duplex;
-+			pause;
-+		};
-+	};
-+
-+	gmac1: mac@1 {
-+		compatible = "mediatek,eth-mac";
-+		reg = <1>;
-+		phy-handle = <&phy6>;
-+		phy-mode = "2500base-x";
-+	};
-+
-+	mdio: mdio-bus {
-+		#address-cells = <1>;
-+		#size-cells = <0>;
-+	};
-+};
-+
-+&mdio {
-+	phy6: ethernet-phy@6 {
-+		compatible = "ethernet-phy-ieee802.3-c45";
-+		reg = <6>;
-+		reset-assert-us = <100000>;
-+		reset-deassert-us = <100000>;
-+		reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
-+		realtek,aldps-enable;
-+	};
-+
-+	switch: switch@0 {
-+		compatible = "mediatek,mt7531";
-+		reg = <31>;
-+		reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
-+		interrupt-controller;
-+		#interrupt-cells = <1>;
-+		interrupt-parent = <&pio>;
-+		interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
-+	};
-+};
-+
-+&switch {
-+	ports {
-+		#address-cells = <1>;
-+		#size-cells = <0>;
-+
-+		port@1 {
-+			reg = <1>;
-+			label = "lan1";
-+		};
-+
-+		port@2 {
-+			reg = <2>;
-+			label = "lan2";
-+		};
-+
-+		port@3 {
-+			reg = <3>;
-+			label = "lan3";
-+		};
-+
-+		port@4 {
-+			reg = <4>;
-+			label = "lan4";
-+		};
-+
-+		port@6 {
-+			reg = <6>;
-+			ethernet = <&gmac0>;
-+			phy-mode = "2500base-x";
-+
-+			fixed-link {
-+				speed = <2500>;
-+				full-duplex;
-+				pause;
-+			};
-+		};
-+	};
-+};
-+
-+&mmc0 {
-+	pinctrl-names = "default", "state_uhs";
-+	pinctrl-0 = <&mmc0_pins_default>;
-+	pinctrl-1 = <&mmc0_pins_uhs>;
-+	bus-width = <8>;
-+	cap-mmc-highspeed;
-+	hs400-ds-delay = <0x14014>;
-+	max-frequency = <200000000>;
-+	mmc-hs200-1_8v;
-+	mmc-hs400-1_8v;
-+	non-removable;
-+	vmmc-supply = <&reg_3p3v>;
-+	vqmmc-supply = <&reg_1p8v>;
-+	status = "okay";
-+};
-+
-+&pio {
-+	mmc0_pins_default: mmc0-pins {
-+		mux {
-+			function = "emmc";
-+			groups = "emmc_51";
-+		};
-+		conf-cmd-dat {
-+			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
-+			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
-+			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
-+			input-enable;
-+			drive-strength = <4>;
-+			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
-+		};
-+		conf-clk {
-+			pins = "EMMC_CK";
-+			drive-strength = <6>;
-+			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
-+		};
-+		conf-ds {
-+			pins = "EMMC_DSL";
-+			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
-+		};
-+		conf-rst {
-+			pins = "EMMC_RSTB";
-+			drive-strength = <4>;
-+			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
-+		};
-+	};
-+
-+	mmc0_pins_uhs: mmc0-uhs-pins {
-+		mux {
-+			function = "emmc";
-+			groups = "emmc_51";
-+		};
-+		conf-cmd-dat {
-+			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
-+			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
-+			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
-+			input-enable;
-+			drive-strength = <4>;
-+			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
-+		};
-+		conf-clk {
-+			pins = "EMMC_CK";
-+			drive-strength = <6>;
-+			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
-+		};
-+		conf-ds {
-+			pins = "EMMC_DSL";
-+			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
-+		};
-+		conf-rst {
-+			pins = "EMMC_RSTB";
-+			drive-strength = <4>;
-+			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
-+		};
-+	};
-+
-+	wf_2g_5g_pins: wf_2g_5g-pins {
-+		mux {
-+			function = "wifi";
-+			groups = "wf_2g", "wf_5g";
-+		};
-+		conf {
-+			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
-+			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
-+			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
-+			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
-+			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
-+			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
-+			       "WF1_TOP_CLK", "WF1_TOP_DATA";
-+			drive-strength = <4>;
-+		};
-+	};
-+};
-+
-+&trng {
-+	status = "okay";
-+};
-+
-+&uart0 {
-+	status = "okay";
-+};
-+
-+&watchdog {
-+	status = "okay";
-+};
-diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
-index 2e978be6804bf..aac60c4ca509e 100644
---- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
-+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
-@@ -19,6 +19,7 @@ mediatek_setup_interfaces()
- 	confiabits,mt7981|\
- 	cudy,wr3000-v1|\
- 	jcg,q30-pro|\
-+	jdcloud,re-cs-05|\
- 	qihoo,360t7|\
- 	routerich,ax3000)
- 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
-@@ -130,6 +131,11 @@ mediatek_setup_macs()
- 		lan_mac=$(mtd_get_mac_ascii u-boot-env mac)
- 		label_mac=$lan_mac
- 		;;
-+	jdcloud,re-cs-05)
-+		wan_mac=$(mmc_get_mac_binary factory 0x24)
-+		lan_mac=$(mmc_get_mac_binary factory 0x2a)
-+		label_mac=$lan_mac
-+		;;	
- 	qihoo,360t7)
- 		lan_mac=$(mtd_get_mac_ascii factory lanMac)
- 		wan_mac=$(macaddr_add "$lan_mac" 1)
-diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
-index 8eda14f82b51d..82b1bb8f88ef6 100644
---- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
-+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
-@@ -55,7 +55,8 @@ case "$FIRMWARE" in
- 	;;
- "mediatek/mt7986_eeprom_mt7976_dual.bin")
- 	case "$board" in
--	glinet,gl-mt6000)
-+	glinet,gl-mt6000|\
-+	jdcloud,re-cs-05)
- 		caldata_extract_mmc "factory" 0x0 0x1000
- 		;;
- 	esac
-diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
-index e3b042c876d50..1a3f329f4cf66 100755
---- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
-@@ -109,7 +109,8 @@ platform_do_upgrade() {
- 	cudy,wr3000-v1)
- 		default_do_upgrade "$1"
- 		;;
--	glinet,gl-mt6000)
-+	glinet,gl-mt6000|\
-+	jdcloud,re-cs-05)
- 		CI_KERNPART="kernel"
- 		CI_ROOTPART="rootfs"
- 		emmc_do_upgrade "$1"
-@@ -185,6 +186,7 @@ platform_copy_config() {
- 		esac
- 		;;
- 	glinet,gl-mt6000|\
-+	jdcloud,re-cs-05|\
- 	ubnt,unifi-6-plus)
- 		emmc_copy_config
- 		;;
---- a/target/linux/mediatek/image/filogic.mk
-+++ b/target/linux/mediatek/image/filogic.mk
-@@ -296,6 +296,21 @@
- endef
- TARGET_DEVICES += jcg_q30-pro
- 
-+define Device/jdcloud_re-cs-05
-+  DEVICE_VENDOR := JDCloud
-+  DEVICE_MODEL := AX6000
-+  DEVICE_DTS := mt7986a-jdcloud-re-cs-05
-+  DEVICE_DTS_DIR := ../dts
-+  DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-mt7986-firmware mt7986-wo-firmware
-+  UBINIZE_OPTS := -E 5
-+  BLOCKSIZE := 128k
-+  PAGESIZE := 2048
-+  IMAGES := sysupgrade.bin
-+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-+endef
-+TARGET_DEVICES += jdcloud_re-cs-05
-+
-+
- define Device/netgear_wax220
-   DEVICE_VENDOR := NETGEAR
-   DEVICE_MODEL := WAX220

+ 0 - 6
devices/mediatek_mt7981/.config

@@ -1,22 +1,16 @@
 CONFIG_TARGET_mediatek=y
 CONFIG_TARGET_mediatek_mt7981=y
 CONFIG_TARGET_MULTI_PROFILE=y
-CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_glinet_gl-mt2500=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_glinet_gl-x3000=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_glinet_gl-xe3000=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_livinet_zr-3020=y
-CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cetron_ct3003=y
-CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_jcg_q30=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_mt7981-clt-r30b1-112M=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_konka_komi-a31=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_imou_lc-hx3001=y
-CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_rax3000m=y
-CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_rax3000m-emmc=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_abt_asr3000=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_a10=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_nradio_wt9103=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_nradio_wt9103_512m=y
-CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=y
 
 
 CONFIG_VERSION_DIST="OpenWrt"

+ 5 - 0
devices/qualcommax_ipq60xx/.config

@@ -1,6 +1,11 @@
 CONFIG_TARGET_qualcommax=y
 CONFIG_TARGET_qualcommax_ipq60xx=y
 CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_cmiot_ax18=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_qihoo_360v6=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_zn_m2=y
 CONFIG_TARGET_ALL_PROFILES=y
 
 CONFIG_PACKAGE_kmod-qca-nss-cfi-cryptoapi=n

BIN
devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-cmiot_ax18.ipq6018


BIN
devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-qihoo_360v6.ipq6018


BIN
devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-qihoo_v6.ipq6018


+ 206 - 0
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-360v6.dts

@@ -0,0 +1,206 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "ipq6018-512m.dtsi"
+#include "ipq6018-ess.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Qihoo 360V6";
+	compatible = "qihoo,360v6", "qcom,ipq6018";
+
+	aliases {
+		serial0 = &blsp1_uart3;
+		led-boot = &led_green;
+		led-failsafe = &led_red;
+		led-running = &led_green;
+		led-upgrade = &led_orange;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
+		};
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_red: status_red {
+			label = "red:status";
+			gpio = <&tlmm 71 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_orange: status_orange {
+			label = "orange:status";
+			gpio = <&tlmm 72 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_green: status_green {
+			label = "green:status";
+			gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&tlmm {
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio64";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio65";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart3 {
+	pinctrl-0 = <&serial_3_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand@0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part";
+		};
+	};
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&usb3 {
+	status = "okay";
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
+
+	qca8075_0: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0>;
+	};
+
+	qca8075_1: ethernet-phy@1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
+
+	qca8075_2: ethernet-phy@2 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <2>;
+	};
+
+	qca8075_3: ethernet-phy@3 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <3>;
+	};
+};
+
+&switch {
+	status = "okay";
+
+	switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
+	switch_lan_bmp = <0xe>;  /* lan port bitmap */
+	switch_wan_bmp = <0x10>; /* wan port bitmap */
+	switch_inner_bmp = <0xc0>; /*inner port bitmap*/
+	switch_mac_mode = <0x0>; /* mac mode for uniphy 0*/
+	switch_mac_mode1 = <0xff>; /* mac mode for uniphy 1*/
+	switch_mac_mode2 = <0xff>; /* mac mode for uniphy 2*/
+
+	qcom,port_phyinfo {
+		port@0 {
+			port_id = <1>;
+			phy_address = <0>;
+		};
+		port@1 {
+			port_id = <2>;
+			phy_address = <1>;
+		};
+		port@2 {
+			port_id = <3>;
+			phy_address = <2>;
+		};
+		port@3 {
+			port_id = <4>;
+			phy_address = <3>;
+		};
+	};
+};
+
+&edma {
+	status = "okay";
+};
+
+&dp1 {
+	status = "okay";
+	phy-handle = <&qca8075_0>;
+	label = "wan";
+};
+
+&dp2 {
+	status = "okay";
+	phy-handle = <&qca8075_1>;
+	label = "lan1";
+};
+
+&dp3 {
+	status = "okay";
+	phy-handle = <&qca8075_2>;
+	label = "lan2";
+};
+
+&dp4 {
+	status = "okay";
+	phy-handle = <&qca8075_3>;
+	label = "lan3";
+};
+
+&wifi {
+	status = "okay";
+
+	qcom,ath11k-fw-memory-mode = <1>;
+};

+ 0 - 22
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi

@@ -1,22 +0,0 @@
-/ {
-	reserved-memory {
-		#address-cells = <2>;
-		#size-cells = <2>;
-		ranges;
-
-		nss@40000000 {
-			reg = <0x00 0x40000000 0x00 0x1000000>;
-			no-map;
-		};
-
-		uboot@4a100000 {
-			reg = <0x00 0x4a100000 0x00 0x400000>;
-			no-map;
-		};
-
-		sbl@4a500000 {
-			reg = <0x00 0x4a500000 0x00 0x100000>;
-			no-map;
-		};
-	};
-};

+ 0 - 253
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-v6.dts

@@ -1,253 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0+)
-
-/dts-v1/;
-
-#include "ipq6018.dtsi"
-#include "ipq6018-upstreamable.dtsi"
-#include "ipq6018-ess.dtsi"
-
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/gpio/gpio.h>
-
-/ {
-	model = "Qihoo 360 V6";
-	compatible = "qihoo,v6", "qcom,ipq6018";
-
-	aliases {
-		serial0 = &blsp1_uart3;
-		led-boot = &led_system_orange;
-		led-failsafe = &led_system_red;
-		led-running = &led_system_green;
-		led-upgrade = &led_system_orange;
-	};
-
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
-	leds {
-		compatible = "gpio-leds";
-		pinctrl-0 = <&leds_pins>;
-		pinctrl-names = "default";
-
-		led_system_red: system-red {
-			label = "v6:red:status";
-			gpios = <&tlmm 71 GPIO_ACTIVE_HIGH>;
-		};
-
-		led_system_orange: system-orange {
-			label = "v6:orange:status";
-			gpios = <&tlmm 72 GPIO_ACTIVE_HIGH>;
-		};
-
-		led_system_green: system-green {
-			label = "v6:green:status";
-			gpios = <&tlmm 73 GPIO_ACTIVE_HIGH>;
-		};
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_WPS_BUTTON>;
-		};
-	};
-};
-
-&blsp1_uart3 {
-	pinctrl-0 = <&serial_3_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
-&tlmm {
-
-	mdio_pins: mdio-pins {
-		mdc {
-			pins = "gpio64";
-			function = "mdc";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-
-		mdio {
-			pins = "gpio65";
-			function = "mdio";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-	};
-
-	leds_pins: leds_pins {
-		mux {
-			pins = "gpio71", "gpio72", "gpio73";
-			function = "gpio";
-			drive-strength = <8>;
-			bias-pull-down;
-		};
-	};
-
-};
-
-&soc {
-	dp@1 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001000 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <1>;
-
-		phy-handle = <&phy_0>;
-		phy-mode = "sgmii";
-	};
-
-	dp2 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001200 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <2>;
-
-		phy-handle = <&phy_1>;
-		phy-mode = "sgmii";
-	};
-
-	dp3 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001400 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <3>;
-
-		phy-handle = <&phy_2>;
-		phy-mode = "sgmii";
-	};
-
-	dp4 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001600 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <4>;
-
-		phy-handle = <&phy_3>;
-		phy-mode = "sgmii";
-	};
-
-	dp5 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001800 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <5>;
-
-		phy-handle = <&phy_4>;
-		phy-mode = "sgmii";
-	};
-};
-
-&edma {
-	status = "okay";
-};
-
-&mdio {
-	status = "okay";
-	pinctrl-0 = <&mdio_pins>;
-	pinctrl-names = "default";
-	reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
-
-	phy_0: ethernet-phy@0 {
-		reg = <0>;
-// 		reset-gpios = <&tlmm 77 GPIO_ACTIVE_LOW>;
-	};
-
-	phy_1: ethernet-phy@1 {
-		reg = <1>;
-	};
-
-	phy_2: ethernet-phy@2 {
-		reg = <2>;
-	};
-
-	phy_3: ethernet-phy@3 {
-		reg = <3>;
-	};
-
-	phy_4: ethernet-phy@4 {
-		reg = <4>;
-	};
-
-};
-
-&switch {
-	status = "okay";
-
-	switch_lan_bmp = <0x1e>;
-	switch_wan_bmp = <0x20>;
-	switch_mac_mode = <0x00>;
-	switch_mac_mode1 = <0xff>;
-	switch_mac_mode2 = <0xff>;
-
-	qcom,port_phyinfo {
-		port@0 {
-			port_id = <0x01>;
-			phy_address = <0x00>;
-		};
-		port@1 {
-			port_id = <0x02>;
-			phy_address = <0x01>;
-		};
-		port@2 {
-			port_id = <0x03>;
-			phy_address = <0x02>;
-		};
-		port@3 {
-			port_id = <0x04>;
-			phy_address = <0x03>;
-		};
-		port@4 {
-			port_id = <0x05>;
-			phy_address = <0x04>;
-		};
-	};
-};
-
-&qpic_bam {
-	status = "okay";
-};
-
-&qpic_nand {
-	status = "okay";
-
-	nand@0 {
-		reg = <0>;
-
-		nand-ecc-strength = <4>;
-		nand-ecc-step-size = <512>;
-		nand-bus-width = <8>;
-	};
-};
-
-&wifi {
-	status = "okay";
-};
-
-&ssphy_0 {
-	status = "ok";
-};
-
-&qusb_phy_0 {
-	status = "ok";
-};
-
-&usb3 {
-	status = "ok";
-};
-
-&wifi {
-	qcom,ath11k-calibration-variant = "Qihoo-360V6";
-};

+ 6 - 6
devices/qualcommax_ipq60xx/patches/v6m2.patch

@@ -6,7 +6,7 @@
  	zte_mf287plus \
 -	zyxel_nbg7815
 +	zyxel_nbg7815 \
-+	qihoo_v6 \
++	qihoo_360v6 \
 +	cmiot_ax18
  
  ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
@@ -15,7 +15,7 @@
  $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))
  $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620))
  $(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630))
-+$(eval $(call generate-ipq-wifi-package,qihoo_v6,QIHOO 360V6))
++$(eval $(call generate-ipq-wifi-package,qihoo_360v6,QIHOO 360V6))
 +$(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
  $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
  $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
@@ -27,7 +27,7 @@
  endef
  TARGET_DEVICES += cmiot_ax18
  
-+define Device/qihoo_v6
++define Device/qihoo_360v6
 +	$(call Device/FitImage)
 +	$(call Device/UbiFit)
 +	DEVICE_VENDOR := Qihoo 360
@@ -35,10 +35,10 @@
 +	BLOCKSIZE := 128k
 +	PAGESIZE := 2048
 +	DEVICE_DTS_CONFIG := config@cp03-c1
-+	DEVICE_PACKAGES := ath11k-wifi-qihoo_v6
-+	SOC := ipq6018
++	DEVICE_PACKAGES := ipq-wifi-qihoo_360v6
++	SOC := ipq6000
 +endef
-+TARGET_DEVICES += qihoo_v6
++TARGET_DEVICES += qihoo_360v6
 +
 +define Device/zn_m2
 +	$(call Device/FitImage)

+ 1 - 6
devices/rockchip_armv8/patches/99-more.patch

@@ -1,6 +1,6 @@
 --- a/target/linux/rockchip/image/armv8.mk
 +++ b/target/linux/rockchip/image/armv8.mk
-@@ -141,6 +141,52 @@ define Device/friendlyarm_nanopi-r5s
+@@ -141,6 +141,47 @@ define Device/friendlyarm_nanopi-r5s
  endef
  TARGET_DEVICES += friendlyarm_nanopi-r5s
  
@@ -8,7 +8,6 @@
 +  DEVICE_VENDOR := FriendlyARM
 +  DEVICE_MODEL := NanoPi M4
 +  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
 +  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
 +endef
 +TARGET_DEVICES += friendlyarm_nanopi-m4
@@ -17,7 +16,6 @@
 +  DEVICE_VENDOR := FriendlyARM
 +  DEVICE_MODEL := NanoPi NEO4
 +  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
 +  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
 +endef
 +TARGET_DEVICES += friendlyarm_nanopi-neo4
@@ -26,7 +24,6 @@
 +  DEVICE_VENDOR := FriendlyARM
 +  DEVICE_MODEL := NanoPC T4
 +  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
 +  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
 +endef
 +TARGET_DEVICES += friendlyarm_nanopc-t4
@@ -35,7 +32,6 @@
 +  DEVICE_VENDOR := FriendlyARM
 +  DEVICE_MODEL := NanoPC T6
 +  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
 +  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
 +endef
 +TARGET_DEVICES += friendlyarm_nanopc-t6
@@ -44,7 +40,6 @@
 +  DEVICE_VENDOR := FriendlyARM
 +  DEVICE_MODEL := NanoPi R2S Plus
 +  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
 +  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
 +  DEVICE_PACKAGES := kmod-usb-net-rtl8152
 +endef