netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yanteng Si <si.yanteng@linux.dev>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Vladimir Zapolskiy <vz@mleia.com>
Subject: Re: [PATCH net-next] net: stmmac: lpc18xx: use plat_dat->phy_interface
Date: Mon, 23 Jun 2025 09:56:39 +0800	[thread overview]
Message-ID: <5dc786e1-0e2e-468c-b2d5-b8e93e6d8265@linux.dev> (raw)
In-Reply-To: <E1uSBri-004fL5-FI@rmk-PC.armlinux.org.uk>

在 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");


  reply	other threads:[~2025-06-23  1:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-06-23 20:00 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5dc786e1-0e2e-468c-b2d5-b8e93e6d8265@linux.dev \
    --to=si.yanteng@linux.dev \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).