Skip to content

net: phy: Introduce MII multiplexers

Maxime Chevallier linux-arm-kernel linux-devicetree lkml netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12dt-bindings: net: Add Ethernet MII multiplexersDocumentation/devicetree/bindings/net/ethernet-controller.yaml Documentation/devicetree/bindings/net/mii-mux-auto.yaml Documentation/devicetree/bindings/net/mii-mux.yaml +1 more+175 -00 replies
2/12net: phy: Introduce phy_mux, a MII multiplexer representationMAINTAINERS drivers/net/phy/Kconfig drivers/net/phy/Makefile +2 more+244 -00 replies
3/12net: phy: Don't create the sysfs links for PHYs behind a muxdrivers/net/phy/phy_device.c include/linux/phy.h+5 -10 replies
4/12net: phy: phy_mux: Allow attaching a mux to a net_devicedrivers/net/phy/phy_mux.c include/linux/phy_mux.h+232 -30 replies
5/12net: phy: phy_mux: Add port selection logicdrivers/net/phy/phy_mux.c include/linux/phy_mux.h+162 -10 replies
6/12net: phy: phy_mux: Support SFP cage portsdrivers/net/phy/phy_mux.c include/linux/phy_mux.h+213 -110 replies
7/12net: phylink: Factor out phylink_clear_phydev()drivers/net/phy/phylink.c+18 -100 replies
8/12net: phy: phy_mux: Add phy_mux_set_mac_managed_pm()drivers/net/phy/phy_mux.c include/linux/phy_mux.h+20 -00 replies
9/12net: phylink: Support PHYs reached through a phy_muxdrivers/net/phy/phylink.c+144 -100 replies
10/12net: phylink: Support an SFP cage behind a phy_muxdrivers/net/phy/phylink.c+89 -50 replies
11/12net: phy: mux: Add the mii-mux-auto driverMAINTAINERS drivers/net/phy/Kconfig drivers/net/phy/Makefile +3 more+124 -00 replies
12/12ARM: dts: turris-omnia: Describe the WAN port multiplexerarch/arm/boot/dts/marvell/armada-385-turris-omnia.dts+18 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 00/12] net: phy: Introduce MII multiplexers

Hi everyone,

3 years after pitching the idea at Netdevconf Vancouver, this is V1 of a framework to deal with multiplexed MII interfaces.

- What we want to do:

The end-goal is to support multi-port ethernet interfaces. There are multiple use-cases for that, the most common one is combo-port:

        /-- RJ45
MAC ---X
        \-- SFP

To achieve this, we can use several HW designs:

1 : Use a physical switch on the MII path:

PHY
xMII /
MAC --- Mux

          \
	   SFP

This is what we find on Turris Omnia for instance. Here, the switch is driven directly by the onboard electronics, it's connected to the SFP's mod_def0 signal, and we can't switch it at all from Linux.

2 : Use a multiplexer in the SoC:

         /-- xMII -- PHY
MAC -- MUX
         \-- xMII -- SFP

This is what we have on Banana Pi R4 I believe.

3 : Use a PHY that contains a Mux:

    xMII   /---SFP
MAC ---- PHY
           \-- RJ45

This is what we have on Machhiatobin for example.

- What we do here:

To make this "digestable" (well, it's already 12 patches, here goes my netdev budget), this series adds the easiest case: The first one.

This allows adding the core mux infrastructure, the bindings, a small driver and demonstrating that on upstream supported HW. Because the HW does the switching, this series does NOT include the logic to drive a mux from userspace. This will come later.

With this series, we can now use both WAN ports on omnia :)

- What we don't do here, but will do next:

Next step is to add some uAPI path to drive that, this will be done with the phy_port API. end users don't care about the HW design, they want to select the port to use, and phy_port represents them already.

The example for that will be mcbin.

Finally, we'll add driveable MII muxes (for bpi r4 and others).

This was tested on Omnia.

Note that patch 12 should likely go through the mvebu tree.

Thanks,

Maxime

Maxime Chevallier (12):
dt-bindings: net: Add Ethernet MII multiplexers
net: phy: Introduce phy_mux, a MII multiplexer representation
net: phy: Don't create the sysfs links for PHYs behind a mux
net: phy: phy_mux: Allow attaching a mux to a net_device
net: phy: phy_mux: Add port selection logic
net: phy: phy_mux: Support SFP cage ports
net: phylink: Factor out phylink_clear_phydev()
net: phy: phy_mux: Add phy_mux_set_mac_managed_pm()
net: phylink: Support PHYs reached through a phy_mux
net: phylink: Support an SFP cage behind a phy_mux
net: phy: mux: Add the mii-mux-auto driver
ARM: dts: turris-omnia: Describe the WAN port multiplexer

 .../bindings/net/ethernet-controller.yaml     |   6 +
 .../devicetree/bindings/net/mii-mux-auto.yaml |  89 +++
 .../devicetree/bindings/net/mii-mux.yaml      |  74 ++
 MAINTAINERS                                   |   9 +
 .../dts/marvell/armada-385-turris-omnia.dts   |  29 +-
 drivers/net/phy/Kconfig                       |  10 +
 drivers/net/phy/Makefile                      |   2 +
 drivers/net/phy/mux/Kconfig                   |  18 +
 drivers/net/phy/mux/Makefile                  |   3 +
 drivers/net/phy/mux/mii_mux_auto.c            |  99 +++
 drivers/net/phy/phy_device.c                  |   3 +-
 drivers/net/phy/phy_mux.c                     | 698 ++++++++++++++++++
 drivers/net/phy/phylink.c                     | 264 ++++++-
 include/linux/phy.h                           |   3 +
 include/linux/phy_mux.h                       | 147 ++++
 15 files changed, 1423 insertions(+), 31 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/mii-mux-auto.yaml
 create mode 100644 Documentation/devicetree/bindings/net/mii-mux.yaml
 create mode 100644 drivers/net/phy/mux/Kconfig
 create mode 100644 drivers/net/phy/mux/Makefile
 create mode 100644 drivers/net/phy/mux/mii_mux_auto.c
 create mode 100644 drivers/net/phy/phy_mux.c
 create mode 100644 include/linux/phy_mux.h
Signature · 1 line
2.56.1