From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Andy Whitcroft <apw@canonical.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Joe Perches <joe@perches.com>, Jonathan Corbet <corbet@lwn.net>,
Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
Siddharth Vadapalli <s-vadapalli@ti.com>,
Roger Quadros <rogerq@kernel.org>,
Tero Kristo <kristo@kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<devicetree@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <linux@ew.tq-group.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next v2 2/3] net: ethernet: ti: am65-cpsw: fixup PHY mode for fixed RGMII TX delay
Date: Thu, 26 Jun 2025 15:10:50 +0530 [thread overview]
Message-ID: <54d6cd05-65ef-4e1d-8041-3e4a2c50b443@ti.com> (raw)
In-Reply-To: <9b3fb1fbf719bef30702192155c6413cd5de5dcf.1750756583.git.matthias.schiffer@ew.tq-group.com>
On Tue, Jun 24, 2025 at 12:53:33PM +0200, Matthias Schiffer wrote:
Hello Matthias,
> All am65-cpsw controllers have a fixed TX delay, so the PHY interface
> mode must be fixed up to account for this.
>
> Modes that claim to a delay on the PCB can't actually work. Warn people
> to update their Device Trees if one of the unsupported modes is specified.
>
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 27 ++++++++++++++++++++++--
> 1 file changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> index f20d1ff192efe..519757e618ad0 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
> @@ -2602,6 +2602,7 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common)
> return -ENOENT;
>
> for_each_child_of_node(node, port_np) {
> + phy_interface_t phy_if;
> struct am65_cpsw_port *port;
> u32 port_id;
>
> @@ -2667,14 +2668,36 @@ static int am65_cpsw_nuss_init_slave_ports(struct am65_cpsw_common *common)
>
> /* get phy/link info */
> port->slave.port_np = of_node_get(port_np);
> - ret = of_get_phy_mode(port_np, &port->slave.phy_if);
> + ret = of_get_phy_mode(port_np, &phy_if);
> if (ret) {
> dev_err(dev, "%pOF read phy-mode err %d\n",
> port_np, ret);
> goto of_node_put;
> }
>
> - ret = phy_set_mode_ext(port->slave.ifphy, PHY_MODE_ETHERNET, port->slave.phy_if);
> + /* CPSW controllers supported by this driver have a fixed
> + * internal TX delay in RGMII mode. Fix up PHY mode to account
> + * for this and warn about Device Trees that claim to have a TX
> + * delay on the PCB.
> + */
> + switch (phy_if) {
> + case PHY_INTERFACE_MODE_RGMII_ID:
> + phy_if = PHY_INTERFACE_MODE_RGMII_RXID;
> + break;
> + case PHY_INTERFACE_MODE_RGMII_TXID:
> + phy_if = PHY_INTERFACE_MODE_RGMII;
> + break;
> + case PHY_INTERFACE_MODE_RGMII:
> + case PHY_INTERFACE_MODE_RGMII_RXID:
> + dev_warn(dev,
> + "RGMII mode without internal TX delay unsupported; please fix your Device Tree\n");
Existing users designed boards and enabled Ethernet functionality using
"rgmii-rxid" in the device-tree and implementing the PCB traces in a
way that they interpret "rgmii-rxid". So their (mis)interpretation of
it is being challenged by the series. While it is true that we are updating
the bindings and driver to move towards the correct definition, I believe that
the above message would cause confusion. Would it be alright to update it to
something similar to:
"Interpretation of RGMII delays has been corrected; no functional impact; please fix your Device Tree"
Regards,
Siddharth.
next prev parent reply other threads:[~2025-06-26 9:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 10:53 [PATCH net-next v2 0/3] Follow-up to RGMII mode clarification: am65-cpsw fix + checkpatch Matthias Schiffer
2025-06-24 10:53 ` [PATCH net-next v2 1/3] dt-bindings: net: ti: k3-am654-cpsw-nuss: update phy-mode in example Matthias Schiffer
2025-06-26 9:25 ` Siddharth Vadapalli
2025-06-24 10:53 ` [PATCH net-next v2 2/3] net: ethernet: ti: am65-cpsw: fixup PHY mode for fixed RGMII TX delay Matthias Schiffer
2025-06-26 9:40 ` Siddharth Vadapalli [this message]
2025-06-26 11:58 ` Andrew Lunn
2025-06-26 12:00 ` Siddharth Vadapalli
2025-07-14 10:01 ` Michael Walle
2025-07-14 13:09 ` Andrew Lunn
2025-07-14 14:02 ` Michael Walle
2025-06-24 10:53 ` [PATCH net-next v2 3/3] checkpatch: check for comment explaining rgmii(|-rxid|-txid) PHY modes Matthias Schiffer
2025-06-26 8:02 ` Andrew Lunn
2025-06-26 8:11 ` Matthias Schiffer
2025-06-26 9:22 ` Joe Perches
2025-06-26 13:00 ` [PATCH net-next v2 0/3] Follow-up to RGMII mode clarification: am65-cpsw fix + checkpatch patchwork-bot+netdevbpf
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=54d6cd05-65ef-4e1d-8041-3e4a2c50b443@ti.com \
--to=s-vadapalli@ti.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=apw@canonical.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=dwaipayanray1@gmail.com \
--cc=edumazet@google.com \
--cc=joe@perches.com \
--cc=kristo@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@ew.tq-group.com \
--cc=lukas.bulwahn@gmail.com \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=nm@ti.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=rogerq@kernel.org \
--cc=vigneshr@ti.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).