ramips: mt7621: fixes dsa hnat support

This commit is contained in:
AmadeusGhost 2022-08-29 23:15:56 +08:00
parent a28334d8b8
commit 1ccc3bfd54
11 changed files with 70 additions and 15 deletions

View File

@ -490,13 +490,7 @@
compatible = "mediatek,eth-mac"; compatible = "mediatek,eth-mac";
reg = <1>; reg = <1>;
status = "disabled"; status = "disabled";
phy-mode = "rgmii"; phy-mode = "rgmii-rxid";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
mdio: mdio-bus { mdio: mdio-bus {
@ -563,8 +557,8 @@
hnat: hnat@1e100000 { hnat: hnat@1e100000 {
compatible = "mediatek,mtk-hnat_v1"; compatible = "mediatek,mtk-hnat_v1";
/* ext-devices = "apcli0", "apclii0","apclix0", ext-devices = "apcli0", "apclii0","apclix0",
"ra0", "rai0", "rax0", "wlan0", "wlan1"; */ "ra0", "rai0", "rax0", "wlan0", "wlan1";
reg = <0x1e100000 0x3000>; reg = <0x1e100000 0x3000>;
resets = <&ethsys 0>; resets = <&ethsys 0>;
@ -573,7 +567,7 @@
mtketh-wan = "wan"; mtketh-wan = "wan";
mtketh-ppd = "lan"; mtketh-ppd = "lan";
mtketh-lan = "lan"; mtketh-lan = "lan";
mtketh-max-gmac = <1>; mtketh-max-gmac = <2>;
mtkdsa-wan-port = <4>; mtkdsa-wan-port = <4>;
}; };

View File

@ -113,7 +113,14 @@
&gmac1 { &gmac1 {
mtd-mac-address = <&factory 0xe000>; mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>; mtd-mac-address-increment = <1>;
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -61,11 +61,11 @@
cpu_fan: cpu_fan { cpu_fan: cpu_fan {
compatible = "gpio-fan"; compatible = "gpio-fan";
gpios = <&gpio 13 GPIO_ACTIVE_HIGH gpios = <&gpio 13 GPIO_ACTIVE_HIGH
&gpio 14 GPIO_ACTIVE_HIGH>; &gpio 14 GPIO_ACTIVE_HIGH>;
gpio-fan,speed-map = < 0 0 gpio-fan,speed-map = < 0 0
2000 1 2000 1
4000 2 4000 2
6000 3>; 6000 3>;
#cooling-cells = <2>; #cooling-cells = <2>;
}; };
@ -214,6 +214,10 @@
mtd-mac-address-increment = <6>; mtd-mac-address-increment = <6>;
}; };
&hnat {
mtketh-wan = "eth5";
};
&switch0 { &switch0 {
ports { ports {
port@0 { port@0 {

View File

@ -160,6 +160,10 @@
}; };
}; };
&hnat {
mtkdsa-wan-port = <0>;
};
&switch0 { &switch0 {
ports { ports {
port@1 { port@1 {

View File

@ -94,7 +94,14 @@
&gmac1 { &gmac1 {
mtd-mac-address = <&factory 0xe006>; mtd-mac-address = <&factory 0xe006>;
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -107,7 +107,14 @@
&gmac1 { &gmac1 {
mtd-mac-address = <&factory 0xe006>; mtd-mac-address = <&factory 0xe006>;
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -115,7 +115,14 @@
}; };
&gmac1 { &gmac1 {
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -135,7 +135,14 @@
&gmac1 { &gmac1 {
mtd-mac-address = <&factory 0x3fffa>; mtd-mac-address = <&factory 0x3fffa>;
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -30,7 +30,14 @@
&gmac1 { &gmac1 {
mtd-mac-address = <&factory 0xe006>; mtd-mac-address = <&factory 0xe006>;
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -91,7 +91,14 @@
&gmac1 { &gmac1 {
mtd-mac-address = <&factory 0x4>; mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>; mtd-mac-address-increment = <1>;
phy-mode = "rgmii";
status = "okay"; status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
}; };
&gsw { &gsw {

View File

@ -3400,6 +3400,7 @@ static const struct net_device_ops mtk_netdev_ops = {
static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
{ {
const char *name = of_get_property(np, "label", NULL);
const __be32 *_id = of_get_property(np, "reg", NULL); const __be32 *_id = of_get_property(np, "reg", NULL);
struct phylink *phylink; struct phylink *phylink;
int phy_mode, id, err; int phy_mode, id, err;
@ -3490,6 +3491,9 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
eth->netdev[id]->irq = eth->irq[0]; eth->netdev[id]->irq = eth->irq[0];
eth->netdev[id]->dev.of_node = np; eth->netdev[id]->dev.of_node = np;
if (name)
strlcpy(eth->netdev[id]->name, name, IFNAMSIZ);
return 0; return 0;
free_netdev: free_netdev: