diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts index 9ee0b9f8d..121958dbe 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts @@ -14,7 +14,7 @@ led-failsafe = &led_sys_yellow; led-running = &led_sys_blue; led-upgrade = &led_sys_yellow; - label-mac-device = &gmac0; + label-mac-device = ðernet; }; chosen { @@ -129,33 +129,19 @@ }; }; -&gmac0 { +ðernet { + compatible = "mediatek,ralink-mt7621-eth"; + mediatek,switch = <&gsw>; mtd-mac-address = <&factory 0x3fff4>; }; &switch0 { - ports { - port@0 { - status = "okay"; - label = "lan1"; - }; + /delete-property/ compatible; + phy-mode = "rgmii"; +}; - port@1 { - status = "okay"; - label = "lan2"; - }; - - port@2 { - status = "okay"; - label = "lan3"; - }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0x3fffa>; - }; - }; +&gsw { + compatible = "mediatek,ralink-mt7621-gsw"; }; &state_default { diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index a275c83a8..77dbd4666 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1560,7 +1560,6 @@ endef TARGET_DEVICES += xiaomi_mi-router-ac2100 define Device/xiaomi_mi-router-cr660x - $(Device/dsa-migration) $(Device/uimage-lzma-loader) BLOCKSIZE := 128k PAGESIZE := 2048 @@ -1575,6 +1574,7 @@ define Device/xiaomi_mi-router-cr660x DEVICE_MODEL := Mi Router CR660x DEVICE_PACKAGES += kmod-mt7915e wpad-openssl uboot-envtools SUPPORTED_DEVICES += xiaomi,mi-router-cr6606 + DEVICE_COMPAT_VERSION := 1.1 endef TARGET_DEVICES += xiaomi_mi-router-cr660x diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 77d7a3c00..ad15b6401 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -38,7 +38,7 @@ dlink,dir-853-a3) ;; dlink,dir-853-r1|\ xiaomi,mi-router-cr660x) - ucidef_set_led_netdev "internet" "internet" "blue:net" "wan" + ucidef_set_led_switch "wan" "wan" "blue:net" "switch0" "0x10" ;; dlink,dir-860l-b1|\ dlink,dir-867-a1|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 84bb75d24..3d9107799 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -23,8 +23,7 @@ ramips_setup_interfaces() ;; ampedwireless,ally-r1900k|\ hiwifi,hc5962|\ - xiaomi,mi-router-3-pro|\ - xiaomi,mi-router-cr660x) + xiaomi,mi-router-3-pro) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; asiarf,ap7621-001|\ @@ -86,6 +85,11 @@ ramips_setup_interfaces() "2:lan:1" "3:lan:2" "4:lan:3" "0:wan" "6@eth0" ucidef_set_interface_lan "eth0.1 ra0 rai0" ;; + xiaomi,mi-router-cr660x) + ucidef_add_switch "switch0" \ + "0:lan:1" "1:lan:2" "2:lan:3" "4:wan" "6@eth0" + ucidef_set_interface_lan "eth0.1" + ;; zyxel,nr7101) ucidef_set_interfaces_lan_wan "lan" "wan" ;;