[RFC PATCH net-next 00/12] Add lan966x driver

From: Horatiu Vultur
Date: Mon Sep 20 2021 - 05:51:26 EST


This patch series cover multiple drivers but I have put everything in one
single series so it would be easier to follow the big picture. Eventually
this series will be split in multiple ones once we drop the RFC.

The Microchip LAN966X is a compact and cost-effective, multi-port Gigabit
AVB/TSN Ethernet Switches with two integrated 10/100/1000BASE-T PHYs and a
600 MHz ARM Cortex A7 CPU subsystem. The LAN966X includes eight ports.

In addition to the two integrated PHYs, the lAN966X supports up to
2 RGMII/RMII, up to 3 1000BASE-X/SerDes/ 2.5GBASE-X/KX, and up to
2 Quad-SGMII/Quad-USGMII interfaces. The LAN966X fully supports the IEEE
family of Audio Video Bridging (AVB) and Time Sensitive Networking (TSN)
standards, including the current IEC/IEEE draft 60802 TSN profile,
which in concert provide high Quality of Service (QoS) for latency
sensitive traffic streams over Ethernet.

The LAN966X supports TSN domain protection though IEEE 802.1Qci Per Stream
Filtering and Policing, advanced classification rules, and tunneling by
adding VLAN tags. Each egress port supports eight priorities. Prior to
scheduling, traffic can be shaped using dual-leaky bucket shaping,
IEEE 802.1Qav Credit Based Shaping, and IEEE 802.1Qbv Time Aware Shaping,
thus also supporting IEEE 802.1Q Enhanced Transmission Selection.

Low latency is possible though latency optimized architecture,
cut-through, and IEEE 802.1Qbu/802.3br Preemption. For higher traffic
availability, the LAN966X supports Multiple Spanning Tree, IEEE 802.1CB
Frame Replication and Elimination for Redundancy, IEC 62439-2 MRP,
ODVA DLR, in addition to ITU-T G.8031 and G.8032 linear and ring
protection.

The LAN966X supports IEEE 802.1AS-2020 (gPTP) and IEEE 1588-2019 (PTP)
time synchronization with time stamping in multiple domains in
support of Working Clock and Global Time distribution.

The LAN966X can operate either as a standalone switch or as a system
co-processor with an external host CPU. The external host can manage the
switch via PCIe or an Ethernet port.

This series provides support for:
- support for integrated PHY
- host mode providing register based injection and extraction

More support will be added in future patches.

Horatiu Vultur (12):
net: mdio: mscc-miim: Fix the mdio controller
net: phy: mchp: Add support for LAN8804 PHY
phy: Add lan966x ethernet serdes PHY driver
dt-bindings: reset: Add lan966x switch reset bindings
reset: lan966x: Add switch reset driver
dt-bindings: reset: Add lan966x power reset bindings
power: reset: Add lan966x power reset driver
dt-bindings: net: lan966x: Add lan966x-switch bindings
net: lan966x: add the basic lan966x driver
net: lan966x: add port module support
net: lan966x: add mactable support
net: lan966x: add ethtool configuration and statistics

.../net/microchip,lan966x-switch.yaml | 114 ++
.../bindings/power/lan966x,power.yaml | 49 +
.../bindings/reset/lan966x,rst.yaml | 58 +
drivers/net/ethernet/microchip/Kconfig | 1 +
drivers/net/ethernet/microchip/Makefile | 1 +
.../net/ethernet/microchip/lan966x/Kconfig | 7 +
.../net/ethernet/microchip/lan966x/Makefile | 9 +
.../microchip/lan966x/lan966x_ethtool.c | 578 ++++++++++
.../ethernet/microchip/lan966x/lan966x_ifh.h | 173 +++
.../ethernet/microchip/lan966x/lan966x_main.c | 994 ++++++++++++++++++
.../ethernet/microchip/lan966x/lan966x_main.h | 192 ++++
.../microchip/lan966x/lan966x_phylink.c | 92 ++
.../ethernet/microchip/lan966x/lan966x_port.c | 301 ++++++
.../ethernet/microchip/lan966x/lan966x_regs.h | 704 +++++++++++++
drivers/net/mdio/mdio-mscc-miim.c | 14 +-
drivers/net/phy/micrel.c | 73 ++
drivers/phy/microchip/Kconfig | 8 +
drivers/phy/microchip/Makefile | 1 +
drivers/phy/microchip/lan966x_serdes.c | 525 +++++++++
drivers/phy/microchip/lan966x_serdes_regs.h | 482 +++++++++
drivers/power/reset/Kconfig | 6 +
drivers/power/reset/Makefile | 1 +
drivers/power/reset/lan966x-reset.c | 90 ++
drivers/reset/Kconfig | 8 +
drivers/reset/Makefile | 1 +
drivers/reset/reset-lan966x.c | 128 +++
include/dt-bindings/phy/lan966x_serdes.h | 14 +
include/linux/micrel_phy.h | 1 +
28 files changed, 4620 insertions(+), 5 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml
create mode 100644 Documentation/devicetree/bindings/power/lan966x,power.yaml
create mode 100644 Documentation/devicetree/bindings/reset/lan966x,rst.yaml
create mode 100644 drivers/net/ethernet/microchip/lan966x/Kconfig
create mode 100644 drivers/net/ethernet/microchip/lan966x/Makefile
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_ifh.h
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_main.c
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_main.h
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_port.c
create mode 100644 drivers/net/ethernet/microchip/lan966x/lan966x_regs.h
create mode 100644 drivers/phy/microchip/lan966x_serdes.c
create mode 100644 drivers/phy/microchip/lan966x_serdes_regs.h
create mode 100644 drivers/power/reset/lan966x-reset.c
create mode 100644 drivers/reset/reset-lan966x.c
create mode 100644 include/dt-bindings/phy/lan966x_serdes.h

--
2.31.1