diff options
author | Kweh, Hock Leong <hock.leong.kweh@intel.com> | 2016-12-27 15:07:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-27 12:28:08 -0500 |
commit | 5799fc905930f866c7d32aaf81b31f8027297506 (patch) | |
tree | 661fe02f44483a6b678687e0f00db985a0de7186 | |
parent | 610c908773d30907c950ca3b2ee8ac4b2813537b (diff) |
net: stmmac: fix incorrect bit set in gmac4 mdio addr register
Fixing the gmac4 mdio write access to use MII_GMAC4_WRITE only instead of
OR together with MII_WRITE.
Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
Acked-By: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index fda01f770eff..b0344c213752 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | |||
@@ -116,7 +116,7 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg, | |||
116 | unsigned int mii_address = priv->hw->mii.addr; | 116 | unsigned int mii_address = priv->hw->mii.addr; |
117 | unsigned int mii_data = priv->hw->mii.data; | 117 | unsigned int mii_data = priv->hw->mii.data; |
118 | 118 | ||
119 | u32 value = MII_WRITE | MII_BUSY; | 119 | u32 value = MII_BUSY; |
120 | 120 | ||
121 | value |= (phyaddr << priv->hw->mii.addr_shift) | 121 | value |= (phyaddr << priv->hw->mii.addr_shift) |
122 | & priv->hw->mii.addr_mask; | 122 | & priv->hw->mii.addr_mask; |
@@ -126,6 +126,8 @@ static int stmmac_mdio_write(struct mii_bus *bus, int phyaddr, int phyreg, | |||
126 | & priv->hw->mii.clk_csr_mask; | 126 | & priv->hw->mii.clk_csr_mask; |
127 | if (priv->plat->has_gmac4) | 127 | if (priv->plat->has_gmac4) |
128 | value |= MII_GMAC4_WRITE; | 128 | value |= MII_GMAC4_WRITE; |
129 | else | ||
130 | value |= MII_WRITE; | ||
129 | 131 | ||
130 | /* Wait until any existing MII operation is complete */ | 132 | /* Wait until any existing MII operation is complete */ |
131 | if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) | 133 | if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) |