From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [net-next,v2] net: ethernet: rtsn: Add support for Renesas Ethernet-TSN
Date: Wed, 8 May 2024 13:07:29 +0200 [thread overview]
Message-ID: <20240508110729.GD1385281@ragnatech.se> (raw)
In-Reply-To: <2cd13d49-6b9f-4ce8-ba4e-ca02b4568842@lunn.ch>
On 2024-05-08 02:35:27 +0200, Andrew Lunn wrote:
> > > This looks wrong. You should be applying delays for rgmii-id and
> > > rgmii-rxid. Plain rgmii means no delays are required, because the
> > > board has extra long clock lines. Same for TX delays, only for
> > > rgmii-tx or rgmii-id.
> >
> > This confuses me a bit, from the bindings in ethernet-controller.yaml I
> > get this the other way around,
> >
> > # RX and TX delays are added by the MAC when required
> > - rgmii
> >
> > # RGMII with internal RX and TX delays provided by the PHY,
> > # the MAC should not add the RX or TX delays in this case
> > - rgmii-id
> >
> > # RGMII with internal RX delay provided by the PHY, the MAC
> > # should not add an RX delay in this case
> > - rgmii-rxid
> >
> > # RGMII with internal TX delay provided by the PHY, the MAC
> > # should not add an TX delay in this case
> > - rgmii-txid
> >
> > The way I understand it is that if if the phy-mode is 'rgmii' the MAC
> > shall apply delays if requested and only if the phy-mode is 'rgmii-id'
> > shall the MAC completely ignore the delays and let the PHY handle it.
>
> It is confusing, and made worse by you doing different to normal and
> implementing it in the MAC, not the PHY.
>
> 1% of boards use extra long clock lines, so don't need additional
> delays. They use 'rgmii'. There is at least one board i know of which
> has one extra long clock line, and one normal length clock line. That
> board uses 'rgmii-txid', or 'rgmii-rxid', i don't remember which. The
> other 98% of boards should be using 'rgmii-id', indicating something
> needs to insert delays. Of those 98%, the vast majority pass phy-mode
> straight to the PHY, and the PHY added delays in both the Rx and Tx
> clock. If the MAC decides to add the delays, and it is 'rgmii-id', it
> should enable delays for both clock lines, and pass 'rgmii' to the
> PHY. In the unlikely event somebody builds one of those 2% boards
> using the MAC, you need to enable just Rx delays, or just Tx delays,
> or maybe no delay at all, because of extra long clock lines. But you
> should still be passing 'rgmii' to the PHY.
Thanks for your patience and this explanation, I understand now.
>
> > Just so I understand correctly, if the phy-mode is A I should pass B to
> > of_phy_connect() if I apply the delays in the MAC.
> >
> > A B
> > rgmii rgmii-id
> > rgmii-id rgmii
> > rgmii-rxid rgmii-txid
> > rgmii-txid rgmii-rxid
>
> Nope. Since the MAC is doing the delay, you always pass rgmii to the
> PHY. A determines what, if any, delays the MAC adds.
>
> Andrew
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2024-05-08 11:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-07 20:18 [net-next,v2] net: ethernet: rtsn: Add support for Renesas Ethernet-TSN Niklas Söderlund
2024-05-07 20:57 ` Andrew Lunn
2024-05-07 21:50 ` Niklas Söderlund
2024-05-08 0:35 ` Andrew Lunn
2024-05-08 11:07 ` Niklas Söderlund [this message]
2024-05-08 0:52 ` Andrew Lunn
2024-05-08 11:03 ` Niklas Söderlund
2024-05-08 0:55 ` Andrew Lunn
2024-05-08 10:58 ` Niklas Söderlund
2024-05-08 12:33 ` Andrew Lunn
2024-05-08 12:55 ` Niklas Söderlund
2024-05-08 14:00 ` Andrew Lunn
2024-05-08 15:10 ` Niklas Söderlund
2024-05-08 15:29 ` Geert Uytterhoeven
2024-05-08 17:36 ` Andrew Lunn
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=20240508110729.GD1385281@ragnatech.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yoshihiro.shimoda.uh@renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.