ramips: XiaoYu-C5: reuse ralink-eth driver

This commit is contained in:
AmadeusGhost 2020-10-06 22:40:31 +08:00 committed by CN_SZTL
parent 82cc584e7a
commit 3fdc484aba
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 15 additions and 31 deletions

View File

@ -14,7 +14,7 @@
led-failsafe = &led_sys;
led-running = &led_sys;
led-upgrade = &led_sys;
label-mac-device = &gmac0;
label-mac-device = &ethernet;
};
leds {
@ -86,39 +86,19 @@
status = "okay";
};
&gmac0 {
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
mtd-mac-address = <&factory 0x4>;
};
&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@3 {
status = "okay";
label = "lan4";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
};
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
};
&state_default {

View File

@ -64,7 +64,8 @@ ramips_setup_interfaces()
mikrotik,routerboard-760igs)
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp"
;;
phicomm,k2p)
phicomm,k2p|\
xiaoyu,xy-c5)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
ucidef_set_interface_lan "eth0.1 ra0 rax0"
@ -77,7 +78,7 @@ ramips_setup_interfaces()
;;
xiaomi,mir4)
ucidef_add_switch "switch0" \
"1:lan:1" "2:lan:2" "4:wan" "6t@eth0"
"1:lan:2" "2:lan:1" "4:wan" "6t@eth0"
ucidef_set_interface_lan "eth0.1 ra0 rai0"
;;
xiaomi,mi-router-ac2100|\
@ -167,6 +168,9 @@ ramips_setup_macs()
lan_mac=$(mtd_get_mac_binary factory 0xe006)
wan_mac=$(mtd_get_mac_binary factory 0xe000)
;;
xiaoyu,xy-c5)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
;;
wavlink,wl-wn531a6|\
winstars,ws-wn583a6|\
zbtlink,zbt-we1326|\