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

View File

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

View File

@ -214,6 +214,10 @@
mtd-mac-address-increment = <6>;
};
&hnat {
mtketh-wan = "eth5";
};
&switch0 {
ports {
port@0 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -91,7 +91,14 @@
&gmac1 {
mtd-mac-address = <&factory 0x4>;
mtd-mac-address-increment = <1>;
phy-mode = "rgmii";
status = "okay";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};
&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)
{
const char *name = of_get_property(np, "label", NULL);
const __be32 *_id = of_get_property(np, "reg", NULL);
struct phylink *phylink;
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]->dev.of_node = np;
if (name)
strlcpy(eth->netdev[id]->name, name, IFNAMSIZ);
return 0;
free_netdev: