netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Eichenberger <eichest@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, robh@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	lxu@maxlinear.com, hkallweit1@gmail.com, linux@armlinux.org.uk,
	michael@walle.cc, netdev@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] net: phy: mxl-gpy: add new device tree property to disable SGMII autoneg
Date: Tue, 16 Apr 2024 17:43:16 +0200	[thread overview]
Message-ID: <Zh6clAtI3NO+nMEi@eichest-laptop> (raw)
In-Reply-To: <3f7f278f-e490-47f1-971c-ecf44a70cee4@lunn.ch>

Hi Andrew,

Thanks a lot for the feedback.

On Tue, Apr 16, 2024 at 03:46:19PM +0200, Andrew Lunn wrote:
> On Tue, Apr 16, 2024 at 02:10:32PM +0200, Stefan Eichenberger wrote:
> > Add a new device tree property to disable SGMII autonegotiation and
> > instead use the option to match the SGMII speed to what was negotiated
> > on the twisted pair interface (tpi).
> 
> Could you explain this is more detail.
> 
> SGMII always runs its clocks at 1000Mbps. The MAC needs to duplicate
> the symbols 100 times when running at 10Mbs, and 10 times when running
> at 100Mbps.

Currently, the mxl-gpy driver uses SGMII autonegotiation for 10 Mbps,
100 Mbps, and 1000 Mbps. For our Ethernet controller, which is on an
Octeon TX2 SoC, this means that we have to enable "in-band-status" on
the controller. This will work for all three speed settings. However, if
we have a link partner that can do 2.5 Gbps, the mxl-gpy driver will
disable SGMII autonegotiation in gpy_update_interface. This is not
supported by this Ethernet controller because in-band-status is still
enabled. Therefore, we will not be able to transfer data at 2.5 Gbps,
the SGMII link will not go into a working state.

What this patch does is, if the maxlinear,sgmii-match-tpi-speed property
is set, it will always use the link speed negotiated on the twisted pair
interface and adjust the SGMII data rate accordingly. For the Octeon
controller, this means that we don't set the in-band-status mode because
we don't use the SGMII autnegotiation and all 4 speeds (10, 100, 1000,
2500 Mbps) are working.

Here the description from the datasheet (this patch forces the SGMII
speed to the TPI speed):
If bit 12 is set to a logic one, ANMODE field determines the Auto-
Negotiation protocol. If bit 12 is cleared to a logic zero, speed is set
to maximum in full duplex mode. Once the TPI link is up, the SGMII speed
is automatically forced to match the TPI speed. This bit has no effect
when SGMII_FIXED2G5 is ‘1’.

Best regards,
Stefan

  reply	other threads:[~2024-04-16 15:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:10 [RFC PATCH 0/2] mxl-gpy: add option to match SGMII speed to the TPI speed Stefan Eichenberger
2024-04-16 12:10 ` [RFC PATCH 1/2] dt-bindings: net: phy: gpy2xx: add sgmii-match-tpi-speed property Stefan Eichenberger
2024-04-16 12:10 ` [RFC PATCH 2/2] net: phy: mxl-gpy: add new device tree property to disable SGMII autoneg Stefan Eichenberger
2024-04-16 13:46   ` Andrew Lunn
2024-04-16 15:43     ` Stefan Eichenberger [this message]
2024-04-16 15:48       ` Russell King (Oracle)
2024-04-16 16:00         ` Russell King (Oracle)
2024-04-16 16:02       ` Andrew Lunn
2024-04-16 16:24         ` Russell King (Oracle)
2024-04-16 17:23           ` Stefan Eichenberger
2024-04-16 18:12             ` Russell King (Oracle)
2024-04-17  7:22               ` Stefan Eichenberger
2024-04-18 15:01                 ` Russell King (Oracle)
2024-04-24 14:58                   ` Russell King (Oracle)
2024-04-24 15:56                     ` Stefan Eichenberger
2024-04-24 18:13                       ` Russell King (Oracle)
2024-04-25 11:24                         ` Stefan Eichenberger
2024-04-25 14:30                           ` Russell King (Oracle)
2024-04-25 15:51                             ` Stefan Eichenberger
2024-04-25 16:30                               ` Russell King (Oracle)
2024-04-25 17:33                                 ` Stefan Eichenberger
2024-04-25 20:15                                   ` Russell King (Oracle)
2024-05-02 13:44                                     ` Stefan Eichenberger
2024-05-02 14:14                                       ` Russell King (Oracle)
2024-05-03 16:35                                         ` Stefan Eichenberger
2024-05-03 22:41                                           ` Russell King (Oracle)
2024-05-06 12:29                                             ` Stefan Eichenberger
2024-04-23 13:23   ` Simon Horman

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=Zh6clAtI3NO+nMEi@eichest-laptop \
    --to=eichest@gmail.com \
    --cc=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=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lxu@maxlinear.com \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).