Skip to content

net: dsa: mxl862xx: SerDes ports

Daniel Golle lkml netdev 6 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest4 patches 0 repliesApplied 4/4
  2. v54 patches 5 repliesSuperseded
  3. v44 patches 2 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v34 patches1 replySuperseded
v24 patches3 repliesSuperseded
v15 patches3 repliesSuperseded

Changes in v6 from the cover letter

* clear state->link on the pcs_get_state early-return error paths
* document in phylink_get_caps and in the commit message why the single-lane SerDes modes stay advertised on old firmware
* document why pcs_config does not need to take serdes_lock

Patches in v6 All 4 applied

#Subject and filesSizeRepliesApplied
1/4net: dsa: mxl862xx: store firmware version for feature gatingdrivers/net/dsa/mxl862xx/mxl862xx.c drivers/net/dsa/mxl862xx/mxl862xx.h+26 -00 repliesApplied
2/4net: dsa: mxl862xx: move phylink stubs to mxl862xx-phylink.cdrivers/net/dsa/mxl862xx/Makefile drivers/net/dsa/mxl862xx/mxl862xx-phylink.c drivers/net/dsa/mxl862xx/mxl862xx-phylink.h +1 more+67 -380 repliesApplied
3/4net: dsa: mxl862xx: move API macros to mxl862xx-host.hdrivers/net/dsa/mxl862xx/mxl862xx-host.h drivers/net/dsa/mxl862xx/mxl862xx.c+8 -70 repliesApplied
4/4net: dsa: mxl862xx: add support for SerDes portsdrivers/net/dsa/mxl862xx/mxl862xx-api.h drivers/net/dsa/mxl862xx/mxl862xx-cmd.h drivers/net/dsa/mxl862xx/mxl862xx-phylink.c +3 more+668 -30 repliesApplied

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchAndrew LunnMaxime Chevallier
1/4R-b
2/4R-b
3/4R-b
4/4

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

Read the v6 thread

Cover letter [PATCH net-next v6 0/4] net: dsa: mxl862xx: SerDes ports

Add support for the two SerDes PCS interfaces of the MxL862xx switch ICs, which can both either be used to connect PHYs or SFP cages, or as CPU port(s). 1000Base-X, 2500Base-X, 10GBase-R, 10GBase-KR, SGMII, QSGMII and USXGMII (single 10G or quad 2.5G) are supported.

The firmware only added the API to directly control the PCS as of version 1.0.84, so the PCS features are gated behind a version check.

As the driver is growing do some refactoring to break out the phylink parts into mxl862xx-phylink.h.
---
Changes since v5:
* clear state->link on the pcs_get_state early-return error paths
* document in phylink_get_caps and in the commit message why the single-lane SerDes modes stay advertised on old firmware
* document why pcs_config does not need to take serdes_lock

Changes since v4:
* use FIELD_GET/FIELD_PREP and macro definitions for the bitfields instead of endian-aware structs with bit-sized members
* do not error out on old firmware, so driver at least probes and CPU port keeps working in firmware-configured mode. Issue a warning instead.

Changes since v3:
* replace atomic_t serdes_refcount with a plain int guarded by a new serdes_lock mutex

Changes since v2:
* get rid of endian-specific union handling firmware version
* replace serdes_active bitmap with atomic_t serdes_refcount
* defer mpcs->interface assignment until after firmware ack
* handle firmware error codes in pcs_config
* set st.usx_lane_mode in pcs_get_state
* set lu.usx_subport and lu.usx_lane_mode in pcs_link_up
* use phylink_mii_c22_pcs_encode_advertisement() in CL37 adv
* rework commit message

Changes since v1:
* drop custom ethtool stats (former patch 5/5)
* add __{LE,BE}_BITFIELD layouts to ABI structs
* per-sub-port QSGMII AN restart via usx_subport / usx_lane_mode
* shared-SerDes refcount in pcs_disable via per-XPCS slot bitmap
* let every sub-port call pcs_config
* cache phy_interface_t instead of firmware type
* skip pcs_link_up when inband-AN enabled
* gate phylink_get_caps SerDes modes on same FW version as select_pcs
* interpret xpcs_pcs_cfg.result as signed (s16)
* drop dead MXL862XX_PCS_PORT macro
* drop misleading "downshift detection" line from commit message

Daniel Golle (5):
net: dsa: mxl862xx: store firmware version for feature gating
net: dsa: mxl862xx: move phylink stubs to mxl862xx-phylink.c
net: dsa: mxl862xx: move API macros to mxl862xx-host.h
net: dsa: mxl862xx: add support for SerDes ports
net: dsa: mxl862xx: add SerDes ethtool statistics

 drivers/net/dsa/mxl862xx/Makefile           |   2 +-
 drivers/net/dsa/mxl862xx/mxl862xx-api.h     | 392 +++++++++++++++++
 drivers/net/dsa/mxl862xx/mxl862xx-cmd.h     |  11 +
 drivers/net/dsa/mxl862xx/mxl862xx-host.h    |   8 +
 drivers/net/dsa/mxl862xx/mxl862xx-phylink.c | 446 ++++++++++++++++++++
 drivers/net/dsa/mxl862xx/mxl862xx-phylink.h |  27 ++
 drivers/net/dsa/mxl862xx/mxl862xx.c         |  60 +--
 drivers/net/dsa/mxl862xx/mxl862xx.h         |  58 +++
 8 files changed, 957 insertions(+), 47 deletions(-)
 create mode 100644 drivers/net/dsa/mxl862xx/mxl862xx-phylink.c
 create mode 100644 drivers/net/dsa/mxl862xx/mxl862xx-phylink.h

--
2.54.0
Daniel Golle (4):
net: dsa: mxl862xx: store firmware version for feature gating
net: dsa: mxl862xx: move phylink stubs to mxl862xx-phylink.c
net: dsa: mxl862xx: move API macros to mxl862xx-host.h
net: dsa: mxl862xx: add support for SerDes ports

 drivers/net/dsa/mxl862xx/Makefile           |   2 +-
 drivers/net/dsa/mxl862xx/mxl862xx-api.h     | 215 ++++++++++
 drivers/net/dsa/mxl862xx/mxl862xx-cmd.h     |   9 +
 drivers/net/dsa/mxl862xx/mxl862xx-host.h    |   8 +
 drivers/net/dsa/mxl862xx/mxl862xx-phylink.c | 446 ++++++++++++++++++++
 drivers/net/dsa/mxl862xx/mxl862xx-phylink.h |  21 +
 drivers/net/dsa/mxl862xx/mxl862xx.c         |  55 +--
 drivers/net/dsa/mxl862xx/mxl862xx.h         |  57 +++
 8 files changed, 767 insertions(+), 46 deletions(-)
 create mode 100644 drivers/net/dsa/mxl862xx/mxl862xx-phylink.c
 create mode 100644 drivers/net/dsa/mxl862xx/mxl862xx-phylink.h

base-commit: ec782be97d2d364fec730512259e6da259594109
prerequisite-patch-id: 0000000000000000000000000000000000000000

Signature · 1 line
2.54.0