* [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used
@ 2023-05-08 7:03 Siddharth Vadapalli
2023-05-09 2:21 ` Andrew Lunn
2023-05-09 10:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Siddharth Vadapalli @ 2023-05-08 7:03 UTC (permalink / raw)
To: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, linux-arm-kernel, srk, s-vadapalli
From: Grygorii Strashko <grygorii.strashko@ti.com>
The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII
interfaces and is configured by default to use RGMII interface (strap).
However, the board design allows switching dynamically to MII interface
for testing purposes by applying different set of pinmuxes.
To support switching to MII interface, update the DP83869 PHY driver to
configure OP_MODE_DECODE.RGMII_MII_SEL(bit 5) properly when MII PHY
interface mode is requested.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
---
RFC patch at:
https://lore.kernel.org/r/20230425054429.3956535-3-s-vadapalli@ti.com/
Changes since RFC patch:
- Change patch subject to PATCH net-next.
- Reword commit message to indicate that the patch adds new support and
is not intended to be a bug fix.
- Add check to ensure that MII mode is requested only with valid operational
modes.
drivers/net/phy/dp83869.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index 9ab5eff502b7..fa8c6fdcf301 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -692,8 +692,19 @@ static int dp83869_configure_mode(struct phy_device *phydev,
/* Below init sequence for each operational mode is defined in
* section 9.4.8 of the datasheet.
*/
+ phy_ctrl_val = dp83869->mode;
+ if (phydev->interface == PHY_INTERFACE_MODE_MII) {
+ if (dp83869->mode == DP83869_100M_MEDIA_CONVERT ||
+ dp83869->mode == DP83869_RGMII_100_BASE) {
+ phy_ctrl_val |= DP83869_OP_MODE_MII;
+ } else {
+ phydev_err(phydev, "selected op-mode is not valid with MII mode\n");
+ return -EINVAL;
+ }
+ }
+
ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_OP_MODE,
- dp83869->mode);
+ phy_ctrl_val);
if (ret)
return ret;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used
2023-05-08 7:03 [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used Siddharth Vadapalli
@ 2023-05-09 2:21 ` Andrew Lunn
2023-05-09 10:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2023-05-09 2:21 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, linux-arm-kernel, srk
On Mon, May 08, 2023 at 12:33:59PM +0530, Siddharth Vadapalli wrote:
> From: Grygorii Strashko <grygorii.strashko@ti.com>
>
> The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII
> interfaces and is configured by default to use RGMII interface (strap).
> However, the board design allows switching dynamically to MII interface
> for testing purposes by applying different set of pinmuxes.
>
> To support switching to MII interface, update the DP83869 PHY driver to
> configure OP_MODE_DECODE.RGMII_MII_SEL(bit 5) properly when MII PHY
> interface mode is requested.
>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used
2023-05-08 7:03 [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used Siddharth Vadapalli
2023-05-09 2:21 ` Andrew Lunn
@ 2023-05-09 10:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-09 10:20 UTC (permalink / raw)
To: Siddharth Vadapalli
Cc: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, linux-arm-kernel, srk
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 8 May 2023 12:33:59 +0530 you wrote:
> From: Grygorii Strashko <grygorii.strashko@ti.com>
>
> The DP83869 PHY on TI's k3-am642-evm supports both MII and RGMII
> interfaces and is configured by default to use RGMII interface (strap).
> However, the board design allows switching dynamically to MII interface
> for testing purposes by applying different set of pinmuxes.
>
> [...]
Here is the summary with links:
- [net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used
https://git.kernel.org/netdev/net-next/c/94e86ef1b801
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-09 10: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 7:03 [PATCH net-next] net: phy: dp83869: support mii mode when rgmii strap cfg is used Siddharth Vadapalli
2023-05-09 2:21 ` Andrew Lunn
2023-05-09 10: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