Skip to content

Commit 582dbb2

Browse files
ffainellikuba-moo
authored andcommitted
net: phy: bcm7xx: Correct read from expansion register
Since the driver works in the "legacy" addressing mode, we need to write to the expansion register (0x17) with bits 11:8 set to 0xf to properly select the expansion register passed as argument. Fixes: f68d08c ("net: phy: bcm7xxx: Add EPHY entry for 72165") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent dfd9248 commit 582dbb2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/net/phy/bcm-phy-lib.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ static inline int bcm_phy_write_exp_sel(struct phy_device *phydev,
4040
return bcm_phy_write_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER, val);
4141
}
4242

43+
static inline int bcm_phy_read_exp_sel(struct phy_device *phydev, u16 reg)
44+
{
45+
return bcm_phy_read_exp(phydev, reg | MII_BCM54XX_EXP_SEL_ER);
46+
}
47+
4348
int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val);
4449
int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum);
4550

drivers/net/phy/bcm7xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int bcm7xxx_16nm_ephy_afe_config(struct phy_device *phydev)
486486
bcm_phy_write_misc(phydev, 0x0038, 0x0002, 0xede0);
487487

488488
/* Read CORE_EXPA9 */
489-
tmp = bcm_phy_read_exp(phydev, 0x00a9);
489+
tmp = bcm_phy_read_exp_sel(phydev, 0x00a9);
490490
/* CORE_EXPA9[6:1] is rcalcode[5:0] */
491491
rcalcode = (tmp & 0x7e) / 2;
492492
/* Correct RCAL code + 1 is -1% rprogr, LP: +16 */

0 commit comments

Comments
 (0)