Commit 9daf5a76 authored by Kim Phillips's avatar Kim Phillips Committed by Jeff Garzik

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: default avatarKim Phillips <kim.phillips@freescale.com>
Tested-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: default avatarLi Yang <leoli@freescale.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 7d400a4c
...@@ -143,20 +143,28 @@ static int m88e1111_config_init(struct phy_device *phydev) ...@@ -143,20 +143,28 @@ static int m88e1111_config_init(struct phy_device *phydev)
int err; int err;
if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) || if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)) { (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
int temp; int temp;
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
temp = phy_read(phydev, MII_M1111_PHY_EXT_CR); temp = phy_read(phydev, MII_M1111_PHY_EXT_CR);
if (temp < 0) if (temp < 0)
return temp; return temp;
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
temp |= (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY); temp |= (MII_M1111_RX_DELAY | MII_M1111_TX_DELAY);
} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) {
temp &= ~MII_M1111_TX_DELAY;
temp |= MII_M1111_RX_DELAY;
} else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) {
temp &= ~MII_M1111_RX_DELAY;
temp |= MII_M1111_TX_DELAY;
}
err = phy_write(phydev, MII_M1111_PHY_EXT_CR, temp); err = phy_write(phydev, MII_M1111_PHY_EXT_CR, temp);
if (err < 0) if (err < 0)
return err; return err;
}
temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
if (temp < 0) if (temp < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment