diff options
author | Marek BehĂșn <kabel@kernel.org> | 2022-09-30 16:21:09 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-10-03 11:08:33 +0100 |
commit | 09bbedac72d5a9267088c15d1a71c8c3a8fb47e7 (patch) | |
tree | c232a27fdf9d01127e0fd348c4c8699f81e709ef /drivers/net/phy/sfp.c | |
parent | e85b1347ace677c3822c12d9332dfaaffe594da6 (diff) | |
download | linux-09bbedac72d5a9267088c15d1a71c8c3a8fb47e7.tar.bz2 |
net: phy: mdio-i2c: support I2C MDIO protocol for RollBall SFP modules
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.
Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/sfp.c')
-rw-r--r-- | drivers/net/phy/sfp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index ccd7710685f2..20f48464a06a 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -546,7 +546,7 @@ static int sfp_i2c_mdiobus_create(struct sfp *sfp) struct mii_bus *i2c_mii; int ret; - i2c_mii = mdio_i2c_alloc(sfp->dev, sfp->i2c); + i2c_mii = mdio_i2c_alloc(sfp->dev, sfp->i2c, sfp->mdio_protocol); if (IS_ERR(i2c_mii)) return PTR_ERR(i2c_mii); @@ -1720,6 +1720,10 @@ static int sfp_sm_probe_for_phy(struct sfp *sfp) case MDIO_I2C_C45: err = sfp_sm_probe_phy(sfp, true); break; + + case MDIO_I2C_ROLLBALL: + err = -EOPNOTSUPP; + break; } return err; |