Skip to contentSkip to conversation

net: phy: Initialize mdio clock at probe function

PATCH Applied Jon Mason 2 participants 2 messages Feb 8, 2017 – Feb 9, 2017

Subsystems (4)
lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/1 net: phy: Initialize mdio clock at probe function

From: Yendapally Reddy Dhananjaya Reddy <[email protected]>

USB PHYs need the MDIO clock divisor enabled earlier to work. Initialize mdio clock divisor in probe function. The ext bus bit available in the same register will be used by mdio mux to enable external mdio.

Fixes ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver")
---
 drivers/net/phy/mdio-bcm-iproc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/phy/mdio-bcm-iproc.c +2 -4
index c0b4e65..46fe1ae 100644
@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg)
 	if (rc)
 		return rc;
 
-	iproc_mdio_config_clk(priv->base);
-
 	/* Prepare the read operation */
 	cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
 		(reg << MII_DATA_RA_SHIFT) |
@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id,
 	if (rc)
 		return rc;
 
-	iproc_mdio_config_clk(priv->base);
-
 	/* Prepare the write operation */
 	cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
 		(reg << MII_DATA_RA_SHIFT) |
@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev)
 	bus->read = iproc_mdio_read;
 	bus->write = iproc_mdio_write;
 
+	iproc_mdio_config_clk(priv->base);
+
 	rc = of_mdiobus_register(bus, pdev->dev.of_node);
 	if (rc) {
 		dev_err(&pdev->dev, "MDIO bus registration failed\n");
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw

From: Jon Mason <[email protected]>
Date: Wed, 8 Feb 2017 17:14:26 -0500

Quoted 11 lines

From: Yendapally Reddy Dhananjaya Reddy <[email protected]>

USB PHYs need the MDIO clock divisor enabled earlier to work. Initialize mdio clock divisor in probe function. The ext bus bit available in the same register will be used by mdio mux to enable external mdio.

Fixes ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver")

Applied.