aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/marvell.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 035fd41fb61f..f0574073a2a3 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -143,21 +143,29 @@ static int m88e1111_config_init(struct phy_device *phydev)
143 int err; 143 int err;
144 144
145 if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || 145 if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
146 (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)) { 146 (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
147 (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
148 (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
147 int temp; 149 int temp;
148 150
149 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { 151 temp = phy_read(phydev, MII_M1111_PHY_EXT_CR);
150 temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); 152 if (temp < 0)
151 if (temp < 0) 153 return temp;
152 return temp;
153 154
155 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
154 temp |= (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY); 156 temp |= (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY);
155 157 } else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
156 err = phy_write(phydev, MII_M1111_PHY_EXT_CR, temp); 158 temp &= ~MII_M1111_TX_DELAY;
157 if (err < 0) 159 temp |= MII_M1111_RX_DELAY;
158 return err; 160 } else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
161 temp &= ~MII_M1111_RX_DELAY;
162 temp |= MII_M1111_TX_DELAY;
159 } 163 }
160 164
165 err = phy_write(phydev, MII_M1111_PHY_EXT_CR, temp);
166 if (err < 0)
167 return err;
168
161 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); 169 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
162 if (temp < 0) 170 if (temp < 0)
163 return temp; 171 return temp;