diff options
author | Andrew Lunn <andrew@lunn.ch> | 2015-08-31 09:56:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-31 17:48:02 -0400 |
commit | e44853466844c20d8b5b16de187f63ddc50710dd (patch) | |
tree | 1266f92e283bb7d5300504cc3f764c2cb8d06e89 /net/dsa | |
parent | 39b0c705195e9409dc8a40cc82b11d81405a4a4b (diff) |
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: Andrew Lunn <andrew@lunn.ch>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index afff17341b73..76e3800765f8 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -181,7 +181,7 @@ static int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct net_device *master) | |||
181 | struct dsa_chip_data *cd = ds->pd; | 181 | struct dsa_chip_data *cd = ds->pd; |
182 | struct device_node *port_dn; | 182 | struct device_node *port_dn; |
183 | struct phy_device *phydev; | 183 | struct phy_device *phydev; |
184 | int ret, port; | 184 | int ret, port, mode; |
185 | 185 | ||
186 | for (port = 0; port < DSA_MAX_PORTS; port++) { | 186 | for (port = 0; port < DSA_MAX_PORTS; port++) { |
187 | if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) | 187 | 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 | return ret; | 196 | return ret; |
197 | } | 197 | } |
198 | phydev = of_phy_find_device(port_dn); | 198 | phydev = of_phy_find_device(port_dn); |
199 | |||
200 | mode = of_get_phy_mode(port_dn); | ||
201 | if (mode < 0) | ||
202 | mode = PHY_INTERFACE_MODE_NA; | ||
203 | phydev->interface = mode; | ||
204 | |||
199 | genphy_config_init(phydev); | 205 | genphy_config_init(phydev); |
200 | genphy_read_status(phydev); | 206 | genphy_read_status(phydev); |
201 | if (ds->drv->adjust_link) | 207 | if (ds->drv->adjust_link) |