diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mir4.dts b/target/linux/ramips/dts/mt7621_xiaomi_mir4.dts index 721497d32..08bd719bc 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mir4.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mir4.dts @@ -14,7 +14,7 @@ led-failsafe = &led_status_red; led-running = &led_status_blue; led-upgrade = &led_status_yellow; - label-mac-device = &gmac0; + label-mac-device = ðernet; }; chosen { @@ -161,30 +161,20 @@ }; }; -&gmac0 { +ðernet { + compatible = "mediatek,ralink-mt7621-eth"; + mediatek,switch = <&gsw>; mtd-mac-address = <&factory 0xe006>; }; &switch0 { - ports { - port@1 { - status = "okay"; - label = "lan1"; - }; - - port@2 { - status = "okay"; - label = "lan2"; - }; - - port@4 { - status = "okay"; - label = "wan"; - mtd-mac-address = <&factory 0xe000>; - }; - }; + /delete-property/ compatible; + phy-mode = "rgmii"; }; +&gsw { + compatible = "mediatek,ralink-mt7621-gsw"; +}; &state_default { gpio { diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 9435f652e..3af2c4d48 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1037,7 +1037,7 @@ define Device/xiaomi_mir4 DEVICE_MODEL := Mi Router 4 SUPPORTED_DEVICES += R4 SUPPORTED_DEVICES += mir4 - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 wpad-openssl uboot-envtools + DEVICE_PACKAGES := kmod-mt7603e kmod-mt76x2e luci-app-mtwifi uboot-envtools endef TARGET_DEVICES += xiaomi_mir4 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 6f149146e..f0db051ca 100755 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -15,8 +15,7 @@ ramips_setup_interfaces() asiarf,ap7621-nv1|\ lenovo,newifi-d1|\ mikrotik,routerboard-m33g|\ - xiaomi,mir3g-v2|\ - xiaomi,mir4) + xiaomi,mir3g-v2) ucidef_set_interfaces_lan_wan "lan1 lan2" "wan" ;; d-team,newifi-d2) @@ -75,6 +74,11 @@ ramips_setup_interfaces() "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" ucidef_set_interface_lan "eth0.1 ra0 rai0" ;; + xiaomi,mir4) + ucidef_add_switch "switch0" \ + "1:lan:1" "2:lan:2" "4:wan" "6t@eth0" + ucidef_set_interface_lan "eth0.1 ra0 rai0" + ;; xiaomi,mi-router-ac2100|\ xiaomi,redmi-router-ac2100) ucidef_add_switch "switch0" \ @@ -148,6 +152,7 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_binary factory 0xe006) ;; xiaomi,mir3g|\ + xiaomi,mir4|\ xiaomi,mi-router-ac2100|\ xiaomi,redmi-router-ac2100) lan_mac=$(cat /sys/class/net/eth0/address)