[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <446fdadabfb852db3278553c5b6f8cbc003de5ea.camel@toradex.com>
Date: Wed, 29 Apr 2020 10:02:46 +0000
From: Philippe Schenker <philippe.schenker@...adex.com>
To: "geert@...ux-m68k.org" <geert@...ux-m68k.org>
CC: "andrew@...n.ch" <andrew@...n.ch>,
"linux@...linux.org.uk" <linux@...linux.org.uk>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"hkallweit1@...il.com" <hkallweit1@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"sergei.shtylyov@...entembedded.com"
<sergei.shtylyov@...entembedded.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"david@...tonic.nl" <david@...tonic.nl>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
"kazuya.mizuguchi.ks@...esas.com" <kazuya.mizuguchi.ks@...esas.com>
Subject: Re: [PATCH net-next v3] net: phy: micrel: add phy-mode support for
the KSZ9031 PHY
On Wed, 2020-04-29 at 10:45 +0200, Geert Uytterhoeven wrote:
> Hi Philippe,
>
> On Tue, Apr 28, 2020 at 6:16 PM Philippe Schenker
> <philippe.schenker@...adex.com> wrote:
> > On Tue, 2020-04-28 at 17:47 +0200, Andrew Lunn wrote:
> > > On Tue, Apr 28, 2020 at 05:28:30PM +0200, Geert Uytterhoeven
> > > wrote:
> > > > This triggers on Renesas Salvator-X(S):
> > > >
> > > > Micrel KSZ9031 Gigabit PHY e6800000.ethernet-ffffffff:00:
> > > > *-skew-ps values should be used only with phy-mode = "rgmii"
> > > >
> > > > which uses:
> > > >
> > > > phy-mode = "rgmii-txid";
> > > >
> > > > and:
> > > >
> > > > rxc-skew-ps = <1500>;
> > > >
> > > > If I understand Documentation/devicetree/bindings/net/ethernet-
> > > > controller.yaml
> > > > correctly:
> > >
> > > Checking for skews which might contradict the PHY-mode is new. I
> > > think
> > > this is the first PHY driver to do it. So i'm not too surprised it
> > > has
> > > triggered a warning, or there is contradictory documentation.
> > >
> > > Your use cases is reasonable. Have the normal transmit delay, and
> > > a
> > > bit shorted receive delay. So we should allow it. It just makes
> > > the
> > > validation code more complex :-(
> >
> > I reviewed Oleksij's patch that introduced this warning. I just want
> > to
> > explain our thinking why this is a good thing, but yes maybe we
> > change
> > that warning a little bit until it lands in mainline.
> >
> > The KSZ9031 driver didn't support for proper phy-modes until now as
> > it
> > don't have dedicated registers to control tx and rx delays. With
> > Oleksij's patch this delay is now done accordingly in skew registers
> > as
> > best as possible. If you now also set the rxc-skew-ps registers
> > those
> > values you previously set with rgmii-txid or rxid get overwritten.
> >
> > We chose the warning to occur on phy-modes 'rgmii-id', 'rgmii-rxid'
> > and
> > 'rgmii-txid' as on those, with the 'rxc-skew-ps' value present,
> > overwriting skew values could occur and you end up with values you
> > do
> > not wanted. We thought, that most of the boards have just 'rgmii'
> > set in
> > phy-mode with specific skew-values present.
> >
> > @Geert if you actually want the PHY to apply RXC and TXC delays just
> > insert 'rgmii-id' in your DT and remove those *-skew-ps values. If
> > you
>
> That seems to work for me, but of course doesn't take into account PCB
> routing.
>
> > need custom timing due to PCB routing it was thought out to use the
> > phy-
> > mode 'rgmii' and do the whole required timing with the *-skew-ps
> > values.
>
> That mean we do have to provide all values again?
In the case that you have not length-matched rgmii signals on the PCB I
would advise you to check the skew settings closely. Otherwise you might
end up with values that work on the border and may fail on the full
temperature-range.
If the length is not off by huge amounts, rgmii-id
should work fine.
> Using "rgmii" without any skew values makes DHCP fail on R-Car H3
> ES2.0,
That sounds like the R-Car H3 ES2.0 is not providing a RXC delay.
> M3-W (ES1.0), and M3-N (ES1.0). Interestingly, DHCP still works on R-
> Car
> H3 ES1.0.
>
> Note that I'm not too-familiar with the actual skew values needed
> (CC Mizuguchi-san).
>
> Related commits:
> - 0e45da1c6ea6b186 ("arm64: dts: r8a7795: salvator-x: Fix
> EthernetAVB PHY timing")
> - dda3887907d74338 ("arm64: dts: r8a7795: Use rgmii-txid phy-mode
> for EthernetAVB")
> - 7eda14afb8843a0d ("arm64: dts: renesas: r8a77990: ebisu: Fix
> EthernetAVB phy mode to rgmii")
>
> Thanks!
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
> geert@...ux-m68k.org
>
> In personal conversations with technical people, I call myself a
> hacker. But
> when I'm talking to journalists I just say "programmer" or something
> like that.
> -- Linus Torvalds
Powered by blists - more mailing lists