Subject: Re: [PATCH net-next 4/8] net: dsa: lan9645x: add basic dsa driver for LAN9645X

From: Alexander Stein <[email-masked]>
Date: Thu, 05 Mar 2026 17:54:20 +0100

Hi,

Am Donnerstag, 5. März 2026, 15:58:16 CET schrieb Andrew Lunn:
> > > > +     /* We configure delays on the MAC side. When the PHY is not responsible
> > > > +      * for delays, the MAC is, which is why RGMII_TXID results in
> > > > +      * rx_delay=true.
> > > > +      */
> > > > +     if (mode == PHY_INTERFACE_MODE_RGMII ||
> > > > +         mode == PHY_INTERFACE_MODE_RGMII_TXID)
> > > > +             rx_delay = true;
> > > > +
> > > > +     if (mode == PHY_INTERFACE_MODE_RGMII ||
> > > > +         mode == PHY_INTERFACE_MODE_RGMII_RXID)
> > > > +             tx_delay = true;
> > > 
> > > PHY_INTERFACE_MODE_RGMII means that the delays are provided by the
> > > board layout, so this seems wrong to me. Please review the phylib
> > > documentation concerning RGMII delays. I'd like Andrew to comment on
> > > this too.
> > > 
> > 
> > The idea with this was, if the PHY does not provide internal delay, then
> > we do it in the MAC.
> 
> That is not really what we want. The default in Linux is that the PHY
> adds the delays. In general, MAC drivers read the phy-mode, and pass
> it directly to the PHY. The MAC does not add delays. There are a small
> number of boards which don't respect this. In the past, there was been
> claims that an RDK used a PHY which was not capable of adding the
> needed delays, so the MAC had to. In practice, all the PHY drivers in
> linux which supporting RGMII support all four configurations of
> delays.
> 
> So, the best thing to do is hard code the delays in the MAC to 0, and
> pass phy-mode to the PHY.
> 
> Now, this is a switch, so there is one complexity. Some switches make
> use of an RGMII port to connect to the host. You then have the host
> RGMII MAC connected to the switch RGMII MAC. Delays have to be added
> somewhere. Since the switch MAC is playing the role of the PHY, in the
> eyes of the host, we allow such a port to add delays.
> 
> However, this is a multi-giga switch, with high speed SERDES ports. My
> guess is, a SERDES port is used to connect to the host, not RGMII. So
> i would not implement this, until somebody reports having a board with
> RGMII connecting to the host. KISS.

We intend to do exactly that with this switch, just because the host
doesn't support SGMII, just RMII/RGMII.

Best regards,
Alexander
-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/