Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ramips: use mt proprietary driver for XiaoMI MI R4 #5244

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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