linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan McDowell <noodles@earth.li>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: dsa: qca8k: introduce SGMII configuration options
Date: Sat, 6 Jun 2020 19:02:35 +0100	[thread overview]
Message-ID: <20200606180235.GO311@earth.li> (raw)
In-Reply-To: <20200606134356.GM1551@shell.armlinux.org.uk>

On Sat, Jun 06, 2020 at 02:43:56PM +0100, Russell King - ARM Linux admin wrote:
> On Sat, Jun 06, 2020 at 11:59:09AM +0100, Jonathan McDowell wrote:
> > So the device in question is a 7 port stand alone switch chip. There's a
> > single SGMII port which is configurable between port 0 + 6 (they can
> > also be configure up as RGMII, while the remaining 5 ports have their
> > own phys).
> > 
> > It sounds like there's a strong preference to try and auto configure
> > things as much as possible, so I should assume the CPU port is in MAC
> > mode, and anything not tagged as a CPU port is talking to a PHY/BASEX.
> > 
> > I assume I can use PHY_INTERFACE_MODE_1000BASEX on the
> > phylink_mac_config call to choose BASEX?
> 
> Yes, but from what you've mentioned above, I think I need to ensure that
> there's a proper understanding here.
> 
> 1000BASE-X is the IEEE 802.3 defined 1G single lane Serdes protocol.
> SGMII is different; it's a vendor derivative of 1000BASE-X which has
> become a de-facto standard.
> 
> Both are somewhat compatible with each other; SGMII brings with it
> additional data replication to achieve 100M and 10M speeds, while
> keeping the link running at 1.25Gbaud.  In both cases, there is a
> 16-bit "configuration" word that is passed between the partners.
> 
> 1000BASE-X uses this configuration word to advertise the abilities of
> each end, which is limited to duplex and pause modes only.  This you
> get by specifying the phy-mode="1000base-x" and
> managed="in-band-status" in DT.
> 
> SGMII uses this configuration word for the media side to inform the
> system side which mode it wishes to operate the link: the speed and
> duplex.  Some vendors extend it to include EEE parameters as well,
> or pause modes.  You get this via phy-mode="sgmii" and
> managed="in-band-status" in DT.
> 
> Then there are variants where the configuration word is not present.
> In this case, the link has to be manually configured, and without the
> configuration word, SGMII operating at 1G is compatible with
> 1000base-X operating at 1G.  Fixed-link can be used for this, although
> fixed-link will always report that the link is up at the moment; that
> may change in the future, it's something that is being looked into at
> the moment.

The hardware I'm using has the switch connected to the CPU via the SGMII
link, and all instances I can find completely disable inband
configuration for that case. However the data sheet has an SGMII control
register which allows configuration of the various auto-negotiation
parameters (as well as whether we're base-x or sgmii) so I think the
full flexibility is there.

I've got an initial port over to using phylink and picking up the
parameters that way (avoiding any device tree option changes) that seems
to be working, but I'll do a bit more testing before sending out a v2
RFC.

J.

-- 
/-\                             | There are always at least two ways
|@/  Debian GNU/Linux Developer |     to program the same thing.
\-                              |

  reply	other threads:[~2020-06-06 18:04 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 18:08 [PATCH 0/2] net: dsa: qca8k: Add SGMII configuration options Jonathan McDowell
2020-06-05 18:10 ` [PATCH 1/2] dt-bindings: net: dsa: qca8k: document SGMII properties Jonathan McDowell
2020-06-15 17:45   ` Rob Herring
2020-06-15 18:15     ` Jonathan McDowell
2020-06-05 18:10 ` [PATCH 2/2] net: dsa: qca8k: introduce SGMII configuration options Jonathan McDowell
2020-06-05 18:28   ` Marek Behun
2020-06-05 18:38   ` Andrew Lunn
2020-06-06  7:49     ` Jonathan McDowell
2020-06-06  8:37       ` Russell King - ARM Linux admin
2020-06-06 10:59         ` Jonathan McDowell
2020-06-06 13:43           ` Russell King - ARM Linux admin
2020-06-06 18:02             ` Jonathan McDowell [this message]
2020-06-06 14:03           ` Andrew Lunn
2020-06-08 18:39           ` [RFC PATCH v2] net: dsa: qca8k: Improve SGMII interface handling Jonathan McDowell
2020-06-08 19:10             ` Russell King - ARM Linux admin
2020-06-10 19:13             ` [RFC PATCH v3 0/2] " Jonathan McDowell
2020-06-10 19:14               ` [PATCH 1/2] net: dsa: qca8k: Switch to PHYLINK instead of PHYLIB Jonathan McDowell
2020-06-11  3:15                 ` Florian Fainelli
2020-06-11  8:55                 ` Russell King - ARM Linux admin
2020-06-11  9:01                   ` Vladimir Oltean
2020-06-12 11:53                   ` Jonathan McDowell
2020-06-11  8:58                 ` Vladimir Oltean
2020-06-11 11:04                   ` Jonathan McDowell
2020-06-10 19:15               ` [PATCH 2/2] net: dsa: qca8k: Improve SGMII interface handling Jonathan McDowell
2020-06-11  3:31                 ` Florian Fainelli
2020-06-11 17:47                   ` Jonathan McDowell
2020-06-11  8:58                 ` Russell King - ARM Linux admin
2020-06-10 23:29               ` [RFC PATCH v3 0/2] " David Miller
2020-06-13 11:31               ` [RFC PATCH v4 " Jonathan McDowell
2020-06-13 11:31                 ` [RFC PATCH v4 1/2] net: dsa: qca8k: Switch to PHYLINK instead of PHYLIB Jonathan McDowell
2020-06-13 19:30                   ` Vladimir Oltean
2020-06-13 11:32                 ` [RFC PATCH v4 2/2] net: dsa: qca8k: Improve SGMII interface handling Jonathan McDowell
2020-06-13 20:10                   ` Vladimir Oltean
2020-06-14 17:20                     ` Jonathan McDowell
2020-06-20 10:30               ` [PATCH net-next v5 0/3] " Jonathan McDowell
2020-06-20 10:30                 ` [PATCH net-next v5 1/3] net: dsa: qca8k: Switch to PHYLINK instead of PHYLIB Jonathan McDowell
2020-06-20 10:31                 ` [PATCH net-next v5 2/3] net: dsa: qca8k: Improve SGMII interface handling Jonathan McDowell
2020-06-20 10:31                 ` [PATCH net-next v5 3/3] net: dsa: qca8k: Minor comment spelling fix Jonathan McDowell
2020-06-22 22:54                 ` [PATCH net-next v5 0/3] net: dsa: qca8k: Improve SGMII interface handling David Miller
2020-06-19  8:12   ` [PATCH 2/2] net: dsa: qca8k: introduce SGMII configuration options Dan Carpenter

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=20200606180235.GO311@earth.li \
    --to=noodles@earth.li \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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).