* [PATCH net] net: phy: bcm7xx: Correct read from expansion register
@ 2023-05-08 23:17 Florian Fainelli
2023-05-09 8:03 ` Simon Horman
2023-05-10 5:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2023-05-08 23:17 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Broadcom internal kernel review list,
Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, open list
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: f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/bcm-phy-lib.h | 5 +++++
drivers/net/phy/bcm7xxx.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/bcm-phy-lib.h b/drivers/net/phy/bcm-phy-lib.h
index 9902fb182099..729db441797a 100644
--- a/drivers/net/phy/bcm-phy-lib.h
+++ b/drivers/net/phy/bcm-phy-lib.h
@@ -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);
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index 06be71ecd2f8..f8c17a253f8b 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -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 */
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: phy: bcm7xx: Correct read from expansion register
2023-05-08 23:17 [PATCH net] net: phy: bcm7xx: Correct read from expansion register Florian Fainelli
@ 2023-05-09 8:03 ` Simon Horman
2023-05-10 5:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-05-09 8:03 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, Broadcom internal kernel review list, Andrew Lunn,
Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, open list
On Mon, May 08, 2023 at 04:17:49PM -0700, Florian Fainelli wrote:
> 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: f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: phy: bcm7xx: Correct read from expansion register
2023-05-08 23:17 [PATCH net] net: phy: bcm7xx: Correct read from expansion register Florian Fainelli
2023-05-09 8:03 ` Simon Horman
@ 2023-05-10 5:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-10 5:20 UTC (permalink / raw)
To: Florian Fainelli
Cc: netdev, bcm-kernel-feedback-list, andrew, hkallweit1, linux,
davem, edumazet, kuba, pabeni, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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 to 0xf to properly
> select the expansion register passed as argument.
>
> Fixes: f68d08c437f9 ("net: phy: bcm7xxx: Add EPHY entry for 72165")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-10 5:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-08 23:17 [PATCH net] net: phy: bcm7xx: Correct read from expansion register Florian Fainelli
2023-05-09 8:03 ` Simon Horman
2023-05-10 5:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).