aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/phy/icplus.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index d5199cb4caec..c0e092470182 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -36,8 +36,9 @@ MODULE_LICENSE("GPL");
36 36
37/* IP101A/G - IP1001 */ 37/* IP101A/G - IP1001 */
38#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ 38#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */
39#define IP1001_RXPHASE_SEL (1<<0) /* Add delay on RX_CLK */
40#define IP1001_TXPHASE_SEL (1<<1) /* Add delay on TX_CLK */
39#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ 41#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */
40#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
41#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ 42#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
42#define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */ 43#define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */
43#define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */ 44#define IP101A_G_IRQ_CONF_STATUS 0x11 /* Conf Info IRQ & Status Reg */
@@ -143,14 +144,24 @@ static int ip1001_config_init(struct phy_device *phydev)
143 if (c < 0) 144 if (c < 0)
144 return c; 145 return c;
145 146
146 if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { 147 if ((phydev->interface == PHY_INTERFACE_MODE_RGMII) ||
147 /* Additional delay (2ns) used to adjust RX clock phase 148 (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) ||
148 * at RGMII interface */ 149 (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) ||
150 (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) {
151
149 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); 152 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
150 if (c < 0) 153 if (c < 0)
151 return c; 154 return c;
152 155
153 c |= IP1001_PHASE_SEL_MASK; 156 c &= ~(IP1001_RXPHASE_SEL | IP1001_TXPHASE_SEL);
157
158 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
159 c |= (IP1001_RXPHASE_SEL | IP1001_TXPHASE_SEL);
160 else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
161 c |= IP1001_RXPHASE_SEL;
162 else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
163 c |= IP1001_TXPHASE_SEL;
164
154 c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); 165 c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
155 if (c < 0) 166 if (c < 0)
156 return c; 167 return c;