提交 e4485346 编写于 作者: A Andrew Lunn 提交者: David S. Miller

net: dsa: Allow DSA and CPU ports to have a phy-mode property

It can be useful for DSA and CPU ports to have a phy-mode property, in
particular to specify RGMII delays. Parse the property and set it in
the fixed-link phydev.
Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 39b0c705
...@@ -181,7 +181,7 @@ static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master) ...@@ -181,7 +181,7 @@ static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master)
struct dsa_chip_data *cd = ds->pd; struct dsa_chip_data *cd = ds->pd;
struct device_node *port_dn; struct device_node *port_dn;
struct phy_device *phydev; struct phy_device *phydev;
int ret, port; int ret, port, mode;
for (port = 0; port < DSA_MAX_PORTS; port++) { for (port = 0; port < DSA_MAX_PORTS; port++) {
if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)))
...@@ -196,6 +196,12 @@ static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master) ...@@ -196,6 +196,12 @@ static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master)
return ret; return ret;
} }
phydev = of_phy_find_device(port_dn); phydev = of_phy_find_device(port_dn);
mode = of_get_phy_mode(port_dn);
if (mode < 0)
mode = PHY_INTERFACE_MODE_NA;
phydev->interface = mode;
genphy_config_init(phydev); genphy_config_init(phydev);
genphy_read_status(phydev); genphy_read_status(phydev);
if (ds->drv->adjust_link) if (ds->drv->adjust_link)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册