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,v4] net: ethernet: rtsn: Add support for Renesas Ethernet-TSN
Date: Thu, 9 May 2024 23:03:44 +0200 [thread overview]
Message-ID: <20240509210344.GL1385281@ragnatech.se> (raw)
In-Reply-To: <0d7b04a6-9f5b-41c7-bd52-890521019f8d@lunn.ch>
On 2024-05-09 22:25:27 +0200, Andrew Lunn wrote:
> > +static void rtsn_set_delay_mode(struct rtsn_private *priv)
> > +{
> > + struct device_node *np = priv->ndev->dev.parent->of_node;
> > + u32 delay;
> > + u32 val;
> > +
> > + val = 0;
> > +
> > + /* The MAC is capable of applying a delay on both Rx and Tx. Each
> > + * delay can either be on or off, there is no way to set its length.
> > + *
> > + * The exact delay applied depends on electric characteristics of the
> > + * board. The datasheet describes a typical Rx delay of 1800 ps and a
> > + * typical Tx delay of 2000 ps.
> > + *
> > + * There are boards where the RTSN device is used together with PHYs
> > + * who do not support a large enough internal delays to function. These
> > + * boards depends on the MAC applying these inexact delays.
> > + */
> > +
> > + /* If the phy-mode is rgmii or rgmii-rxid apply Rx delay on the MAC */
> > + if (priv->iface == PHY_INTERFACE_MODE_RGMII_ID ||
> > + priv->iface == PHY_INTERFACE_MODE_RGMII_RXID)
> > + if (!of_property_read_u32(np, "rx-internal-delay-ps", &delay))
> > + if (delay)
> > + val |= GPOUT_RDM;
> > +
> > + /* If the phy-mode is rgmii or rgmii-txid apply Tx delay on the MAC */
> > + if (priv->iface == PHY_INTERFACE_MODE_RGMII_ID ||
> > + priv->iface == PHY_INTERFACE_MODE_RGMII_TXID)
> > + if (!of_property_read_u32(np, "tx-internal-delay-ps", &delay))
> > + if (delay)
> > + val |= GPOUT_TDM;
>
> Much better, but still not correct. rx-internal-delay-ps and
> tx-internal-delay-ps is meant for fine tuning the delays, generally in
> steps of a few 10ps. It is applied unconditionally, since it is just a
> fine tune.
>
> You hardware does not support fine tuning, just 1800/2000ps. So it
> makes no sense to use these DT properties. Just enable GPOUT_RDM or
> GPOUT_TDM as appropriate for PHY_INTERFACE_MODE_*.
I will address this and send a new version. Thanks for checking this.
>
> Andrew
>
> ---
> pw-bot: cr
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2024-05-09 21:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 9:52 [net-next,v4] net: ethernet: rtsn: Add support for Renesas Ethernet-TSN Niklas Söderlund
2024-05-09 20:25 ` Andrew Lunn
2024-05-09 21:03 ` Niklas Söderlund [this message]
2024-05-09 21:12 ` Andrew Lunn
2024-05-09 22:07 ` Niklas Söderlund
2024-05-10 12:38 ` 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=20240509210344.GL1385281@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 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).