net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest7 patches 1 replyIn review
- v27 patches 6 repliesSuperseded
- v15 patches 18 repliesSuperseded
Changes in v3 from the cover letter
- 2/7: embed struct oa_tc6_quirks in struct oa_tc6 instead of copying its fields (Selvamani). Dropped Alvin's Reviewed-by, as the patch changed.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | net: ethernet: oa_tc6: Forward declare struct mii_businclude/ | +1 | 0 replies | |
| 2/7 | net: ethernet: oa_tc6: Allow custom reset settle time valuesdrivers/ include/ | +15 | 0 replies | |
| 3/7 | net: ethernet: oa_tc6: Add support for MDIO indirect accessdrivers/ include/ | +177 | 0 replies | |
| 4/7 | net: phy: adin1100: Add separate driver entries for ADIN1110/ADIN2111drivers/ | +33 | 0 replies | |
| 5/7 | net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111drivers/ | +0 | 0 replies | |
| 6/7 | dt-bindings: net: adi,adin1110: Add adi,spi-oa-tc6Documentation/ | +16 | 1 reply | |
| 7/7 | net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110drivers/ drivers/ | +205 | 0 replies |
Reviews trailers per patch
5 of 7 patches have a Reviewed-by or Acked-by.
| Patch | Alvin Šipraga | Rob Herring (Arm) |
|---|---|---|
| 1/7 | R-b | |
| 2/7 | ||
| 3/7 | R-b | |
| 4/7 | R-b | |
| 5/7 | R-b | |
| 6/7 | R-b | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH net-next v3 0/7] net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support
The ADIN1110 supports two SPI host interface protocols: the generic SPI protocol, which the adin1110 driver implements today, and the OPEN Alliance TC6 protocol. Two pins select the mode, and the device latches them when it comes out of reset:
- SPI_CFG1 selects the protocol: OPEN Alliance TC6 when low (or left floating), generic SPI when high.
- SPI_CFG0 enables the CRC8 of the generic SPI protocol, or the control data protection of the OPEN Alliance protocol: enabled when low, disabled when high.
SPI_CFG0 can be read back, as the PROTE bit of CONFIG0, and the generic SPI case is already described by the adi,spi-crc property. No register reports SPI_CFG1, so the protocol cannot be detected by reading the chip.
This series adds OPEN Alliance TC6 support for the ADIN1110 using the oa_tc6 framework, selected by a new adi,spi-oa-tc6 DT property:
1: oa_tc6: forward declare struct mii_bus in oa_tc6.h
2-3: oa_tc6: configurable reset settle times, and indirect MDIO access
(MDIOACC) for MAC-PHYs without direct PHY register access
4-5: adin1100: separate phy_driver entries per model, then skip the
soft reset on ADIN1110/ADIN2111, as it resets the whole MAC-PHY
6: dt-bindings: add adi,spi-oa-tc6
7: adin1110: add the OPEN Alliance TC6 probe path
The ADIN2111 is not supported in OPEN Alliance TC6 mode yet.
If adi,spi-oa-tc6 does not match the board strapping, probe fails with -ENODEV and a message pointing at the SPI_CFG1 strap and the property.
As promised in the v1 thread, I tried the wrong framing on an EVAL-ADIN1110EBZ in both directions. OA TC6 access to a generic SPI strapped chip gets no valid reply and does not set SPI_ERR. Generic SPI access to an OA TC6 strapped chip returns garbage and sets HDRE and LOFE in STATUS0, which are write-1-to-clear, and OA TC6 access keeps working afterwards. So the protocols can be told apart, but I kept the explicit property for now. If autodetection is preferred, I can do that before the binding is merged.
Testing: Raspberry Pi 4 with an EVAL-ADIN1110EBZ, SPI at 25 MHz, against a 10BASE-T1L link partner, on a normal and a debug kernel (KASAN, lockdep, kmemleak). OPEN Alliance TC6 mode: probe/remove 20x, sysfs unbind/bind 10x, link up/down under traffic, frame sizes 42-1514 bytes, flood ping, ~9.4 Mbit/s TCP in each direction, 0% loss on 10 Mbit/s bidirectional UDP, joined multicast group and macvlan traffic. Generic SPI mode: same results with and without the series. Both mismatches (adi,spi-oa-tc6 set on a generic SPI strapped board, and the reverse) fail with -ENODEV and a clear message. OPEN Alliance TC6 was tested with and without control protection (SPI_CFG0). v3 was retested in OPEN Alliance TC6 mode with control protection, on the normal kernel.
Known limitations, unchanged by this series:
- A "Config unsync" error (e.g. after a chip reset) makes oa_tc6 disable the device until the driver is reloaded.
- On unload, a lockdep enabled kernel prints a "suspicious RCU usage" warning from phy_detach_internal(), as phy_disconnect() is called without the RTNL held. The generic SPI path of the unpatched driver does the same.
Parts of the code and of the commit messages were developed with the help of an AI assistant (Claude Opus 5.5); all changes were reviewed and tested on hardware by the submitter. The v1 patches 1-4 were also reviewed with Sashiko (Claude Opus 5.5) before sending, and the v2 findings of the Sashiko bot on the list were checked against the code and the datasheet for v3.
Changes in v3:
- 2/7: embed struct oa_tc6_quirks in struct oa_tc6 instead of copying its fields (Selvamani). Dropped Alvin's Reviewed-by, as the patch changed.
- 3/7: use indirect MDIO access only when STDCAP.IPRAC is set, and keep -ENODEV when neither DPRAC nor IPRAC is set (Sashiko)
- 4/7: use PHY_ID_MATCH_EXACT() in the phy_driver entries, so that only revision 1 binds to the driver, as with the old 0xffffffcf mask (Sashiko)
- 6/7: move allOf to the bottom and drop the '|' of the adi,spi-oa-tc6 description (Krzysztof)
- 7/7: set netdev_ops before oa_tc6_init(), which attaches the PHY and can read netdev_ops through netdev_need_ops_lock() (Sashiko); commit
message: -EPROTO covers any OA TC6 reply error during initialization, not only the first transfer (Sashiko)
v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Reordered: the adin1100 patches now come before the adin1110 OA TC6 patch that needs them, so the series bisects cleanly.
- 1/7: new: split the struct mii_bus forward declaration out of the adin1110 patch (Alvin)
- 2/7: split reset_settle_us into hwreset_settle_us (default 1 ms) and softreset_settle_us (default 0); fsleep() unconditionally (Alvin)
- 3/7: use if (!DPRAC) mdio_indirect_mode = true (Alvin)
- 4/7: new: one phy_driver per model with PHY_ID_MATCH_MODEL() instead of a single entry with mask 0xffffffcf (Andrew, Alvin)
- 5/7: (was 5/5) omit .soft_reset on the ADIN1110/ADIN2111 entries instead of checking the PHY ID in the callback (Alvin)
- 6/7: (was 3/5) disallow adi,spi-crc together with adi,spi-oa-tc6 (Alvin)
- 7/7: (was 4/5) set 50 ms / 10 ms settle times from the datasheet; -ENODEV instead of -EOPNOTSUPP for ADIN2111; whitespace nits. Fail with -ENODEV and a clear message if adi,spi-oa-tc6 does not match the strapping (Andrew). Accept all multicast when the multicast list is not empty and don't set IFF_UNICAST_FLT, and use DEV_STATS_INC() for tx_dropped (Sashiko).
v1: https://lore.kernel.org/r/[email protected]
Ciprian Regus (4):
net: ethernet: oa_tc6: Allow custom reset settle time values
net: ethernet: oa_tc6: Add support for MDIO indirect access
dt-bindings: net: adi,adin1110: Add adi,spi-oa-tc6
net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110
Iustin Stolniceanu (3):
net: ethernet: oa_tc6: Forward declare struct mii_bus
net: phy: adin1100: Add separate driver entries for ADIN1110/ADIN2111
net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111
.../devicetree/bindings/net/adi,adin1110.yaml | 20 +- drivers/net/ethernet/adi/Kconfig | 1 + drivers/net/ethernet/adi/adin1110.c | 208 +++++++++++++++++- drivers/net/ethernet/oa_tc6.c | 194 ++++++++++++++-- drivers/net/phy/adin1100.c | 33 ++- include/linux/oa_tc6.h | 21 ++ 6 files changed, 445 insertions(+), 32 deletions(-)
base-commit: 7ccc5e05043b1bb84326b19a2b05938d8f7a2ae6
Signature · 1 line
2.43.0