devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/15] Probe SJA1105 DSA children using MFD and dynamic OF nodes
@ 2025-11-18 19:05 Vladimir Oltean
  2025-11-18 19:05 ` [PATCH net-next 12/15] dt-bindings: net: dsa: sja1105: document the PCS nodes Vladimir Oltean
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Vladimir Oltean @ 2025-11-18 19:05 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel,
	Andy Shevchenko, Herve Codina, Mark Brown, Serge Semin,
	Maxime Chevallier, Lee Jones, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree

This series prepares the SJA1105 driver for a goal covered in upcoming
patches: customize the XPCS with extra device tree properties for board
specific settings (specifically lane polarity).

The XPCS handles conversion of internal parallel Ethernet MAC data onto
a SGMII serial interface. This block can be memory-mapped or it can be
accessed over MDIO. Its driver (drivers/net/pcs/pcs-xpcs.c) always
expects it to be on an MDIO bus, so if memory-mapped, the code creates a
fake MDIO bus whose reads and writes go to the memory addresses. Note
that in the case of the SPI-controlled SJA1105 switches, memory-mapped
means accessible through the same device-specific SPI transfer protocol
that reads and writes any other switch register.

The status at present date in this DSA driver is that the XPCS is
implicitly created and used by the driver despite not described in the
device tree at all. The code which creates a fake MDIO bus for the XPCS
is itself a subset of the more general logic implemented in
drivers/net/pcs/pcs-xpcs-plat.c, and the latter already has DT bindings.

So we have to modify SJA1105's DT schema to allow XPCS children, and
modify the XPCS schema to allow SJA1105 compatibles (patch 12/15).

To retain compatibility with XPCS not being described in the device, we
use the dynamic OF API to create implicit XPCS nodes based on resources
hardcoded in the driver, when those nodes are missing (patch 13/15).

To probe the XPCS platform driver using its standard bindings but
adapted to sitting behind a SPI bus, the former needs to be converted
to regmap, as done in patch 11/15, and also needs to be aware of its
specific compatible string (patch 10/15). The SJA1105 also has to
provide a regmap for its child, in patch 05/15.

We use the MFD framework to probe the XPCS children. Actually, the XPCS
bindings want "reg" to denote the base address in the switch address
space, and the DSA ethernet-switch root node is not structured to be
able to provide that (other children need #address-cells = <0>). So we
create an intermediary "regs" node between the top-level ethernet-switch
node and the new ethernet-pcs node. This solves the device tree
hierarchy issue but results in the need for patch 07/15.

To use the MFD framework for XPCS, the SJA1105 driver must be decoupled
with it, interacting only through standard interfaces rather than
accessing it directly. Patch 01/15 replaces sja1105_static_config_reload()
interaction with generic phylink helpers for replaying link events after
a reset. Patch 10/15 and 15/15 obtain a simple phylink_pcs reference in
the SJA1105 driver based on the standard 'pcs-handle' device tree
property (phandle).

The work to use MFD for XPCS triggered a chain reaction where the other
MDIO buses implemented in the SJA1105 driver were also migrated to
standalone drivers and probed using MFD. This is the topic of patches
03/15, 04/15 and 08/15. This helps increase the separation of concerns
and makes the SJA1105 DSA driver more focused on switching stuff.

The rest (patches 02/15, 06/15, 09/15) are minor "glue" changes.

Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Herve Codina <herve.codina@bootlin.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Serge Semin <fancer.lancer@gmail.com>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Lee Jones <lee@kernel.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: devicetree@vger.kernel.org

Vladimir Oltean (15):
  net: dsa: sja1105: let phylink help with the replay of link callbacks
  net: mdio-regmap: permit working with non-MMIO regmaps
  net: mdio: add driver for NXP SJA1110 100BASE-T1 embedded PHYs
  net: mdio: add generic driver for NXP SJA1110 100BASE-TX embedded PHYs
  net: dsa: sja1105: prepare regmap for passing to child devices
  net: dsa: sja1105: include spi.h from sja1105.h
  mfd: core: add ability for cells to probe on a custom parent OF node
  net: dsa: sja1105: transition OF-based MDIO drivers to standalone
  net: dsa: sja1105: remove sja1105_mdio_private
  net: pcs: xpcs: introduce xpcs_create_pcs_fwnode()
  net: pcs: xpcs-plat: convert to regmap
  dt-bindings: net: dsa: sja1105: document the PCS nodes
  net: pcs: xpcs-plat: add NXP SJA1105/SJA1110 support
  net: dsa: sja1105: replace mdiobus-pcs with xpcs-plat driver
  net: dsa: sja1105: permit finding the XPCS via pcs-handle

 .../bindings/net/dsa/nxp,sja1105.yaml         |  28 +
 .../bindings/net/pcs/snps,dw-xpcs.yaml        |   8 +
 MAINTAINERS                                   |   2 +
 drivers/mfd/mfd-core.c                        |  11 +-
 drivers/net/dsa/sja1105/Kconfig               |   2 +
 drivers/net/dsa/sja1105/Makefile              |   2 +-
 drivers/net/dsa/sja1105/sja1105.h             |  42 +-
 drivers/net/dsa/sja1105/sja1105_main.c        | 169 +++---
 drivers/net/dsa/sja1105/sja1105_mdio.c        | 507 ------------------
 drivers/net/dsa/sja1105/sja1105_mfd.c         | 293 ++++++++++
 drivers/net/dsa/sja1105/sja1105_mfd.h         |  11 +
 drivers/net/dsa/sja1105/sja1105_spi.c         | 113 +++-
 drivers/net/mdio/Kconfig                      |  21 +-
 drivers/net/mdio/Makefile                     |   2 +
 drivers/net/mdio/mdio-regmap-simple.c         |  77 +++
 drivers/net/mdio/mdio-regmap.c                |   7 +-
 drivers/net/mdio/mdio-sja1110-cbt1.c          | 173 ++++++
 drivers/net/pcs/pcs-xpcs-plat.c               | 146 +++--
 drivers/net/pcs/pcs-xpcs.c                    |  12 +
 drivers/net/phy/phylink.c                     |  75 ++-
 include/linux/mdio/mdio-regmap.h              |   2 +
 include/linux/mfd/core.h                      |   7 +
 include/linux/pcs/pcs-xpcs.h                  |   1 +
 include/linux/phylink.h                       |   5 +
 24 files changed, 1033 insertions(+), 683 deletions(-)
 delete mode 100644 drivers/net/dsa/sja1105/sja1105_mdio.c
 create mode 100644 drivers/net/dsa/sja1105/sja1105_mfd.c
 create mode 100644 drivers/net/dsa/sja1105/sja1105_mfd.h
 create mode 100644 drivers/net/mdio/mdio-regmap-simple.c
 create mode 100644 drivers/net/mdio/mdio-sja1110-cbt1.c

-- 
2.34.1


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

end of thread, other threads:[~2025-11-20 17:30 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 19:05 [PATCH net-next 00/15] Probe SJA1105 DSA children using MFD and dynamic OF nodes Vladimir Oltean
2025-11-18 19:05 ` [PATCH net-next 12/15] dt-bindings: net: dsa: sja1105: document the PCS nodes Vladimir Oltean
2025-11-20 17:30   ` Rob Herring
2025-11-18 19:05 ` [PATCH net-next 13/15] net: pcs: xpcs-plat: add NXP SJA1105/SJA1110 support Vladimir Oltean
2025-11-18 19:05 ` [PATCH net-next 14/15] net: dsa: sja1105: replace mdiobus-pcs with xpcs-plat driver Vladimir Oltean
2025-11-19  0:41   ` Jakub Kicinski
2025-11-19  9:59     ` Vladimir Oltean
2025-11-19 10:31       ` Andy Shevchenko
2025-11-19 11:25         ` Vladimir Oltean
2025-11-19 16:11           ` Jakub Kicinski
2025-11-19 16:17             ` Andy Shevchenko
2025-11-19 17:23               ` Russell King (Oracle)
2025-11-19 17:39                 ` Andy Shevchenko
2025-11-19 18:35                   ` Jakub Kicinski
2025-11-19 19:33                     ` Andy Shevchenko
2025-11-20 12:32             ` Russell King (Oracle)
2025-11-20 15:00               ` Jakub Kicinski
2025-11-19 11:19   ` kernel test robot
2025-11-19 12:01     ` Vladimir Oltean
2025-11-19 12:03       ` Russell King (Oracle)
2025-11-19 12:05         ` Russell King (Oracle)
2025-11-19 13:28           ` Vladimir Oltean
2025-11-19 12:01   ` kernel test robot
2025-11-20  0:01   ` kernel test robot
2025-11-18 19:05 ` [PATCH net-next 15/15] net: dsa: sja1105: permit finding the XPCS via pcs-handle Vladimir Oltean

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