net: phy: bcm7xx: Correct read from expansion register
Subsystems (4)
PATCH 1/1 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.
--- drivers/net/phy/bcm-phy-lib.h | 5 +++++ drivers/net/phy/bcm7xxx.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/phy/bcm-phy-lib.h +5 -0
@@ -40,6 +40,11 @@ static inline int bcm_phy_write_exp_sel(struct phy_device *phydev,return bcm_phy_write_exp (phydev, reg |MII_BCM54XX_EXP_SEL_ER , val); } +static inline int bcm_phy_read_exp_sel (struct phy_device *phydev,u16 reg) +{ +return bcm_phy_read_exp (phydev, reg |MII_BCM54XX_EXP_SEL_ER ); +} +int bcm54xx_auxctl_write (struct phy_device *phydev,u16 regnum,u16 val);int bcm54xx_auxctl_read (struct phy_device *phydev,u16 regnum);
drivers/net/phy/bcm7xxx.c +1 -1
@@ -486,7 +486,7 @@ static int bcm7xxx_16nm_ephy_afe_config(struct phy_device *phydev)bcm_phy_write_misc (phydev,0x0038 ,0x0002 ,0xede0 );/* Read CORE_EXPA9 */ - tmp =bcm_phy_read_exp (phydev,0x00a9 ); + tmp =bcm_phy_read_exp_sel (phydev,0x00a9 );/* CORE_EXPA9[6:1] is rcalcode[5:0] */ rcalcode = (tmp &0x7e ) /2 ;/* Correct RCAL code + 1 is -1% rprogr, LP: +16 */
Signature · 1 line
2.34.1
Quoted 6 lines · Florian Fainelli
Since the driver works in the "legacy" addressing mode, we need to write to the expansion register (
0x17) with bits 11:8 set to0xfto properly select the expansion register passed as argument.Fixes f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165")Signed-off-by Florian Fainelli <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Mon, 8 May 2023 16:17:49 -0700 you wrote:
Since the driver works in the "legacy" addressing mode, we need to write to the expansion register (
0x17) with bits 11:8 set to0xfto properly select the expansion register passed as argument.Fixes f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165")Signed-off-by Florian Fainelli <[email protected]>[...]
Here is the summary with links:
- [net] net: phy: bcm7xx: Correct read from expansion register
https://git.kernel.org/netdev/net/c/582dbb2cc1a0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html