All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/13] phylink and sfp support
@ 2017-07-25 14:01 Russell King - ARM Linux
  2017-07-25 14:02 ` [PATCH RFC 01/13] net: phy: allow settings table to support more than 32 link modes Russell King
                   ` (15 more replies)
  0 siblings, 16 replies; 31+ messages in thread
From: Russell King - ARM Linux @ 2017-07-25 14:01 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli; +Cc: netdev

Hi,

This patch series introduces generic support for SFP sockets found on
various Marvell based platforms.  The idea here is to provide common
SFP socket support which can be re-used by network drivers as
appropriate, rather than each network driver having to re-implement
SFP socket support.

SFP sockets typically use other system resources, eg, I2C buses to read
identifying information, and GPIOs to monitor socket state and control
the socket.  Meanwhile, some network drivers drive multiple ethernet
ports from one instantiation of the driver.

It is not desirable to block the initialisation of a network driver
(thus denying other ports from being operational) if the resources
for the SFP socket are not yet available.  This means that an element
of independence between the SFP support code and the driver is
required.

More than that, SFP modules effectively bring hotplug PHYs to
networking - SFP copper modules normally contain a standard PHY
accessed over the I2C bus, and it is desirable to read their state
so network drivers can be appropriately configured.

To add to the complexity, SFP modules can be connected in at least
two places:

1. Directly to the serdes output of a MAC with no intervening PHY.
   For example:

     mvneta ----> SFP socket

2. To a PHY, for example:

     mvpp2 ---> PHY ---> copper
                 |
                 `-----> SFP socket

This code supports both setups, although it's not fully implemented
with scenario (2).

Moreover, the link presented by the SFP module can be one of the
10Gbase-R family (for SFP+ sockets), SGMII or 1000base-X (for SFP
sockets) depending on the module, and network drivers need to
reconfigure themselves accordingly for the link to come up.

For example, if the MAC is configured for SGMII and a fibre module
is plugged in, the link won't come up until the MAC is reconfigured
for 1000base-X mode.

The SFP code manages the SFP socket - detecting the module, reading
the identifying information, and managing the control and status
signals.  Importantly, it disables the SFP module transmitter when
the MAC is down, so that the laser is turned off (but that is not
a guarantee.)

phylink provides the mechanisms necessary to manage the link modes,
based on the SFP module type, and supports hot-plugging of the PHY
without needing the MAC driver to be brought up and down on
transitions.  phylink also supports the classical static PHY and
fixed-link modes.

I currently (but not included in this series) have code to convert
mvneta to use phylink, and the out of tree mvpp2x driver.  I have
nothing for the mvpp2 driver at present as that driver is only
recently becoming functional on 10G hardware, and is missing a lot
of features that are necessary to make things work correctly.

 drivers/net/phy/Kconfig      |   25 +
 drivers/net/phy/Makefile     |    6 +
 drivers/net/phy/mdio-i2c.c   |  109 ++++
 drivers/net/phy/mdio-i2c.h   |   19 +
 drivers/net/phy/phy-core.c   |  180 ++++++
 drivers/net/phy/phy.c        |  217 +------
 drivers/net/phy/phy_device.c |   15 +
 drivers/net/phy/phylink.c    | 1462 ++++++++++++++++++++++++++++++++++++++++++
 drivers/net/phy/sfp-bus.c    |  475 ++++++++++++++
 drivers/net/phy/sfp.c        |  915 ++++++++++++++++++++++++++
 drivers/net/phy/sfp.h        |   28 +
 include/linux/phy.h          |   21 +
 include/linux/phylink.h      |  148 +++++
 include/linux/sfp.h          |  434 +++++++++++++
 14 files changed, 3867 insertions(+), 187 deletions(-)

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2017-08-07  4:00 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25 14:01 [PATCH RFC 00/13] phylink and sfp support Russell King - ARM Linux
2017-07-25 14:02 ` [PATCH RFC 01/13] net: phy: allow settings table to support more than 32 link modes Russell King
2017-07-26 22:36   ` Florian Fainelli
2017-07-25 14:02 ` [PATCH RFC 02/13] net: phy: split out PHY speed and duplex string generation Russell King
2017-07-26 21:48   ` Andrew Lunn
2017-07-26 22:37   ` Florian Fainelli
2017-07-25 14:02 ` [PATCH RFC 03/13] net: phy: move phy_lookup_setting() and guts of phy_supported_speeds() to phy-core Russell King
2017-07-26 22:21   ` Andrew Lunn
2017-07-25 14:02 ` [PATCH RFC 04/13] net: phy: add 1000Base-X to phy settings table Russell King
2017-07-26 21:52   ` Andrew Lunn
2017-07-25 14:02 ` [PATCH RFC 05/13] net: phy: provide a hook for link up/link down events Russell King
2017-07-25 14:03 ` [PATCH RFC 06/13] net: phy: export phy_start_machine() for phylink Russell King
2017-07-25 14:03 ` [PATCH RFC 07/13] net: phy: add I2C mdio bus Russell King
2017-07-26 22:22   ` Andrew Lunn
2017-07-26 22:35   ` Florian Fainelli
2017-07-25 14:03 ` [PATCH RFC 08/13] phylink: add phylink infrastructure Russell King
2017-08-01 14:34   ` Andrew Lunn
2017-07-25 14:03 ` [PATCH RFC 09/13] sfp: add sfp-bus to bridge between network devices and sfp cages Russell King
2017-08-01 14:35   ` Andrew Lunn
2017-07-25 14:03 ` [PATCH RFC 10/13] phylink: add module EEPROM support Russell King
2017-07-25 14:03 ` [PATCH RFC 11/13] phylink: add support for MII ioctl access to Clause 45 PHYs Russell King
2017-07-27 18:47   ` Andrew Lunn
2017-07-25 14:03 ` [PATCH RFC 12/13] phylink: add in-band autonegotiation support for 10GBase-KR mode Russell King
2017-07-26 22:23   ` Andrew Lunn
2017-07-25 14:03 ` [PATCH RFC 13/13] sfp: add SFP module support Russell King
2017-07-26 16:44 ` [PATCH RFC 00/13] phylink and sfp support Andrew Lunn
2017-07-26 18:07   ` Russell King - ARM Linux
2017-08-01 14:39 ` Andrew Lunn
2017-08-03 18:11   ` Florian Fainelli
2017-08-06 18:26 ` Andrew Lunn
2017-08-07  4:00   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.