From: Andrew Lunn <andrew@lunn.ch>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: davem@davemloft.net, "Jakub Kicinski" <kuba@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Russell King" <linux@armlinux.org.uk>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
thomas.petazzoni@bootlin.com,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Köry Maincent" <kory.maincent@bootlin.com>,
"Simon Horman" <horms@kernel.org>,
"Romain Gantois" <romain.gantois@bootlin.com>,
"Antoine Tenart" <atenart@kernel.org>,
"Marek Behún" <kabel@kernel.org>,
"Sean Anderson" <sean.anderson@linux.dev>,
"Bjørn Mork" <bjorn@mork.no>
Subject: Re: [PATCH net-next v3 0/2] net: phy: sfp: Add single-byte SMBus SFP access
Date: Tue, 18 Mar 2025 13:21:07 +0100 [thread overview]
Message-ID: <b199d9e2-1b95-468a-b826-08abe1795557@lunn.ch> (raw)
In-Reply-To: <20250318092551.3beed50d@fedora.home>
On Tue, Mar 18, 2025 at 09:25:51AM +0100, Maxime Chevallier wrote:
> Hello Andrew,
>
> On Mon, 17 Mar 2025 22:34:09 +0100
> Andrew Lunn <andrew@lunn.ch> wrote:
>
> > On Fri, Mar 14, 2025 at 05:23:16PM +0100, Maxime Chevallier wrote:
> > > Hello everyone,
> > >
> > > This is V3 for the single-byte SMBus support for SFP cages as well as
> > > embedded PHYs accessed over mdio-i2c.
> >
> > Just curious, what hardware is this? And does it support bit-banging
> > the I2C pins? If it does, you get a choice, slow but correct vs fast
> > but broken and limited?
>
> The HW is a VSC8552 PHY that includes a so-called "i2c mux", which in
> reality is that smbus interface.
>
> +---------+
> +-----+ | | +-----+
> | MAC | --- | VSC8552 | --- | SFP |
> +-----+ | | +-----+
> | | | |
> +-mdio---| |-smbus--+
> +---------+
>
> it has 4 SCL and 1 SDA lines, that you can connect to 4 different SFP
> cages.
>
> You perform transfers by using 2 dedicated MDIO registers , one
> register contains xfer info such as the address to access over smbus,
> the direction of the xfer, and the other one contains data :
> - lower byte is write data
> - upper byte is read-back data
>
> and that's all you have :( so the HW can only really do one single byte
> transfer at a time, then you re-configure the 2 registers above, rinse
> and repeat.
>
> Looks like the datasheet is publicly available :
>
> https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/DataSheets/60001809A.pdf
>
> The whole xfer protocol is described in page 35.
>
> On the board itself, the i2c for the SFP cage is connected to that PHY
> smbus.
>
> Now it looks like there's some pinmux within the PHY and we can use the
> PHY as a gpio controller, so we could consider using a bitbang approach
> indeed (provided that SFP is on PHY smbus bus 0 or 1).
>
> I didn't consider that, it's probably worth giving a try, even if as
> you say it's probably be very slow, each bit being set amounting to a
> mdio xfer towards the PHY.
This going to be very slow. My guess is people will live with limited
functionality. But it could be interesting to implement the GPIO
support and see how slow it is.
It might also be worth pointing out to microchip how broken this is,
and see if they can do anything about it in the firmware running in
PHY. 2 byte SMBUS would solve the problems.
> Do we still want the current series ? Looks like some other people were
> interested in that.
Yes, it is useful.
Andrew
prev parent reply other threads:[~2025-03-18 12:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 16:23 Maxime Chevallier
2025-03-14 16:23 ` [PATCH net-next v3 1/2] net: phy: sfp: Add support for SMBus module access Maxime Chevallier
2025-03-21 17:50 ` Paolo Abeni
2025-03-21 18:00 ` Maxime Chevallier
2025-03-14 16:23 ` [PATCH net-next v3 2/2] net: mdio: mdio-i2c: Add support for single-byte SMBus operations Maxime Chevallier
2025-03-21 17:53 ` Paolo Abeni
2025-03-21 18:02 ` Maxime Chevallier
2025-03-21 18:15 ` Maxime Chevallier
2025-03-17 21:34 ` [PATCH net-next v3 0/2] net: phy: sfp: Add single-byte SMBus SFP access Andrew Lunn
2025-03-18 8:25 ` Maxime Chevallier
2025-03-18 12:21 ` Andrew Lunn [this message]
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=b199d9e2-1b95-468a-b826-08abe1795557@lunn.ch \
--to=andrew@lunn.ch \
--cc=atenart@kernel.org \
--cc=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kabel@kernel.org \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=romain.gantois@bootlin.com \
--cc=sean.anderson@linux.dev \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®