ramips: mi ac2100: switch to new hnat driver

This commit is contained in:
AmadeusGhost 2022-05-30 20:05:16 +08:00 committed by AmadeusGhost
parent 0eed36f2ea
commit f46c60443c
4 changed files with 22 additions and 13 deletions

View File

@ -11,7 +11,7 @@
led-failsafe = &led_status_yellow;
led-running = &led_status_blue;
led-upgrade = &led_status_blue;
label-mac-device = &ethernet;
label-mac-device = &gmac0;
};
leds {

View File

@ -11,7 +11,7 @@
led-failsafe = &led_status_amber;
led-running = &led_status_white;
led-upgrade = &led_status_white;
label-mac-device = &ethernet;
label-mac-device = &gmac0;
};
leds {

View File

@ -24,19 +24,30 @@
};
};
&ethernet {
compatible = "mediatek,ralink-mt7621-eth";
mediatek,switch = <&gsw>;
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
/delete-property/ compatible;
phy-mode = "rgmii";
&gmac1 {
mtd-mac-address = <&factory 0xe006>;
status = "okay";
};
&gsw {
compatible = "mediatek,ralink-mt7621-gsw";
mediatek,portmap = "wllll";
status = "okay";
};
&hnat {
mtketh-wan = "eth1";
mtketh-ppd = "eth0";
mtketh-lan = "eth0";
mtketh-max-gmac = <2>;
/delete-property/ mtkdsa-wan-port;
};
&switch0 {
status = "disabled";
};
&state_default {

View File

@ -96,7 +96,7 @@ ramips_setup_interfaces()
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
ucidef_add_switch "switch0" \
"2:lan:1" "3:lan:2" "4:lan:3" "0:wan" "6@eth0"
"2:lan:1" "3:lan:2" "4:lan:3" "0:wan" "6u@eth0" "5u@eth1"
ucidef_set_interface_lan "eth0.1 ra0 rai0"
;;
zyxel,nr7101)
@ -142,9 +142,7 @@ ramips_setup_macs()
wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
lan_mac=$wan_mac
;;
d-team,newifi-d2|\
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
d-team,newifi-d2)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary factory 0xe006)
;;