diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-01-16 14:44:58 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-23 09:21:37 +0100 |
commit | e4bf61b0fa56e766d677ded495d8e3f37a2e0ba8 (patch) | |
tree | d026760b2029ffe50a57cdafc4408161640155b0 | |
parent | 6f18594a45923ac4552713e81d4e6836a3328b48 (diff) | |
download | barebox-e4bf61b0fa56e766d677ded495d8e3f37a2e0ba8.tar.gz barebox-e4bf61b0fa56e766d677ded495d8e3f37a2e0ba8.tar.xz |
net: dsa: always call port_pre_enable before port_enable
The barebox DSA support differentiates between a port_pre_enable, that's
called before connecting the PHY to drive a clock if nedeed and the
actual port_enable. For user ports, port_enable of the CPU port is
called, but not port_pre_enable. Fix this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230116134501.2006391-7-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/net/dsa.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c index c1430a9361..793bbbb4f1 100644 --- a/drivers/net/dsa.c +++ b/drivers/net/dsa.c @@ -122,6 +122,16 @@ static int dsa_port_start(struct eth_device *edev) if (!ds->cpu_port_users) { struct dsa_port *dpc = ds->dp[ds->cpu_port]; + if (ops->port_pre_enable) { + /* In case of RMII interface we need to enable RMII clock + * before talking to the PHY. + */ + ret = ops->port_pre_enable(dpc, ds->cpu_port, + ds->cpu_port_fixed_phy->interface); + if (ret) + return ret; + } + if (ops->port_enable) { ret = ops->port_enable(dpc, ds->cpu_port, ds->cpu_port_fixed_phy); |