ramips: cr660x switch to DSA network driver

This commit is contained in:
lean 2021-09-23 16:21:27 +08:00
parent 61f4bdeb2b
commit 9621c35447
3 changed files with 26 additions and 19 deletions

View File

@ -14,7 +14,7 @@
led-failsafe = &led_sys_yellow;
led-running = &led_sys_blue;
led-upgrade = &led_sys_yellow;
label-mac-device = &ethernet;
label-mac-device = &gmac0;
};
chosen {
@ -129,19 +129,33 @@
};
};
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
&gmac0 {
mtd-mac-address = <&factory 0x3fff4>;
};
&switch0 {
/delete-property/ compatible;
phy-mode = "rgmii";
};
ports {
port@0 {
status = "okay";
label = "lan1";
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
port@1 {
status = "okay";
label = "lan2";
};
port@2 {
status = "okay";
label = "lan3";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x3fffa>;
};
};
};
&state_default {

View File

@ -38,7 +38,7 @@ dlink,dir-853-a3)
;;
dlink,dir-853-r1|\
xiaomi,mi-router-cr660x)
ucidef_set_led_switch "wan" "wan" "blue:net" "switch0" "0x10"
ucidef_set_led_netdev "internet" "internet" "blue:net" "wan"
;;
dlink,dir-860l-b1|\
dlink,dir-867-a1|\

View File

@ -23,7 +23,8 @@ ramips_setup_interfaces()
;;
ampedwireless,ally-r1900k|\
hiwifi,hc5962|\
xiaomi,mi-router-3-pro)
xiaomi,mi-router-3-pro|\
xiaomi,mi-router-cr660x)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
;;
asiarf,ap7621-001|\
@ -86,10 +87,6 @@ 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"
;;
zyxel,nr7101)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;
@ -197,10 +194,6 @@ ramips_setup_macs()
lan_mac=$(macaddr_add "$wan_mac" -3)
label_mac=$lan_mac
;;
xiaomi,mi-router-cr660x)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary Factory 0x3fffa)
;;
xiaoyu,xy-c5)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
;;