netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Madalin Bucur <madalin.bucur@nxp.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@armlinux.org.uk>,
	Igal Liberman <Igal.Liberman@freescale.com>,
	Shruti Kanetkar <Shruti@freescale.com>,
	Emil Medve <Emilian.Medve@freescale.com>,
	Scott Wood <oss@buserror.net>, Rob Herring <robh+dt@kernel.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Camelia Alexandra Groza (OSS)" <camelia.groza@oss.nxp.com>
Subject: Re: Unsupported phy-connection-type sgmii-2500 in arch/powerpc/boot/dts/fsl/t1023rdb.dts
Date: Sat, 5 Jun 2021 01:34:55 +0200	[thread overview]
Message-ID: <20210604233455.fwcu2chlsed2gwmu@pali> (raw)
In-Reply-To: <AM6PR04MB39760B986E86BA9169DEECC5EC3B9@AM6PR04MB3976.eurprd04.prod.outlook.com>

On Friday 04 June 2021 21:47:26 Madalin Bucur wrote:
> > -----Original Message-----
> > From: Andrew Lunn <andrew@lunn.ch>
> > Sent: 04 June 2021 23:24
> > To: Madalin Bucur <madalin.bucur@nxp.com>
> > Cc: Russell King <linux@armlinux.org.uk>; Pali Rohár <pali@kernel.org>;
> > Igal Liberman <Igal.Liberman@freescale.com>; Shruti Kanetkar
> > <Shruti@freescale.com>; Emil Medve <Emilian.Medve@freescale.com>; Scott
> > Wood <oss@buserror.net>; Rob Herring <robh+dt@kernel.org>; Michael
> > Ellerman <mpe@ellerman.id.au>; Benjamin Herrenschmidt
> > <benh@kernel.crashing.org>; netdev@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Camelia
> > Alexandra Groza (OSS) <camelia.groza@oss.nxp.com>
> > Subject: Re: Unsupported phy-connection-type sgmii-2500 in
> > arch/powerpc/boot/dts/fsl/t1023rdb.dts
> > 
> > > The "sgmii-2500" compatible in that device tree describes an SGMII HW
> > > block, overclocked at 2.5G. Without that overclocking, it's a plain
> > > Cisco (like) SGMII HW block. That's the reason you need to disable it's
> > > AN setting when overclocked. With the proper Reset Configuration Word,
> > > you could remove the overclocking and transform that into a plain
> > "sgmii".
> > > Thus, the dts compatible describes the HW, as it is.
> > 
> > It sounds like the hardware is capable of swapping between SGMII and
> > 2500BaseX.
> > 
> > What we have in DT in this case is not describing the hardware, but
> > how we configure the hardware. It is one of the few places we abuse DT
> > for configuration.
> > 
> >     Andrew
> 
> The actual selection of this mode of operation is performed by the so called
> Reset Configuration Word from the boot media, that aligned with the HW and
> board design. The need to name it something other than plain "sgmii" comes
> from the HW special need for AN to be disabled to operate.
> 
> Actually, the weird/non-standard hardware is described by the device tree
> with a value that puts it in a class of its own. Instead of the overclocked
> SGMII denomination "sgmii-2500" it could have been named just as well
> "overclocked-nonstandard-2.5G-ethernet-no-autoneg-SGMII-hw-ip".
> 
> One could try to change device trees to slip configuration details, but the
> backwards compatibility aspect renders this futile. Is there any option to
> say "sgmii" then "autoneg disabled"?
> 
> Madalin

Madalin, my understanding is that "sgmii-2500" mode is unknown and
unsupported by kernel.

List of known modes which can be specified in DTS file are defined in
YAML schema for 'phy-connection-type' in file:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml?h=v5.12#n55

And there is none "sgmii-2500", so some DTS schema validator could throw
validation error for that DTS file. I'm not sure if somebody has written
DTS schema validator with all those things (like there are JSON schema
or OpenAPI validators in JavaScript / HTTP world).

Plus also in linux/phy.h header file contains list of known Linux modes:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/phy.h?h=v5.12#n169

And based on all information in this email discussion, in my opinion the
mode which HW supports matches Linux meaning of "2500base-x" key/string.
So I would suggest to rename "sgmii-2500" in that DTS file to
"2500base-x". Does it make sense?



But as this is really confusing what each mode means for Linux, I would
suggest that documentation for these modes in ethernet-controller.yaml
file (or in any other location) could be extended. I see that it is
really hard to find exact information what these modes mean and what is
their meaning in DTS / kernel.

  reply	other threads:[~2021-06-04 23:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 14:34 Unsupported phy-connection-type sgmii-2500 in arch/powerpc/boot/dts/fsl/t1023rdb.dts Pali Rohár
2021-06-03 15:12 ` Andrew Lunn
2021-06-03 19:48   ` Pali Rohár
2021-06-04  7:35     ` Madalin Bucur
2021-06-04 17:32       ` Pali Rohár
2021-06-04 19:13         ` Madalin Bucur
2021-06-04 19:27       ` Russell King (Oracle)
2021-06-04 19:39         ` Madalin Bucur
2021-06-04 20:00           ` Russell King (Oracle)
2021-06-04 21:37             ` Madalin Bucur
2021-06-04 20:23           ` Andrew Lunn
2021-06-04 21:47             ` Madalin Bucur
2021-06-04 23:34               ` Pali Rohár [this message]
2021-06-05  0:33                 ` Russell King (Oracle)
2021-06-05 12:26                   ` Vladimir Oltean
2021-06-05 12:50                     ` What is inside GPON SFP module? (Was: Re: Unsupported phy-connection-type sgmii-2500 in arch/powerpc/boot/dts/fsl/t1023rdb.dts) Pali Rohár
2021-06-05 13:04                       ` Hauke Mehrtens
2021-06-05 13:31                         ` What is inside GPON SFP module? Pali Rohár
2021-06-05 14:17                           ` Hauke Mehrtens
2021-06-05 14:41                         ` What is inside GPON SFP module? (Was: Re: Unsupported phy-connection-type sgmii-2500 in arch/powerpc/boot/dts/fsl/t1023rdb.dts) Russell King (Oracle)
2021-06-08 10:33                           ` What is inside GPON SFP module? Pali Rohár
2021-06-19 20:35                 ` Unsupported phy-connection-type sgmii-2500 in arch/powerpc/boot/dts/fsl/t1023rdb.dts Pali Rohár
2021-07-04 13:43                 ` [PATCH] powerpc/fsl/dts: Fix phy-connection-type for fm1mac3 Pali Rohár
2021-07-14 17:11                   ` Scott Wood
2021-08-27 11:38                     ` Pali Rohár
2021-09-28 21:39                       ` Pali Rohár
2021-09-29 14:25                         ` Andrew Lunn
2021-10-02  9:06                           ` Pali Rohár
2021-06-04 23:18         ` Unsupported phy-connection-type sgmii-2500 in arch/powerpc/boot/dts/fsl/t1023rdb.dts Pali Rohár

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=20210604233455.fwcu2chlsed2gwmu@pali \
    --to=pali@kernel.org \
    --cc=Emilian.Medve@freescale.com \
    --cc=Igal.Liberman@freescale.com \
    --cc=Shruti@freescale.com \
    --cc=andrew@lunn.ch \
    --cc=benh@kernel.crashing.org \
    --cc=camelia.groza@oss.nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=madalin.bucur@nxp.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=oss@buserror.net \
    --cc=robh+dt@kernel.org \
    /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).