From: Christian Marangi <ansuelsmth@gmail.com>
To: "Christian Marangi" <ansuelsmth@gmail.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Marek Behún" <kabel@kernel.org>,
"Andrei Botila" <andrei.botila@oss.nxp.com>,
"FUJITA Tomonori" <fujita.tomonori@gmail.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Danilo Krummrich" <dakr@kernel.org>,
"Sabrina Dubroca" <sd@queasysnail.net>,
"Michael Klein" <michael@fossekall.de>,
"Daniel Golle" <daniel@makrotopia.org>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: [net-next PATCH v10 0/7] net: phy: Add support for new Aeonsemi PHYs
Date: Thu, 15 May 2025 13:27:05 +0200 [thread overview]
Message-ID: <20250515112721.19323-1-ansuelsmth@gmail.com> (raw)
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 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 (7):
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
rust: net::phy sync with match_phy_device C changes
.../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 | 26 +-
16 files changed, 1359 insertions(+), 69 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/aeonsemi,as21xxx.yaml
create mode 100644 drivers/net/phy/as21xxx.c
--
2.48.1
next reply other threads:[~2025-05-15 11:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 11:27 Christian Marangi [this message]
2025-05-15 11:27 ` [net-next PATCH v10 1/7] net: phy: pass PHY driver to .match_phy_device OP Christian Marangi
2025-05-15 11:27 ` [net-next PATCH v10 2/7] net: phy: bcm87xx: simplify " Christian Marangi
2025-05-15 11:27 ` [net-next PATCH v10 3/7] net: phy: nxp-c45-tja11xx: " Christian Marangi
2025-05-15 11:27 ` [net-next PATCH v10 4/7] net: phy: introduce genphy_match_phy_device() Christian Marangi
2025-05-15 11:27 ` [net-next PATCH v10 5/7] net: phy: Add support for Aeonsemi AS21xxx PHYs Christian Marangi
2025-05-15 11:27 ` [net-next PATCH v10 6/7] dt-bindings: net: Document support for Aeonsemi PHYs Christian Marangi
2025-05-15 11:27 ` [net-next PATCH v10 7/7] rust: net::phy sync with match_phy_device C changes Christian Marangi
2025-05-15 11:49 ` Benno Lossin
2025-05-15 11:51 ` Christian Marangi
2025-05-15 12:01 ` Benno Lossin
2025-05-16 12:30 ` FUJITA Tomonori
2025-05-16 14:48 ` Benno Lossin
2025-05-16 15:12 ` Christian Marangi
2025-05-16 20:16 ` Benno Lossin
2025-05-17 6:27 ` FUJITA Tomonori
2025-05-17 8:06 ` Benno Lossin
2025-05-17 13:13 ` FUJITA Tomonori
2025-05-17 19:02 ` Benno Lossin
2025-05-17 20:09 ` Christian Marangi
2025-05-18 7:13 ` Benno Lossin
2025-05-19 12:00 ` FUJITA Tomonori
2025-05-19 12:32 ` Benno Lossin
2025-05-19 12:44 ` FUJITA Tomonori
2025-05-19 12:51 ` Benno Lossin
2025-05-19 12:58 ` FUJITA Tomonori
2025-05-16 15:10 ` Christian Marangi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250515112721.19323-1-ansuelsmth@gmail.com \
--to=ansuelsmth@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=andrei.botila@oss.nxp.com \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=conor+dt@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=hkallweit1@gmail.com \
--cc=kabel@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michael@fossekall.de \
--cc=netdev@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sd@queasysnail.net \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).