Skip to content

Commit

Permalink
ramips: use mt proprietary driver for XiaoMI MI R4 (#5244)
Browse files Browse the repository at this point in the history
  • Loading branch information
DoveKi authored Aug 5, 2020
1 parent 413d869 commit 85808a0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
28 changes: 9 additions & 19 deletions target/linux/ramips/dts/mt7621_xiaomi_mir4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = &ethernet;
};

chosen {
Expand Down Expand Up @@ -161,30 +161,20 @@
};
};

&gmac0 {
&ethernet {
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 {
Expand Down
2 changes: 1 addition & 1 deletion target/linux/ramips/image/mt7621.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions target/linux/ramips/mt7621/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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" \
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 85808a0

Please sign in to comment.