Skip to content

Commit 039a7b8

Browse files
ffainellidavem330
authored andcommitted
net: phy: bcm7xxx: Implement EGPHY workaround for 7278
Implement the HW design team recommended workaround in for 7278. Since the GPHY now returns its revision information in MII_PHYS_ID[23] we need to check whether the revision provided in flags is 0 or not. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 582d0ac commit 039a7b8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

drivers/net/phy/bcm7xxx.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,44 @@ static int bcm7xxx_28nm_e0_plus_afe_config_init(struct phy_device *phydev)
167167
return 0;
168168
}
169169

170+
static int bcm7xxx_28nm_a0_patch_afe_config_init(struct phy_device *phydev)
171+
{
172+
/* +1 RC_CAL codes for RL centering for both LT and HT conditions */
173+
bcm_phy_write_misc(phydev, AFE_RXCONFIG_2, 0xd003);
174+
175+
/* Cut master bias current by 2% to compensate for RC_CAL offset */
176+
bcm_phy_write_misc(phydev, DSP_TAP10, 0x791b);
177+
178+
/* Improve hybrid leakage */
179+
bcm_phy_write_misc(phydev, AFE_HPF_TRIM_OTHERS, 0x10e3);
180+
181+
/* Change rx_on_tune 8 to 0xf */
182+
bcm_phy_write_misc(phydev, 0x21, 0x2, 0x87f6);
183+
184+
/* Change 100Tx EEE bandwidth */
185+
bcm_phy_write_misc(phydev, 0x22, 0x2, 0x017d);
186+
187+
/* Enable ffe zero detection for Vitesse interoperability */
188+
bcm_phy_write_misc(phydev, 0x26, 0x2, 0x0015);
189+
190+
r_rc_cal_reset(phydev);
191+
192+
return 0;
193+
}
194+
170195
static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
171196
{
172197
u8 rev = PHY_BRCM_7XXX_REV(phydev->dev_flags);
173198
u8 patch = PHY_BRCM_7XXX_PATCH(phydev->dev_flags);
174199
u8 count;
175200
int ret = 0;
176201

202+
/* Newer devices have moved the revision information back into a
203+
* standard location in MII_PHYS_ID[23]
204+
*/
205+
if (rev == 0)
206+
rev = phydev->phy_id & ~phydev->drv->phy_id_mask;
207+
177208
pr_info_once("%s: %s PHY revision: 0x%02x, patch: %d\n",
178209
phydev_name(phydev), phydev->drv->name, rev, patch);
179210

@@ -197,6 +228,9 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
197228
case 0x10:
198229
ret = bcm7xxx_28nm_e0_plus_afe_config_init(phydev);
199230
break;
231+
case 0x01:
232+
ret = bcm7xxx_28nm_a0_patch_afe_config_init(phydev);
233+
break;
200234
default:
201235
break;
202236
}

0 commit comments

Comments
 (0)