Skip to content

Add PCS core support

Sean Anderson imx linux-arm-kernel linux-devicetree linux-doc lkml netdev oe-kbuild-all 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest10 patches 5 repliesIn review
  2. v510 patches 5 repliesSuperseded
  3. v411 patches 20 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v311 patches23 repliesSuperseded
v214 patches9 repliesSuperseded
v1 RFC13 patches21 repliesSuperseded

Changes in v6 from the cover letter

- Define lynx_pcs_of_match only when OF_MATCH is enabled
- Fix use of spin_lock instead of spin_unlock
- Introduce config for compatibility helpers
- Move axienet_pcs_fixup to AXI Ethernet commit
- Reduce line lengths to under 80 characters
- Remove duplicate include of phylink.h
- Remove unneccessary Kconfig selects
- Use an empty statement for next label
- Use guard(srcu)

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10dt-bindings: net: Add Xilinx PCSDocumentation/devicetree/bindings/net/xilinx,pcs.yaml+114 -00 replies
2/10net: phylink: Support setting PCS link change callbacksdrivers/net/phy/phylink.c include/linux/phylink.h+29 -220 replies
3/10net: pcs: Add subsystemDocumentation/networking/index.rst Documentation/networking/kapi.rst Documentation/networking/pcs.rst +5 more+957 -03 replies
4/10net: dsa: ocelot: suppress PHY device scanning on the internal MDIO busdrivers/net/dsa/ocelot/felix_vsc9959.c drivers/net/dsa/ocelot/seville_vsc9953.c+9 -00 replies
5/10net: pcs: lynx: Convert to an MDIO driverdrivers/net/dsa/ocelot/felix_vsc9959.c drivers/net/dsa/ocelot/seville_vsc9953.c drivers/net/ethernet/altera/altera_tse_main.c +12 more+116 -1100 replies
6/10net: pcs: Add Xilinx PCS driverMAINTAINERS drivers/net/pcs/Kconfig drivers/net/pcs/Makefile +3 more+460 -12 replies
7/10net: axienet: Convert to use PCS subsystemdrivers/net/ethernet/xilinx/Kconfig drivers/net/ethernet/xilinx/xilinx_axienet.h drivers/net/ethernet/xilinx/xilinx_axienet_main.c+90 -870 replies
8/10net: macb: Move most of mac_config to mac_preparedrivers/net/ethernet/cadence/macb_main.c+132 -770 replies
8/10net: macb: Move most of mac_config to mac_preparedrivers/net/ethernet/cadence/macb_main.c+132 -770 replies
9/10net: macb: Support external PCSsdrivers/net/ethernet/cadence/macb.h drivers/net/ethernet/cadence/macb_main.c+25 -20 replies
10/10of: property: Add device link support for PCSdrivers/of/property.c+2 -00 replies

Reviews trailers per patch

2 of 11 patches have a Reviewed-by or Acked-by.

PatchRob Herring (Arm)Saravana Kannan
1/10R-b
2/10
3/10
4/10
5/10
6/10
7/10
8/10
8/10
9/10
10/10A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [net-next PATCH v6 00/10] Add PCS core support

This series adds support for creating PCSs as devices on a bus with a driver (patch 3). As initial users,

- The Lynx PCS (and all of its users) is converted to this system (patches 4-5)
- The Xilinx PCS is broken out from the AXI Ethernet driver (patches 6-7)
- The Cadence MACB driver is converted to support external PCSs (namely the Xilinx PCS) (patches 8-9).

Care has been taken to ensure backwards-compatibility. The main source of this is that many PCS devices lack compatibles and get detected as PHYs. To address this, pcs_get_by_fwnode_compat allows drivers to edit the devicetree to add appropriate compatibles.

There is another series [1] with the same goal by Christian Marangi. In comparison, I believe this series

- Implements a simpler and more-robust method of PCS access.
- Provides a more-direct upgrade path for existing MAC and PCS drivers.

[1] https://lore.kernel.org/netdev/[email protected]/

Changes in v6:
- Define lynx_pcs_of_match only when OF_MATCH is enabled
- Fix use of spin_lock instead of spin_unlock
- Introduce config for compatibility helpers
- Move axienet_pcs_fixup to AXI Ethernet commit
- Reduce line lengths to under 80 characters
- Remove duplicate include of phylink.h
- Remove unneccessary Kconfig selects
- Use an empty statement for next label
- Use guard(srcu)

Changes in v5:
- Export get_phy_c22_id when it is used
- Expose bind attributes, since there is no issue in doing so
- Rebase onto net-next
- Use MDIO_BUS instead of MDIO_DEVICE

