[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176971025335.1390033.17907150388219680260.robh@kernel.org>
Date: Thu, 29 Jan 2026 12:10:53 -0600
From: "Rob Herring (Arm)" <robh@...nel.org>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: Eric Dumazet <edumazet@...gle.com>,
Herve Codina <herve.codina@...tlin.com>,
Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Choong Yong Liang <yong.liang.choong@...ux.intel.com>,
Mark Brown <broonie@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Lee Jones <lee@...nel.org>, Jiawen Wu <jiawenwu@...stnetic.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
"David S. Miller" <davem@...emloft.net>,
Maxime Chevallier <maxime.chevallier@...tlin.com>,
Serge Semin <fancer.lancer@...il.com>
Subject: Re: [PATCH v2 net-next 09/15] dt-bindings: net: dsa: sja1105:
document the PCS nodes
On Thu, 22 Jan 2026 12:56:48 +0200, Vladimir Oltean wrote:
> Some (not all) use cases are in dire need of describing the XPCS blocks
> embedded in the NXP SJA1105 and SJA1110 switches in the device tree.
> The use case driving this effort is specifying custom 'rx-polarity' or
> 'tx-polarity' property values.
>
> These PCS blocks follow the same bindings as the other instances which
> are memory-mapped using an APB3 or MCI interface.
>
> Since the SJA1105 applies the
> Documentation/devicetree/bindings/net/ethernet-switch.yaml schema
> directly on the SPI device OF node, its bindings are incompatible with
> describing address space regions where sub-devices like the XPCS exist.
> Namely, ethernet-switch.yaml wants #address-cells and #size-cells = <0>
> to satisfy the unit-address-less '^(ethernet-)?ports$' child node.
> But the XPCS sub-devices want their unit address to be the start
> of their "reg" region in the switch address space, and that
> requires #address-cells and #size-cells = <1>.
>
> If the SPI device OF node had an MFD-style schema, i.e. "(1)" from here:
> https://lore.kernel.org/netdev/20260109121432.lu2o22iijd4i57qq@skbuf/
> things would have been simpler. But that ship has sailed and we need to
> continue supporting the direction in which the SJA1105 bindings have
> started already.
>
> The retrofit-ready compromise solution is for the ethernet-switch to
> define a custom "regs" sub-node with #address-cells and #size-cells = <1>,
> and this will hold any memory-mapped sub-devices, like the XPCS in this
> case.
>
> This solution could have been used for the "nxp,sja1110-base-t1-mdio"
> and "nxp,sja1110-base-tx-mdio" sub-devices too (although that ship has
> also sailed), and is further extensible for other SJA1110 sub-devices
> not yet supported (GPIO controller, cascaded IRQ controller).
>
> Document the XPCS integration-specific compatible string, positioning in
> the switch's "regs" subnode, and the pcs-handle to them.
>
> The "type: object" addition in the ethernet-port node is to suppress
> a dt_binding_check warning that states "node schemas must have a type
> or $ref". Rob Herring explains why this started being required just now:
> https://lore.kernel.org/netdev/20251120173012.GA1563834-robh@kernel.org/
>
> Because the regs and ethernet-pcs nodes are optional, I don't want to
> pollute the example with them. However, I think I can add them to the
> commit message:
>
> compatible = "nxp,sja1105s";
> ...
> regs {
> #address-cells = <0x01>;
> #size-cells = <0x01>;
>
> ethernet-pcs@0 {
> compatible = "nxp,sja1105-pcs";
> reg = <0x00 0x800000>;
> reg-names = "direct";
> reg-io-width = <0x04>;
> tx-polarity = <PHY_POL_INVERTED>;
> };
> };
>
> compatible = "nxp,sja1110a";
> ...
> regs {
> #address-cells = <0x01>;
> #size-cells = <0x01>;
>
> ethernet-pcs@...000 {
> compatible = "nxp,sja1110-pcs";
> reg = <0x705000 0x1000>;
> reg-names = "indirect";
> reg-io-width = <0x04>;
> tx-polarity = <PHY_POL_NORMAL>;
> };
>
> ethernet-pcs@...000 {
> compatible = "nxp,sja1110-pcs";
> reg = <0x706000 0x1000>;
> reg-names = "indirect";
> reg-io-width = <0x04>;
> tx-polarity = <PHY_POL_NORMAL>;
> };
>
> ethernet-pcs@...000 {
> compatible = "nxp,sja1110-pcs";
> reg = <0x707000 0x1000>;
> reg-names = "indirect";
> reg-io-width = <0x04>;
> tx-polarity = <PHY_POL_NORMAL>;
> };
>
> ethernet-pcs@...000 {
> compatible = "nxp,sja1110-pcs";
> reg = <0x708000 0x1000>;
> reg-names = "indirect";
> reg-io-width = <0x04>;
> tx-polarity = <PHY_POL_NORMAL>;
> };
> };
>
> Cc: Rob Herring <robh@...nel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@...nel.org>
> Cc: Conor Dooley <conor+dt@...nel.org>
> Cc: devicetree@...r.kernel.org
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> ---
> v1->v2: rewrite commit message
>
> .../bindings/net/dsa/nxp,sja1105.yaml | 27 +++++++++++++++++++
> .../bindings/net/pcs/snps,dw-xpcs.yaml | 8 ++++++
> 2 files changed, 35 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@...nel.org>
Powered by blists - more mailing lists