Thread (79 messages) 79 messages, 6 authors, 2024-07-08

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

From: Andrew Lunn <andrew@lunn.ch>
Date: 2024-06-06 18:39:13

On Thu, Jun 06, 2024 at 07:27:52PM +0100, Russell King (Oracle) wrote:
On Wed, May 29, 2024 at 06:17:22PM +0800, Yanteng Si wrote:
quoted
 3. Our priv->dma_cap.pcs is false, so let's use PHY_INTERFACE_MODE_NA;
Useful to note.
quoted
 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.)
Just adding to this, the vast majority of systems default to the PHY
adding the delays. There are only a small number of systems with the
MAC adding the delays, even if many MACs have hardware to allow the
MAC to add the delays. Keeping things uniform just avoids problems, so
i always suggest the PHY should add the delay.

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help