Changes in v4:
- Add a note about the license
- Adjust variable ordering in pcs_find_fwnode
- Annotate pcs_wrapper.wrapped with __rcu
- Fix PCS lookup functions missing ERR_PTR casts
- Fix documentation for devm_pcs_register_full
- Fix incorrect condition in pcs_post_config
- Fix linking when PCS && !OF_DYNAMIC
- Fix linking when PCS && OF_DYNAMIC && PHYLIB=m
- Re-add documentation for axienet_xilinx_pcs_get that was accidentally removed
- Reduce line lengths to under 80 characters
- Remove unused dev parameter to pcs_put
- Use a spinlock instead of a mutex to protect pcs_wrappers

Changes in v3:
- Add '>' modifier for paragraph to description
- Adjust axienet_xilinx_pcs_get for changes to pcs_find_fwnode API
- Drop patches destined for other trees, as they have either already been applied or are no longer necessary.
- Edit description to reference clocks instead of resets
- Remove support for #pcs-cells. Upon further investigation, the requested functionality can be accomplished by specifying the PCS's fwnode manually.
- Select PCS_XILINX unconditionally

Changes in v2:
- Add fallbacks for pcs_get* and pcs_put
- Add support for #pcs-cells
- Change base compatible to just xlnx,pcs
- Change compatible to just xlnx,pcs
- Defer devicetree updates for another series
- Drop #clock-cells description
- Drop PCS_ALTERA_TSE which was accidentally added while rebasing
- Move #clock-cells after compatible
- Move update to macb_pcs_get_state to previous patch
- Remove outdated comment
- Remove second example
- Remove unused variable
- Remove unused variable lynx_properties
- Rename pcs-modes to xlnx,pcs-modes
- Reorder pcs_handle to come before suffix props
- Reword commit message
- Rework xilinx_pcs_validate to just clear out half-duplex modes instead of constraining modes based on the interface.

Sean Anderson (9):
dt-bindings: net: Add Xilinx PCS
net: phylink: Support setting PCS link change callbacks
net: pcs: Add subsystem
net: pcs: lynx: Convert to an MDIO driver
net: pcs: Add Xilinx PCS driver
net: axienet: Convert to use PCS subsystem
net: macb: Move most of mac_config to mac_prepare
net: macb: Support external PCSs
of: property: Add device link support for PCS

Vladimir Oltean (1):
net: dsa: ocelot: suppress PHY device scanning on the internal MDIO
bus

 .../devicetree/bindings/net/xilinx,pcs.yaml   | 114 ++++
 Documentation/networking/index.rst            |   1 +
 Documentation/networking/kapi.rst             |   4 +
 Documentation/networking/pcs.rst              | 102 +++
 MAINTAINERS                                   |   8 +
 drivers/net/dsa/ocelot/felix_vsc9959.c        |  15 +-
 drivers/net/dsa/ocelot/seville_vsc9953.c      |  16 +-
 drivers/net/ethernet/altera/altera_tse_main.c |   7 +-
 drivers/net/ethernet/cadence/macb.h           |   1 +
 drivers/net/ethernet/cadence/macb_main.c      | 229 ++++---
 drivers/net/ethernet/freescale/dpaa2/Kconfig  |   1 +
 .../net/ethernet/freescale/dpaa2/dpaa2-mac.c  |  11 +-
 .../net/ethernet/freescale/enetc/enetc_pf.c   |   8 +-
 .../net/ethernet/freescale/enetc/enetc_pf.h   |   1 -
 .../freescale/enetc/enetc_pf_common.c         |   4 +-
 drivers/net/ethernet/freescale/fman/Kconfig   |   2 +-
 .../net/ethernet/freescale/fman/fman_memac.c  |  25 +-
 drivers/net/ethernet/stmicro/stmmac/Kconfig   |   1 +
 .../ethernet/stmicro/stmmac/dwmac-socfpga.c   |   6 +-
 drivers/net/ethernet/xilinx/Kconfig           |  13 +
 drivers/net/ethernet/xilinx/xilinx_axienet.h  |   4 +-
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 160 +++--
 drivers/net/pcs/Kconfig                       |  47 +-
 drivers/net/pcs/Makefile                      |   4 +
 drivers/net/pcs/core.c                        | 628 ++++++++++++++++++
 drivers/net/pcs/pcs-lynx.c                    | 113 ++--
 drivers/net/pcs/pcs-xilinx.c                  | 427 ++++++++++++
 drivers/net/phy/phy_device.c                  |   3 +-
 drivers/net/phy/phylink.c                     |  24 +-
 drivers/of/property.c                         |   2 +
 include/linux/pcs-lynx.h                      |  13 +-
 include/linux/pcs.h                           | 205 ++++++
 include/linux/phy.h                           |   1 +
 include/linux/phylink.h                       |  27 +-
 34 files changed, 1931 insertions(+), 296 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/xilinx,pcs.yaml
 create mode 100644 Documentation/networking/pcs.rst
 create mode 100644 drivers/net/pcs/core.c
 create mode 100644 drivers/net/pcs/pcs-xilinx.c
 create mode 100644 include/linux/pcs.h
Signature · 1 line
2.35.1.1320.gc452695387.dirty