mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yangfl <mmyangfl@gmail.com>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
	netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
	"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>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Simon Horman <horms@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v11 2/5] net: phy: introduce PHY_INTERFACE_MODE_REVSGMII
Date: Fri, 26 Sep 2025 18:09:10 +0200	[thread overview]
Message-ID: <f7d78131-7425-487f-a8bb-ed747dd9a194@lunn.ch> (raw)
In-Reply-To: <CAAXyoMPmwvxsk0vMD5aUvx9ajbeAENtengzUgBteV_CFJoqXWg@mail.gmail.com>

> > > How does the databook describe reverse SGMII? How does it differ from
> > > SGMII?
> >
> > It doesn't describe "reverse SGMII". Instead, it describes:
> >
> > 1. The TC bit in the MAC configuration register, which makes the block
> >    transmit the speed and duplex from the MAC configuration register
> >    over RGMII, SGMII or SMII links (only, not 1000base-X.)
> >
> > 2. The SGMIIRAL bit in the PCS control register, which switches where
> >    the SGMII rate adapter layer takes its speed configuration from -
> >    either the incoming in-band tx_config_reg[15:0] word, or from the
> >    MAC configuration register. It is explicitly stated for this bit
> >    that it is for back-to-back MAC links, and as it's specific to
> >    SGMII, that means a back-to-back SGMII MAC link.
> >
> > Set both these bits while the MAC is configured for SGMII mode, and
> > you have a stmmac MAC which immitates a SGMII PHY as far as the
> > in-band tx_config_reg[15:0] word is concerned.
> 
> So any conclusion? Should I go on with REV*MII, or wait for (or write
> it myself) reverse-mode flag?

Sorry, i'm missing some context here.

Why do you actually need REVSGMII, or at least the concept?

REVMII is used when you connect one MAC to another. You need to
indicate one ends needs to play the PHY role. This is generally when
you connect a host MAC to an Ethernet switch, and you want the switch
to play the PHY role.

Now consider SGMII, when connecting a host MAC to a switch. Why would
you even use SGMII, 1000BaseX is the more logical choice. You don't
want the link to run at 100Mbps, or 10Mbps. The link between the host
and the switch should run as fast as possible. And 1000BaseX is
symmetrical, you don't need a REV concept.

Also, in these cases, stmmmac is on the host, not the switch, so it
will have the host role, leaving the switch to play 'PHY'. I'm not
sure you could even embedded stmmac in a switch, where it might want
to play 'PHY', because stmmac is software driven, where as a switch is
all hardware.

So the hardware supports reverse SGMII, but it is not clear to me why
you would want to use it.

	Andrew


  parent reply	other threads:[~2025-09-26 16:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 13:11 [PATCH net-next v11 0/5] net: dsa: yt921x: Add support for Motorcomm YT921x David Yang
2025-09-22 13:11 ` [PATCH net-next v11 1/5] dt-bindings: ethernet-phy: add reverse SGMII phy interface type David Yang
2025-09-23 13:46   ` Rob Herring (Arm)
2025-09-22 13:11 ` [PATCH net-next v11 2/5] net: phy: introduce PHY_INTERFACE_MODE_REVSGMII David Yang
2025-09-23 14:32   ` Maxime Chevallier
2025-09-24 17:50   ` Russell King (Oracle)
2025-09-24 18:41     ` Andrew Lunn
2025-09-24 19:18       ` Russell King (Oracle)
2025-09-26  6:30         ` Yangfl
2025-09-26  8:45           ` Russell King (Oracle)
2025-09-26 16:09           ` Andrew Lunn [this message]
2025-09-26 16:28             ` Yangfl
2025-09-26 18:06               ` Russell King (Oracle)
2025-09-22 13:11 ` [PATCH net-next v11 3/5] dt-bindings: net: dsa: yt921x: Add Motorcomm YT921x switch support David Yang
2025-09-22 13:11 ` [PATCH net-next v11 4/5] net: dsa: tag_yt921x: add support for Motorcomm YT921x tags David Yang
2025-09-22 13:11 ` [PATCH net-next v11 5/5] net: dsa: yt921x: Add support for Motorcomm YT921x David Yang
2025-09-24  0:47   ` Jakub Kicinski
2025-09-24 12:33     ` Yangfl
2025-09-25  0:35       ` Jakub Kicinski

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=f7d78131-7425-487f-a8bb-ed747dd9a194@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@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

all inboxes | Powered by JetHome®