diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2007-11-26 17:17:52 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-12-01 16:32:30 -0500 |
commit | 9daf5a7695f70b60c498aac079f908c81ffe4d15 (patch) | |
tree | d3bfc6a105ad7c077656b4947f38b6b36f228967 /drivers/net/phy | |
parent | 7d400a4c589749bf5b5e544aee07b3c489b54d02 (diff) |
phylib: marvell: add support for TX-only and RX-only Internal Delay
Previously, Internal Delay specification implied the delay be
applied to both TX and RX. This patch allows for separate TX/RX-only
internal delay specification.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Tested-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/marvell.c | 26 |
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; |