Subject: Re: [PATCH net-next v13 00/15] stmmac: Add Loongson platform support

From: "Russell King (Oracle)" <[email-masked]>
Date: Thu, 6 Jun 2024 19:27:52 +0100

On Wed, May 29, 2024 at 06:17:22PM +0800, Yanteng Si wrote:
>  3. Our priv->dma_cap.pcs is false, so let's use PHY_INTERFACE_MODE_NA;

Useful to note.

>  4. Our GMAC does not support Delay, so let's use PHY_INTERFACE_MODE_RGMII_ID,
>     the current dts is wrong, a fix patch will be sent to the LoongArch list
>     later.

RGMII requires a delay somewhere in the system, and there are three
options: at the MAC, in the board traces, or at the PHY. The
PHY_INTERFACE_MODE_RGMII* passed to the PHY determines what delays the
PHY uses, and thus what the GMAC uses has no bearing on this - if the
board traces are adding the required delay, then
PHY_INTERFACE_MODE_RGMII is sufficient.

If the board traces do not add the required delay, and the GMAC doesn't
add a delay, then it is necessary to add the delay at the PHY, so
using PHY_INTERFACE_MODE_RGMII_ID is appropriate.

It's all detailed in Documentation/networking/phy.rst

What isn't documented there (and arguably should be) is if the MAC
adjusts its delays according to the PHY interface mode, then the MAC
should pass PHY_INTERFACE_MODE_RGMII to the PHY _irrespective_ of
which _ID/_TXID/ _RXID has been selected by firmware (since we don't
want the PHY to be adding its own delays if they've already been taken
care of by the MAC.)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!