* [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface
@ 2025-06-19 9:47 Russell King (Oracle)
2025-06-23 1:56 ` Yanteng Si
2025-06-23 20:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2025-06-19 9:47 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
netdev, Paolo Abeni, Vladimir Zapolskiy
lpc18xx uses plat_dat->mac_interface, despite wanting to validate the
PHY interface. Checking the DT files (arch/arm/boot/dts/nxp/lpc/), none
of them specify mac-mode which means mac_interface and phy_interface
will be identical.
mac_interface is only used when there is some kind of MII converter
between the DesignWare MAC and PHY, and describes the interface mode
that the DW MAC needs to use, whereas phy_interface describes the
interface mode that the PHY uses.
Noting that lpc18xx only supports MII and RMII interface modes, switch
this glue driver to use plat_dat->phy_interface, and to mark that the
mac_interface is not used, explicitly set it to PHY_INTERFACE_MODE_NA.
The latter is safe as the only user of mac_interface for this platform
would be in stmmac_check_pcs_mode(), which only checks for RGMII or
SGMII.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
index 22653ffd2a04..c0c44916f849 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
@@ -41,6 +41,7 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
+ plat_dat->mac_interface = PHY_INTERFACE_MODE_NA;
plat_dat->has_gmac = true;
reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg");
@@ -49,9 +50,9 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
return PTR_ERR(reg);
}
- if (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII) {
+ if (plat_dat->phy_interface == PHY_INTERFACE_MODE_MII) {
ethmode = LPC18XX_CREG_CREG6_ETHMODE_MII;
- } else if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) {
+ } else if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) {
ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII;
} else {
dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface
2025-06-19 9:47 [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface Russell King (Oracle)
@ 2025-06-23 1:56 ` Yanteng Si
2025-06-23 20:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Yanteng Si @ 2025-06-23 1:56 UTC (permalink / raw)
To: Russell King (Oracle), Andrew Lunn, Heiner Kallweit
Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
netdev, Paolo Abeni, Vladimir Zapolskiy
在 6/19/25 5:47 PM, Russell King (Oracle) 写道:
> lpc18xx uses plat_dat->mac_interface, despite wanting to validate the
> PHY interface. Checking the DT files (arch/arm/boot/dts/nxp/lpc/), none
> of them specify mac-mode which means mac_interface and phy_interface
> will be identical.
>
> mac_interface is only used when there is some kind of MII converter
> between the DesignWare MAC and PHY, and describes the interface mode
> that the DW MAC needs to use, whereas phy_interface describes the
> interface mode that the PHY uses.
>
> Noting that lpc18xx only supports MII and RMII interface modes, switch
> this glue driver to use plat_dat->phy_interface, and to mark that the
> mac_interface is not used, explicitly set it to PHY_INTERFACE_MODE_NA.
> The latter is safe as the only user of mac_interface for this platform
> would be in stmmac_check_pcs_mode(), which only checks for RGMII or
> SGMII.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Yanteng Si <siyanteng@cqsoftware.com.cn>
Thanks,
Yanteng
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
> index 22653ffd2a04..c0c44916f849 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
> @@ -41,6 +41,7 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
> if (IS_ERR(plat_dat))
> return PTR_ERR(plat_dat);
>
> + plat_dat->mac_interface = PHY_INTERFACE_MODE_NA;
> plat_dat->has_gmac = true;
>
> reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg");
> @@ -49,9 +50,9 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
> return PTR_ERR(reg);
> }
>
> - if (plat_dat->mac_interface == PHY_INTERFACE_MODE_MII) {
> + if (plat_dat->phy_interface == PHY_INTERFACE_MODE_MII) {
> ethmode = LPC18XX_CREG_CREG6_ETHMODE_MII;
> - } else if (plat_dat->mac_interface == PHY_INTERFACE_MODE_RMII) {
> + } else if (plat_dat->phy_interface == PHY_INTERFACE_MODE_RMII) {
> ethmode = LPC18XX_CREG_CREG6_ETHMODE_RMII;
> } else {
> dev_err(&pdev->dev, "Only MII and RMII mode supported\n");
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface
2025-06-19 9:47 [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface Russell King (Oracle)
2025-06-23 1:56 ` Yanteng Si
@ 2025-06-23 20:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-23 20:00 UTC (permalink / raw)
To: Russell King
Cc: andrew, hkallweit1, alexandre.torgue, andrew+netdev, davem,
edumazet, kuba, linux-arm-kernel, linux-stm32, mcoquelin.stm32,
netdev, pabeni, vz
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 19 Jun 2025 10:47:26 +0100 you wrote:
> lpc18xx uses plat_dat->mac_interface, despite wanting to validate the
> PHY interface. Checking the DT files (arch/arm/boot/dts/nxp/lpc/), none
> of them specify mac-mode which means mac_interface and phy_interface
> will be identical.
>
> mac_interface is only used when there is some kind of MII converter
> between the DesignWare MAC and PHY, and describes the interface mode
> that the DW MAC needs to use, whereas phy_interface describes the
> interface mode that the PHY uses.
>
> [...]
Here is the summary with links:
- [net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface
https://git.kernel.org/netdev/net-next/c/9f22c3ddb8cf
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:[~2025-06-24 1:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 9:47 [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface Russell King (Oracle)
2025-06-23 1:56 ` Yanteng Si
2025-06-23 20:00 ` 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).