summaryrefslogtreecommitdiffstats
path: root/drivers/net/designware_stm32.c
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2019-11-15 08:32:38 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-15 14:40:44 +0100
commitb004955a303df0ae31911241e017ae486288dcde (patch)
treec86700a52682a2152aa714758b0d2e97948c5e1c /drivers/net/designware_stm32.c
parent76ace47bfc9c233471af14d441c2f5a1d8bf4b53 (diff)
downloadbarebox-b004955a303df0ae31911241e017ae486288dcde.tar.gz
barebox-b004955a303df0ae31911241e017ae486288dcde.tar.xz
net: designware: eqos: enable clocks before mdio_register
We can't be using the MAC including the MDIO controller while the clocks are off, but this is exactly the case when mdio_register is called and the interface is not yet up. To allow reading the PHY id to succeed before the interface is up, turn on the clocks as part of the initialization in the probe. This fixes following error at probe time: ERROR: <NULL>: MDIO not idle at entry The NULL is fixed in a follow-up commit. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/designware_stm32.c')
-rw-r--r--drivers/net/designware_stm32.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/drivers/net/designware_stm32.c b/drivers/net/designware_stm32.c
index ed54ff2b26..9acdf11903 100644
--- a/drivers/net/designware_stm32.c
+++ b/drivers/net/designware_stm32.c
@@ -164,16 +164,6 @@ static int eqos_init_stm32(struct device_d *dev, struct eqos *eqos)
dev_dbg(dev, "No phy clock provided. Continuing without.\n");
}
- return 0;
-
-}
-
-static int eqos_start_stm32(struct eth_device *edev)
-{
- struct eqos *eqos = edev->priv;
- struct eqos_stm32 *priv = to_stm32(eqos);
- int ret;
-
ret = clk_bulk_enable(priv->num_clks, priv->clks);
if (ret < 0) {
eqos_err(eqos, "clk_bulk_enable() failed: %s\n",
@@ -181,27 +171,7 @@ static int eqos_start_stm32(struct eth_device *edev)
return ret;
}
- udelay(10);
-
- ret = eqos_start(edev);
- if (ret)
- goto err_stop_clks;
-
return 0;
-
-err_stop_clks:
- clk_bulk_disable(priv->num_clks, priv->clks);
-
- return ret;
-}
-
-static void eqos_stop_stm32(struct eth_device *edev)
-{
- struct eqos_stm32 *priv = to_stm32(edev->priv);
-
- eqos_stop(edev);
-
- clk_bulk_disable(priv->num_clks, priv->clks);
}
// todo split!
@@ -209,8 +179,6 @@ static struct eqos_ops stm32_ops = {
.init = eqos_init_stm32,
.get_ethaddr = eqos_get_ethaddr,
.set_ethaddr = eqos_set_ethaddr,
- .start = eqos_start_stm32,
- .stop = eqos_stop_stm32,
.adjust_link = eqos_adjust_link,
.get_csr_clk_rate = eqos_get_csr_clk_rate_stm32,
@@ -230,6 +198,7 @@ static void eqos_remove_stm32(struct device_d *dev)
eqos_remove(dev);
+ clk_bulk_disable(priv->num_clks, priv->clks);
clk_bulk_put(priv->num_clks, priv->clks);
}