diff options
author | Shaohui Xie <Shaohui.Xie@freescale.com> | 2014-12-30 03:28:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-02 15:39:49 -0500 |
commit | 05930b5ec1d3b2a5c76e1959b54cae15587009c7 (patch) | |
tree | 4dafabc9d98fee5e255986dfdc7209767edae45c /drivers/net/ethernet/freescale | |
parent | aa842478044ff3e5a9e4b339f3bde5a0e78440e0 (diff) |
net/fsl: remove hardcoded clock setting from xgmac_mdio
There is no need to set the clock speed in read/write which will be performed
unnecessarily for each mdio access. Init it during probe is enough.
Also, the hardcoded clock value is not a proper way for all SoCs.
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/xgmac_mdio.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index 9de526891da0..a35244586a63 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c | |||
@@ -94,13 +94,6 @@ static int xgmac_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 val | |||
94 | uint16_t dev_addr = regnum >> 16; | 94 | uint16_t dev_addr = regnum >> 16; |
95 | int ret; | 95 | int ret; |
96 | 96 | ||
97 | /* Setup the MII Mgmt clock speed */ | ||
98 | out_be32(®s->mdio_stat, MDIO_STAT_CLKDIV(100)); | ||
99 | |||
100 | ret = xgmac_wait_until_free(&bus->dev, regs); | ||
101 | if (ret) | ||
102 | return ret; | ||
103 | |||
104 | /* Set the port and dev addr */ | 97 | /* Set the port and dev addr */ |
105 | out_be32(®s->mdio_ctl, | 98 | out_be32(®s->mdio_ctl, |
106 | MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr)); | 99 | MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr)); |
@@ -135,13 +128,6 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) | |||
135 | uint16_t value; | 128 | uint16_t value; |
136 | int ret; | 129 | int ret; |
137 | 130 | ||
138 | /* Setup the MII Mgmt clock speed */ | ||
139 | out_be32(®s->mdio_stat, MDIO_STAT_CLKDIV(100)); | ||
140 | |||
141 | ret = xgmac_wait_until_free(&bus->dev, regs); | ||
142 | if (ret) | ||
143 | return ret; | ||
144 | |||
145 | /* Set the Port and Device Addrs */ | 131 | /* Set the Port and Device Addrs */ |
146 | mdio_ctl = MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr); | 132 | mdio_ctl = MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr); |
147 | out_be32(®s->mdio_ctl, mdio_ctl); | 133 | out_be32(®s->mdio_ctl, mdio_ctl); |