diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2010-09-16 23:23:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-17 19:12:56 -0400 |
commit | dfb8fb96ae2b5126cd0c08c0ccd7c42e1f46568a (patch) | |
tree | 9727f43bae819ece67c1c9bc26b3cb52e236e5ce /drivers/net/stmmac/stmmac_mdio.c | |
parent | 67c9660831f6b6b76866a0838466c83765ffbbd3 (diff) |
stmmac: add CSR Clock range selection
This patch adds the CSR Clock range selection.
Original patch from Johannes Stezenbach fixed the CSR
in the stmmac_mdio. We agreed to provide this through
the platform instead of.
Also thanks to Johannes for having tested it on ARM.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/stmmac/stmmac_mdio.c')
-rw-r--r-- | drivers/net/stmmac/stmmac_mdio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/stmmac/stmmac_mdio.c b/drivers/net/stmmac/stmmac_mdio.c index 03dea1401571..d7441616357d 100644 --- a/drivers/net/stmmac/stmmac_mdio.c +++ b/drivers/net/stmmac/stmmac_mdio.c | |||
@@ -53,7 +53,7 @@ static int stmmac_mdio_read(struct mii_bus *bus, int phyaddr, int phyreg) | |||
53 | int data; | 53 | int data; |
54 | u16 regValue = (((phyaddr << 11) & (0x0000F800)) | | 54 | u16 regValue = (((phyaddr << 11) & (0x0000F800)) | |
55 | ((phyreg << 6) & (0x000007C0))); | 55 | ((phyreg << 6) & (0x000007C0))); |
56 | regValue |= MII_BUSY; /* in case of GMAC */ | 56 | regValue |= MII_BUSY | ((priv->mii_clk_csr & 7) << 2); |
57 | 57 | ||
58 | do {} while (((readl(priv->ioaddr + mii_address)) & MII_BUSY) == 1); | 58 | do {} while (((readl(priv->ioaddr + mii_address)) & MII_BUSY) == 1); |
59 | writel(regValue, priv->ioaddr + mii_address); | 59 | writel(regValue, priv->ioaddr + mii_address); |
@@ -85,7 +85,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg, | |||
85 | (((phyaddr << 11) & (0x0000F800)) | ((phyreg << 6) & (0x000007C0))) | 85 | (((phyaddr << 11) & (0x0000F800)) | ((phyreg << 6) & (0x000007C0))) |
86 | | MII_WRITE; | 86 | | MII_WRITE; |
87 | 87 | ||
88 | value |= MII_BUSY; | 88 | value |= MII_BUSY | ((priv->mii_clk_csr & 7) << 2); |
89 | |||
89 | 90 | ||
90 | /* Wait until any existing MII operation is complete */ | 91 | /* Wait until any existing MII operation is complete */ |
91 | do {} while (((readl(priv->ioaddr + mii_address)) & MII_BUSY) == 1); | 92 | do {} while (((readl(priv->ioaddr + mii_address)) & MII_BUSY) == 1); |