mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/7] net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support
@ 2026-11-09  8:59 Iustin Stolniceanu
  2026-11-09  8:59 ` [PATCH net-next v2 1/7] net: ethernet: oa_tc6: Forward declare struct mii_bus Iustin Stolniceanu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Iustin Stolniceanu @ 2026-11-09  8:59 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Parthiban Veerasooran, Heiner Kallweit, Russell King,
	Marcelo Schmitt
  Cc: Alvin Šipraga, Ciprian Regus, netdev, devicetree,
	linux-kernel, Iustin Stolniceanu

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).

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. For v2 I ran
Sashiko again on the settle time patch (2/7) and the adin1110 patch
(7/7), the two with real code changes, and fixed the one real issue
it found.

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)
   Link: https://lore.kernel.org/r/au3C27DWOcZiMLxb@analog.com
 - 2/7: split reset_settle_us into hwreset_settle_us (default 1 ms) and
   softreset_settle_us (default 0); fsleep() unconditionally (Alvin)
   Link: https://lore.kernel.org/r/aus8XiLynJmSXaXc@analog.com
 - 3/7: use if (!DPRAC) mdio_indirect_mode = true (Alvin)
   Link: https://lore.kernel.org/r/aus8GQ-Xut5XBNwU@analog.com
 - 4/7: new: one phy_driver per model with PHY_ID_MATCH_MODEL() instead
   of a single entry with mask 0xffffffcf (Andrew, Alvin)
   Link: https://lore.kernel.org/r/309a1eb9-8255-42f0-a510-b40bf3302bbd@lunn.ch
 - 5/7: (was 5/5) omit .soft_reset on the ADIN1110/ADIN2111 entries
   instead of checking the PHY ID in the callback (Alvin)
   Link: https://lore.kernel.org/r/autAidTgykOObtzp@analog.com
 - 6/7: (was 3/5) disallow adi,spi-crc together with adi,spi-oa-tc6 (Alvin)
   Link: https://lore.kernel.org/r/aus899mJ-XZg6ZgF@analog.com
 - 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).
   Link: https://lore.kernel.org/r/aus-LdkVRPxR6lFu@analog.com
   Link: https://lore.kernel.org/r/c1747691-2c2e-4a7a-af04-92c94cb041b2@lunn.ch
   Link: https://lore.kernel.org/r/sashiko-outbox-197578@kernel.org

v1: https://lore.kernel.org/r/20261103160918.409701-1-iustin.stolniceanu@analog.com


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 |  12 +
 drivers/net/ethernet/adi/Kconfig              |   1 +
 drivers/net/ethernet/adi/adin1110.c           | 206 +++++++++++++++++-
 drivers/net/ethernet/oa_tc6.c                 | 188 ++++++++++++++--
 drivers/net/phy/adin1100.c                    |  33 ++-
 include/linux/oa_tc6.h                        |  20 ++
 6 files changed, 435 insertions(+), 25 deletions(-)


base-commit: 7b6ab4dbc156e2f96419715130b3d5738a306c93
-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-09  9:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09  8:59 [PATCH net-next v2 0/7] net: ethernet: adi: adin1110: Add OPEN Alliance TC6 support Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 1/7] net: ethernet: oa_tc6: Forward declare struct mii_bus Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 2/7] net: ethernet: oa_tc6: Allow custom reset settle time values Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 3/7] net: ethernet: oa_tc6: Add support for MDIO indirect access Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 4/7] net: phy: adin1100: Add separate driver entries for ADIN1110/ADIN2111 Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 5/7] net: phy: adin1100: Skip the soft reset on ADIN1110/ADIN2111 Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 6/7] dt-bindings: net: adi,adin1110: Add adi,spi-oa-tc6 Iustin Stolniceanu
2026-11-09  8:59 ` [PATCH net-next v2 7/7] net: ethernet: adi: adin1110: Add OA TC6 protocol support for ADIN1110 Iustin Stolniceanu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®