Netdev List
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: "Heiner Kallweit" <hkallweit1@gmail.com>,
	"Marek Behún" <kabel@kernel.org>,
	netdev@vger.kernel.org, "Andrew Lunn" <andrew@lunn.ch>,
	"Jakub Kicinski" <kuba@kernel.org>,
	davem@davemloft.net
Subject: Re: [PATCH net-next v4 1/4] net: phy: mdio-i2c: support I2C MDIO protocol for RollBall SFP modules
Date: Mon, 18 Jan 2021 13:13:38 +0100	[thread overview]
Message-ID: <20210118121338.lzbit6ad2uem2gcq@pali> (raw)
In-Reply-To: <20210112192233.GE1551@shell.armlinux.org.uk>

On Tuesday 12 January 2021 19:22:33 Russell King - ARM Linux admin wrote:
> On Tue, Jan 12, 2021 at 09:42:56AM +0100, Heiner Kallweit wrote:
> > On 11.01.2021 06:00, Marek Behún wrote:
> > > Some multigig SFPs from RollBall and Hilink do not expose functional
> > > MDIO access to the internal PHY of the SFP via I2C address 0x56
> > > (although there seems to be read-only clause 22 access on this address).
> > > 
> > > Instead these SFPs PHY can be accessed via I2C via the SFP Enhanced
> > > Digital Diagnostic Interface - I2C address 0x51. The SFP_PAGE has to be
> > > selected to 3 and the password must be filled with 0xff bytes for this
> > > PHY communication to work.
> > > 
> > > This extends the mdio-i2c driver to support this protocol by adding a
> > > special parameter to mdio_i2c_alloc function via which this RollBall
> > > protocol can be selected.
> > > 
> > I'd think that mdio-i2c.c is for generic code. When adding a
> > vendor-specific protocol, wouldn't it make sense to use a dedicated
> > source file for it?
> 
> There is nothing in the SFP MSAs about how to access an on-board PHY
> on a SFP. This is something that vendors choose to do (or in some
> cases, not do.)
> 
> mdio-i2c currently implements the access protocol for Marvell 88E1111
> PHYs which have an I2C mode. It was extended to support the DM7052
> module which has a Broadcom Clause 45 PHY and either a microcontroller
> or FPGA to convert I2C cycles to MDIO cycles - and sensibly performs
> clock stretching.

Just to note that there is also another Marvell way how to access Clause
45 registers via existing Marvell PHY Clause 22 I2C mode:

https://www.ieee802.org/3/efm/public/nov02/oam/pannell_oam_1_1102.pdf

Clause 45 registers are accessed via Clause 22 regs 13 and 14.

> There are modules that the clause 45 PHY is accessible via exactly the
> same I2C address, using exactly the same data accesses, but do not
> do the clock stretching thing, instead telling you that you must wait
> N microseconds between the bus transactions. We don't yet support
> these.
> 
> Then there is Marek's module, where the PHY is accessible via a page
> in the diagnostic address - which is another entirely reasonable
> implementation. The solution we have here is one that I've worked with
> Marek for a few months now.
> 
> I don't think we should grow lots of separate mdio-i2c-vendorfoo.c
> drivers - at least not yet. Maybe if we get lots of different access
> methods, it may make sense in the future.
> 
> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2021-01-18 12:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11  5:00 [PATCH net-next v4 0/4] Support for RollBall 10G copper SFP modules Marek Behún
2021-01-11  5:00 ` [PATCH net-next v4 1/4] net: phy: mdio-i2c: support I2C MDIO protocol for RollBall " Marek Behún
2021-01-12  8:42   ` Heiner Kallweit
2021-01-12 14:02     ` Andrew Lunn
2021-01-12 14:40       ` Heiner Kallweit
2021-01-12 17:49       ` Marek Behún
2021-01-12 19:22     ` Russell King - ARM Linux admin
2021-01-18 12:13       ` Pali Rohár [this message]
2021-01-18 15:45         ` Russell King - ARM Linux admin
2021-01-12 20:20   ` Andrew Lunn
2021-01-12 20:43   ` Andrew Lunn
2021-01-12 20:53     ` Marek Behún
2021-01-12 20:55       ` Andrew Lunn
2021-01-12 20:54   ` Andrew Lunn
2021-01-12 21:01     ` Marek Behún
2021-01-13 10:51       ` Pali Rohár
2021-01-12 21:22     ` Russell King - ARM Linux admin
2021-01-13 11:22   ` Pali Rohár
2021-01-13 13:56     ` Andrew Lunn
2021-01-13 13:58       ` Pali Rohár
2021-01-13 16:14       ` Russell King - ARM Linux admin
2021-01-11  5:00 ` [PATCH net-next v4 2/4] net: phylink: allow attaching phy for SFP modules on 802.3z mode Marek Behún
2021-01-13 10:38   ` Pali Rohár
2021-01-11  5:00 ` [PATCH net-next v4 3/4] net: sfp: create/destroy I2C mdiobus before PHY probe/after PHY release Marek Behún
2021-01-13 10:41   ` Pali Rohár
2021-01-11  5:00 ` [PATCH net-next v4 4/4] net: sfp: add support for multigig RollBall transceivers Marek Behún
2021-01-13 10:49   ` Pali Rohár
2021-01-13 11:08     ` Russell King - ARM Linux admin
2021-01-13 11:26       ` 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=20210118121338.lzbit6ad2uem2gcq@pali \
    --to=pali@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.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