Skip to content

net: phy: Add support for new Aeonsemi PHYs

Christian Marangi linux-devicetree lkml netdev rust-for-linux 12 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. v12 Latest6 patches 2 repliesApplied 6/6
  2. v116 patches 3 repliesSuperseded
  3. v107 patches 19 repliesSuperseded
Earlier versions · 9
VersionPostedPatchesRepliesStatus
v96 patches1 replySuperseded
v86 patches1 replySuperseded
v76 patches10 repliesSuperseded
v66 patches2 repliesSuperseded
v5 RFC6 patches2 repliesSuperseded
v4 RFC6 patches4 repliesSuperseded
v3 RFC4 patches9 repliesSuperseded
v2 RFC3 patches14 repliesSuperseded
v12 patches9 repliesSuperseded

Changes in v12 from the cover letter

- Reduce Rust changes to minimum compile (a real implementation will come later by Rust team)

Patches in v12 All 6 applied

#Subject and filesSizeRepliesApplied
1/6net: phy: pass PHY driver to .match_phy_device OPdrivers/net/phy/bcm87xx.c drivers/net/phy/icplus.c drivers/net/phy/marvell10g.c +8 more+56 -282 repliesApplied
2/6net: phy: bcm87xx: simplify .match_phy_device OPdrivers/net/phy/bcm87xx.c+4 -100 repliesApplied
3/6net: phy: nxp-c45-tja11xx: simplify .match_phy_device OPdrivers/net/phy/nxp-c45-tja11xx.c+20 -250 repliesApplied
4/6net: phy: introduce genphy_match_phy_device()drivers/net/phy/phy_device.c include/linux/phy.h+40 -150 repliesApplied
5/6net: phy: Add support for Aeonsemi AS21xxx PHYsMAINTAINERS drivers/net/phy/Kconfig drivers/net/phy/Makefile +1 more+1106 -00 repliesApplied
6/6dt-bindings: net: Document support for Aeonsemi PHYsDocumentation/devicetree/bindings/net/aeonsemi,as21xxx.yaml MAINTAINERS+123 -00 repliesApplied

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchRussell King (Oracle)Andrew LunnRob Herring (Arm)Benno LossinFUJITA Tomonori
1/6R-b R-b R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v12 thread

Cover letter [net-next PATCH v12 0/6] net: phy: Add support for new Aeonsemi PHYs

Add support for new Aeonsemi 10G C45 PHYs. These PHYs intergate an IPC to setup some configuration and require special handling to sync with the parity bit. The parity bit is a way the IPC use to follow correct order of command sent.

Supported PHYs AS21011JB1, AS21011PB1, AS21010JB1, AS21010PB1, AS21511JB1, AS21511PB1, AS21510JB1, AS21510PB1, AS21210JB1, AS21210PB1 that all register with the PHY ID 0x7500 0x7500 before the firmware is loaded.

The big special thing about this PHY is that it does provide a generic PHY ID in C45 register that change to the correct one one the firmware is loaded.

In practice:
- MMD 0x7 ID 0x7500 0x9410 -> FW LOAD -> ID 0x7500 0x9422

To handle this, we operate on .match_phy_device where we check the PHY ID, if the ID match the generic one, we load the firmware and we return 0 (PHY driver doesn't match). Then PHY core will try the next PHY driver in the list and this time the PHY is correctly filled in and we register for it.

To help in the matching and not modify part of the PHY device struct, .match_phy_device is extended to provide also the current phy_driver is trying to match for. This add the extra benefits that some other PHY can simplify their .match_phy_device OP.

Changes v12:
- Reduce Rust changes to minimum compile (a real implementation will come later by Rust team)
Changes v11:
- Move rust changes to patch 1 (improve bisectability)
- Improve rust binding with suggested format
Changes v10:
- Add rust patch
Changes v9:
- Reorder AS21XXX_PHY kconfig before Airoha
- Add Reviewed-by tag from Andrew
Changes v8:
- Move IPC ready condition to dedicated function for poll timeout
- Fix typo aeon_ipcs_wait_cmd -> aeon_ipc_wait_cmd
- Merge aeon_ipc_send_msg and aeon_ipc_rcv_msg to
correctly handle locking
- Fix AEON_MAX_LDES typo
Changes v7:
- Make sure fw_version is NULL terminated
- Better describe logic for .match_phy_device
Changes v6:
- Out of RFC
- Add Reviewed-by tag from Russell
Changes v5:
- Add Reviewed-by tag from Rob
- Fix subject in DT patch
- Fix wrong Suggested-by tag in patch 1
- Rework nxp patch to 80 column
Changes v4:
- Add Reviewed-by tag
- Better handle PHY ID scan in as21xxx
- Also simplify nxp driver and fix .match_phy_device
Changes v3:
- Correct typo intergate->integrate
- Try to reduce to 80 column (where possible... define become unreasable if split)
- Rework to new .match_phy_device implementation
- Init active_low_led and fix other minor smatch war
- Drop inline tag (kbot doesn't like it but not reported by checkpatch???) Changes v2:
- Move to RFC as net-next closed :(
- Add lock for IPC command
- Better check size values from IPC
- Add PHY ID for all supported PHYs
- Drop .get_feature (correct values are exported by standard regs)
- Rework LED event to enum
- Update .yaml with changes requested (firmware-name required for generic PHY ID)
- Better document C22 in C45
- Document PHY name logic
- Introduce patch to load PHY 2 times

Christian Marangi (6):
net: phy: pass PHY driver to .match_phy_device OP
net: phy: bcm87xx: simplify .match_phy_device OP
net: phy: nxp-c45-tja11xx: simplify .match_phy_device OP
net: phy: introduce genphy_match_phy_device()
net: phy: Add support for Aeonsemi AS21xxx PHYs
dt-bindings: net: Document support for Aeonsemi PHYs

 .../bindings/net/aeonsemi,as21xxx.yaml        |  122 ++
 MAINTAINERS                                   |    7 +
 drivers/net/phy/Kconfig                       |   12 +
 drivers/net/phy/Makefile                      |    1 +
 drivers/net/phy/as21xxx.c                     | 1087 +++++++++++++++++
 drivers/net/phy/bcm87xx.c                     |   14 +-
 drivers/net/phy/icplus.c                      |    6 +-
 drivers/net/phy/marvell10g.c                  |   12 +-
 drivers/net/phy/micrel.c                      |    6 +-
 drivers/net/phy/nxp-c45-tja11xx.c             |   41 +-
 drivers/net/phy/nxp-tja11xx.c                 |    6 +-
 drivers/net/phy/phy_device.c                  |   52 +-
 drivers/net/phy/realtek/realtek_main.c        |   27 +-
 drivers/net/phy/teranetics.c                  |    3 +-
 include/linux/phy.h                           |    6 +-
 rust/kernel/net/phy.rs                        |    1 +
 16 files changed, 1337 insertions(+), 66 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/aeonsemi,as21xxx.yaml
 create mode 100644 drivers/net/phy/as21xxx.c
Signature · 1 line
2.48.1