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>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [net-next RFC PATCH v2 0/3] net: phy: Add support for new Aeonsemi PHYs
Date: Wed, 26 Mar 2025 01:23:56 +0100 [thread overview]
Message-ID: <20250326002404.25530-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 apply a simple approach where the PHY
is registered a first time, with the PHY driver maching for
the generic PHY ID (0x7500 0x9410), probing and loading the fw.
The PHY driver enable the new option "needs_reregister" in phy_device.
This special option will detach the PHY driver from the PHY device,
scan the MDIO BUS for that address and attach it again. This is
done entirely in one go at the phy_register_device time.
At the second time the driver will match the more specific PHY ID
(0x7500 0x9422) as the PHY now provides it now that is had the FW
loaded.
We can assume the PHY doesn't change Vendor or Family after
the PHY is loaded (that wouldn't make sense) and in the extreme
case this happen, no PHY will be matched and the generic one is
loaded.
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 (3):
net: phy: permit PHYs to register a second time
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 | 973 ++++++++++++++++++
drivers/net/phy/phy_device.c | 27 +
include/linux/phy.h | 5 +
7 files changed, 1147 insertions(+)
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-03-26 0:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 0:23 Christian Marangi [this message]
2025-03-26 0:23 ` [net-next RFC PATCH v2 1/3] net: phy: permit PHYs to register a second time Christian Marangi
2025-03-26 0:23 ` [net-next RFC PATCH v2 2/3] net: phy: Add support for Aeonsemi AS21xxx PHYs Christian Marangi
2025-03-26 13:53 ` Russell King (Oracle)
2025-03-26 13:57 ` Andrew Lunn
2025-03-26 14:47 ` Christian Marangi
2025-03-26 14:43 ` Christian Marangi
2025-03-26 18:02 ` Russell King (Oracle)
2025-03-26 14:00 ` Simon Horman
2025-03-26 14:05 ` Simon Horman
2025-03-26 14:56 ` Andrew Lunn
2025-03-26 15:09 ` Christian Marangi
2025-03-26 18:08 ` Russell King (Oracle)
2025-03-26 18:18 ` Christian Marangi
2025-03-26 18:32 ` Russell King (Oracle)
2025-03-26 0:23 ` [net-next RFC PATCH v2 3/3] dt-bindings: net: Document support for Aeonsemi PHYs Christian Marangi
2025-03-26 15:08 ` Andrew Lunn
2025-03-26 15:16 ` 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=20250326002404.25530-1-ansuelsmth@gmail.com \
--to=ansuelsmth@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/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