All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.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
Subject: Re: [PATCH net-next] net: dsa: mark parsed interface mode for legacy switch drivers
Date: Mon, 14 Aug 2023 19:05:19 +0200	[thread overview]
Message-ID: <8687110a-5ce8-474c-8c20-ca682a98a94c@lunn.ch> (raw)
In-Reply-To: <ZNpWAsdS8tDv9qKp@shell.armlinux.org.uk>

> > RGMII on both ends is unlikely to work, so probably one is
> > wrong. Probably the switch has strapping to set it to rgmii-id, but we
> > don't actually know that. And i guess we have no ability to find out
> > the truth?
> 
> "rgmii" on both ends _can_ work - from our own documentation:
> 
> * PHY_INTERFACE_MODE_RGMII: the PHY is not responsible for inserting any
>   internal delay by itself, it assumes that either the Ethernet MAC (if capable)
>   or the PCB traces insert the correct 1.5-2ns delay
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> So, if the board is correctly laid out to include this delay, then RGMII
> on both ends can work.

Yes, which is why is said 'unlikely', not 'will not'. I've not come
across many boards which do have extra long clock tracks, so it is
unlikely this board has them. It is much more likely to be strapped to
do rgmii-id.

> Next, we have no ability to find anything out - we have no hardware.
> LinusW does, but I have no idea whether Linus can read the state of the
> pin strapping. I can see from the RTL8366 info I found that there is
> a register that the delay settings can be read from, but this is not
> the RTL8366, it's RTL8366RB, which Linus already pointed out is
> revision B and is different. So, I would defer to Linus for anything on
> this, and without input from Linus, all we have to go on is what we
> have in the kernel sources.
> 
> > So a narrow definition seems reasonable at the moment, to raise a red
> > warning flag if somebody does try to use rgmii-id which is not
> > actually implemented in the driver. And that user then gets to sort
> > out the problem.
> 
> I think Vladimir will be having a party, because that's now two of us
> who've made the mistake of infering that "phy-mode" changes the
> configuration at the end that has that specified (I can hear the
> baloons being inflated!)
> 
> Of course it shouldn't, as per our documentation on RGMII delays in
> Documentation/networking/phy.rst that was added by Florian back in
> November 2016.

It might not be documented, but there are a couple of DSA drivers
which do react on this property and set their RGMII delays based on
this for their CPU port. mv88e6xxx is one of them, and it also does so
for DSA ports. 

> This brings up the obvious question: does anyone deal with the RGMII
> delays with DSA switches in software, or is it all done by hardware
> pin strapping, hardware defaults, and/or a correctly laid out PCB?

arch/arm/boot/dts/nxp/vf/vf610-zii-dev-rev-b.dts:
                                       switch0port5: port@5 {
                                                reg = <5>;
                                                label = "dsa";
                                                phy-mode = "rgmii-txid";
                                                link = <&switch1port6
                                                        &switch2port9>;
                                                fixed-link {
                                                        speed = <1000>;
                                                        full-duplex;
                                                };
                                        };

and the other end of this link:

                                        switch1port6: port@6 {
                                                reg = <6>;
                                                label = "dsa";
                                                phy-mode = "rgmii-txid";
                                                link = <&switch0port5>;
                                                fixed-link {
                                                        speed = <1000>;
                                                        full-duplex;
                                                };
                                        };

imx7d-zii-rpu2.dts:
                                port@5 {
                                        reg = <5>;
                                        label = "cpu";
                                        ethernet = <&fec1>;
                                        phy-mode = "rgmii-id";

                                        fixed-link {
                                                speed = <1000>;
                                                full-duplex;
                                        };
                                };

With the 'cpu' case, it is clearly acting like a PHY to the SoCs MAC,
so it does not seem too unreasonable for it to act upon it. For a DSA
link there is not a clear MAC-PHY relationship, but we do somehow need
to specify delays.

	Andrew

  reply	other threads:[~2023-08-14 17:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 11:12 [PATCH net-next] net: dsa: mark parsed interface mode for legacy switch drivers Russell King (Oracle)
2023-08-08 12:06 ` Vladimir Oltean
2023-08-08 12:30   ` Russell King (Oracle)
2023-08-08 12:39     ` Vladimir Oltean
2023-08-08 12:57       ` Russell King (Oracle)
2023-08-08 13:52         ` Vladimir Oltean
2023-08-08 14:19           ` Russell King (Oracle)
2023-08-10 15:16             ` Vladimir Oltean
2023-08-12 12:16               ` Russell King (Oracle)
2023-08-13 10:50                 ` Vladimir Oltean
2023-08-13 21:56                 ` Linus Walleij
2023-08-13 22:17                   ` Russell King (Oracle)
2023-08-15  6:41                   ` Linus Walleij
2023-08-14 14:59                 ` Vladimir Oltean
2023-08-14 15:12                   ` Russell King (Oracle)
2023-08-14 15:46                     ` Andrew Lunn
2023-08-14 16:27                       ` Russell King (Oracle)
2023-08-14 17:05                         ` Andrew Lunn [this message]
2023-08-14 22:03                           ` Russell King (Oracle)
2023-08-14 23:33                             ` Andrew Lunn
2023-08-15 10:13                             ` Russell King (Oracle)
2023-08-17 18:01                               ` Vladimir Oltean
2023-08-17 18:19                             ` Vladimir Oltean
2023-08-17 18:27                           ` Vladimir Oltean
2023-08-17 18:52                             ` Andrew Lunn
2023-08-17 19:17                               ` Vladimir Oltean
2023-08-18 11:11                                 ` Russell King (Oracle)
2023-08-18 11:40                                   ` Vladimir Oltean
2023-08-18 13:08                                     ` Linus Walleij
2023-08-18 13:29                                       ` Russell King (Oracle)
2023-08-18 16:06                                         ` Linus Walleij
2023-08-18 13:44                                       ` Vladimir Oltean
2023-08-18 13:10                                     ` Russell King (Oracle)
2023-08-18 14:21                                       ` Vladimir Oltean
2023-08-18 16:49                                         ` Vladimir Oltean
2023-08-14 22:21                         ` Linus Walleij
2023-08-14 15:47                     ` Vladimir Oltean
2023-08-08 16:35         ` Andrew Lunn
2023-08-08 12:39 ` Vladimir Oltean
2023-08-09 20:20 ` 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=8687110a-5ce8-474c-8c20-ca682a98a94c@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.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.