[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260122105654.105600-1-vladimir.oltean@nxp.com>
Date: Thu, 22 Jan 2026 12:56:39 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
linux-kernel@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Herve Codina <herve.codina@...tlin.com>,
Mark Brown <broonie@...nel.org>,
Serge Semin <fancer.lancer@...il.com>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Lee Jones <lee@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
devicetree@...r.kernel.org,
Choong Yong Liang <yong.liang.choong@...ux.intel.com>,
Jiawen Wu <jiawenwu@...stnetic.com>
Subject: [PATCH v2 net-next 00/15] Probe SJA1105 DSA children as platform sub-devices
The NXP SJA1105 and SJA1110 switches have a linear address space thanks
to their SPI-to-AHB bridge. This address space contains not only the
Ethernet switch, but (depending on hw generation) SGMII PCS blocks,
MDIO controllers, interrupt controllers, GPIO controllers. Of these, the
SGMII PCS blocks and the MDIO controllers are supported today by the DSA
driver, through internal programming.
This series proposes registering platform devices for each non-switch
weakly coupled component, all such devices being backed by an OF node
(and reachable through phandles to it), one or more resources and the
switch global regmap. For backward compatibility and not only (DT author
convenience), if these OF nodes do not exist, they are created using the
dynamic of_changeset API.
The motivation must be explained top-down:
The high-level goal is to customize the XPCS (SGMII PCS block) with
board-specific device tree that describe the required differential
lane polarity.
But the XPCS is not presently described in the device tree in
SJA1105/SJA1110, hence the desire to do that.
However, instances of XPCS blocks described in the device tree already
exist for the case where it is MMIO-mapped. Those bindings dictate how
the XPCS in SJA1105/SJA1110 should be described.
v1 at:
https://lore.kernel.org/netdev/20251118190530.580267-1-vladimir.oltean@nxp.com/
Major changes since v1:
- Stop using MFD API due to pushback from Lee Jones. Create replacement
of_subdevs_populate() API localized to sja1105 (can be moved if need
be)
- Exclude first patch "net: dsa: sja1105: let phylink help with the
replay of link callbacks", upstreamed separately.
- Include XPCS lane polarity parsing.
Minor changes listed in individual patches.
Note that the current of_changeset API is "sufficient" for this use
case, but if its use is acceptable for XPCS, I will need to look at
expanding it with phandle support, for the interrupt controller
sub-device. I was able to "wing it" here by manually keeping dynamic
fwnode_handle references rather than reaching them through phandles,
but that has limits.
Vladimir Oltean (15):
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
net: dsa: sja1105: transition OF-based MDIO controllers to standalone
sub-devices
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: fill device tree with ethernet-pcs sub-devices
under "regs" node
net: dsa: sja1105: replace mdiobus-pcs with xpcs-plat driver
net: dsa: sja1105: permit finding the XPCS via pcs-handle
dt-bindings: net: xpcs: allow properties from phy-common-props.yaml
net: pcs: xpcs: allow generic polarity inversion
.../bindings/net/dsa/nxp,sja1105.yaml | 27 +
.../bindings/net/pcs/snps,dw-xpcs.yaml | 13 +-
MAINTAINERS | 2 +
drivers/net/dsa/sja1105/Kconfig | 1 +
drivers/net/dsa/sja1105/Makefile | 2 +-
drivers/net/dsa/sja1105/sja1105.h | 39 +-
drivers/net/dsa/sja1105/sja1105_main.c | 86 ++-
drivers/net/dsa/sja1105/sja1105_mdio.c | 507 -----------------
drivers/net/dsa/sja1105/sja1105_spi.c | 113 +++-
drivers/net/dsa/sja1105/sja1105_subdev.c | 513 ++++++++++++++++++
drivers/net/dsa/sja1105/sja1105_subdev.h | 10 +
drivers/net/mdio/Kconfig | 22 +-
drivers/net/mdio/Makefile | 2 +
drivers/net/mdio/mdio-regmap-simple.c | 80 +++
drivers/net/mdio/mdio-regmap.c | 7 +-
drivers/net/mdio/mdio-sja1110-cbt1.c | 179 ++++++
drivers/net/pcs/Kconfig | 1 +
drivers/net/pcs/pcs-xpcs-nxp.c | 11 -
drivers/net/pcs/pcs-xpcs-plat.c | 146 +++--
drivers/net/pcs/pcs-xpcs.c | 58 +-
drivers/net/pcs/pcs-xpcs.h | 1 -
include/linux/mdio/mdio-regmap.h | 2 +
include/linux/pcs/pcs-xpcs.h | 1 +
23 files changed, 1185 insertions(+), 638 deletions(-)
delete mode 100644 drivers/net/dsa/sja1105/sja1105_mdio.c
create mode 100644 drivers/net/dsa/sja1105/sja1105_subdev.c
create mode 100644 drivers/net/dsa/sja1105/sja1105_subdev.h
create mode 100644 drivers/net/mdio/mdio-regmap-simple.c
create mode 100644 drivers/net/mdio/mdio-sja1110-cbt1.c
--
2.34.1
Powered by blists - more mailing lists