aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>2017-02-08 17:14:26 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-09 17:10:23 -0500
commitbb1a619735b4660f21bce3e728b937640024b4ad (patch)
treecf73ea48581dd23195bb427bd3e9c2c144928096
parent9c8bb163ae784be4f79ae504e78c862806087c54 (diff)
net: phy: Initialize mdio clock at probe function
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. Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com> Fixes: ddc24ae1 ("net: phy: Broadcom iProc MDIO bus driver") Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jon Mason <jon.mason@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/mdio-bcm-iproc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/phy/mdio-bcm-iproc.c b/drivers/net/phy/mdio-bcm-iproc.c
index c0b4e65267af..46fe1ae919a3 100644
--- a/drivers/net/phy/mdio-bcm-iproc.c
+++ b/drivers/net/phy/mdio-bcm-iproc.c
@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg)
81 if (rc) 81 if (rc)
82 return rc; 82 return rc;
83 83
84 iproc_mdio_config_clk(priv->base);
85
86 /* Prepare the read operation */ 84 /* Prepare the read operation */
87 cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) | 85 cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
88 (reg << MII_DATA_RA_SHIFT) | 86 (reg << MII_DATA_RA_SHIFT) |
@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id,
112 if (rc) 110 if (rc)
113 return rc; 111 return rc;
114 112
115 iproc_mdio_config_clk(priv->base);
116
117 /* Prepare the write operation */ 113 /* Prepare the write operation */
118 cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) | 114 cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
119 (reg << MII_DATA_RA_SHIFT) | 115 (reg << MII_DATA_RA_SHIFT) |
@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev)
163 bus->read = iproc_mdio_read; 159 bus->read = iproc_mdio_read;
164 bus->write = iproc_mdio_write; 160 bus->write = iproc_mdio_write;
165 161
162 iproc_mdio_config_clk(priv->base);
163
166 rc = of_mdiobus_register(bus, pdev->dev.of_node); 164 rc = of_mdiobus_register(bus, pdev->dev.of_node);
167 if (rc) { 165 if (rc) {
168 dev_err(&pdev->dev, "MDIO bus registration failed\n"); 166 dev_err(&pdev->dev, "MDIO bus registration failed\n");