From: Daniel Golle <daniel@makrotopia.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
"Horatiu Vultur" <horatiu.vultur@microchip.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Vinod Koul" <vkoul@kernel.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Eric Woudstra" <ericwouds@gmail.com>,
"Marek Behún" <kabel@kernel.org>, "Lee Jones" <lee@kernel.org>,
"Patrice Chotard" <patrice.chotard@foss.st.com>
Subject: Re: [PATCH net-next 0/9] XPCS polarity inversion via generic device tree properties
Date: Tue, 25 Nov 2025 14:36:42 +0000 [thread overview]
Message-ID: <aSW--slbJWpXK0nv@makrotopia.org> (raw)
In-Reply-To: <20251122193341.332324-1-vladimir.oltean@nxp.com>
On Sat, Nov 22, 2025 at 09:33:32PM +0200, Vladimir Oltean wrote:
> Polarity inversion (described in patch 3/6) is a feature with at least 3
> potential new users waiting for a generic description:
> - Horatiu Vultur with the lan966x SerDes
> - Daniel Golle with the MaxLinear GSW1xx switches
> - Me with a custom SJA1105 board, switch which uses the DesignWare XPCS
>
> I became interested in exploring the problem space because I was averse
> to the idea of adding vendor-specific device tree properties to describe
> a common need.
Thank you for coming up with a good solution, and even generalizing
this beyond networking scope :)
>
> This set contains an implementation of a generic feature that should
> cater to all known needs that were identified during my documentation
> phase. I've added a new user - the XPCS - and I've converted an existing
> user - the EN8811H Ethernet PHY.
>
> I haven't converted the rest due to various reasons:
> - "mediatek,pnswap" is defined bidirectionally and the underlying
> SGMII_PN_SWAP_TX_RX register field doesn't make it clear which bit is
> RX and which is TX. Needs more work and expert knowledge from maintainer.
Just to quickly answer to that one from MediaTek's SDK[1]:
#define SGMII_PN_SWAP_RX BIT(1)
#define SGMII_PN_SWAP_TX BIT(0)
So MediaTek LynxI is ready to be supported via the standard properties
you are suggesting.
[1]: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/5cecec123e1ab4c7f4eabd5630e8e8b2e89b9cf0/autobuild/unified/filogic/master/files/target/linux/mediatek/patches-6.6/999-2607-net-pcs-mtk-lynxi-add-individual-polarity-control.patch
> - "st,px_rx_pol_inv" - its binding is a .txt file and I don't have time
> for such a large detour to convert it to dtschema.
> - "st,pcie-tx-pol-inv" and "st,sata-tx-pol-inv" - these are defined in a
> .txt schema but are not implemented in any driver. My verdict would be
> "delete the properties" but again, I would prefer not introducing such
> dependency to this series.
>
> Vladimir Oltean (9):
> dt-bindings: phy: rename transmit-amplitude.yaml to
> phy-common-props.yaml
> dt-bindings: phy-common-props: create a reusable "protocol-names"
> definition
> dt-bindings: phy-common-props: RX and TX lane polarity inversion
> dt-bindings: net: xpcs: allow properties from phy-common-props.yaml
> phy: add phy_get_rx_polarity() and phy_get_tx_polarity()
> net: pcs: xpcs: promote SJA1105 TX polarity inversion to core
> net: pcs: xpcs: allow lane polarity inversion
> net: phy: air_en8811h: deprecate "airoha,pnswap-rx" and
> "airoha,pnswap-tx"
> dt-bindings: net: airoha,en8811h: deprecate "airoha,pnswap-rx" and
> "airoha,pnswap-tx"
>
> .../bindings/net/airoha,en8811h.yaml | 11 +-
> .../bindings/net/pcs/snps,dw-xpcs.yaml | 5 +-
> .../bindings/phy/phy-common-props.yaml | 152 ++++++++++++++++++
> .../bindings/phy/transmit-amplitude.yaml | 103 ------------
> MAINTAINERS | 21 +++
> drivers/net/pcs/Kconfig | 1 +
> drivers/net/pcs/pcs-xpcs-nxp.c | 11 --
> drivers/net/pcs/pcs-xpcs.c | 58 ++++++-
> drivers/net/pcs/pcs-xpcs.h | 2 +-
> drivers/net/phy/Kconfig | 1 +
> drivers/net/phy/air_en8811h.c | 50 ++++--
> drivers/phy/Kconfig | 9 ++
> drivers/phy/Makefile | 1 +
> drivers/phy/phy-common-props.c | 117 ++++++++++++++
> include/dt-bindings/phy/phy.h | 4 +
> include/linux/phy/phy-common-props.h | 20 +++
> 16 files changed, 426 insertions(+), 140 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/phy/phy-common-props.yaml
> delete mode 100644 Documentation/devicetree/bindings/phy/transmit-amplitude.yaml
> create mode 100644 drivers/phy/phy-common-props.c
> create mode 100644 include/linux/phy/phy-common-props.h
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-11-25 14:37 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-22 19:33 [PATCH net-next 0/9] XPCS polarity inversion via generic device tree properties Vladimir Oltean
2025-11-22 19:33 ` [PATCH net-next 1/9] dt-bindings: phy: rename transmit-amplitude.yaml to phy-common-props.yaml Vladimir Oltean
2025-11-25 21:19 ` Andrew Lunn
2025-11-25 21:44 ` Vladimir Oltean
2025-11-25 22:33 ` Andrew Lunn
2025-11-26 7:26 ` Vladimir Oltean
2025-11-26 9:32 ` Holger Brunck
2025-11-26 10:33 ` Vladimir Oltean
2025-11-26 10:45 ` Holger Brunck
2025-11-26 10:51 ` Vladimir Oltean
2025-11-26 13:05 ` Holger Brunck
2025-11-26 14:09 ` Andrew Lunn
2025-11-26 14:25 ` Maxime Chevallier
2025-12-04 16:11 ` Rob Herring (Arm)
2025-11-22 19:33 ` [PATCH net-next 2/9] dt-bindings: phy-common-props: create a reusable "protocol-names" definition Vladimir Oltean
2025-12-04 15:52 ` Rob Herring
2025-12-04 16:11 ` Rob Herring
2025-11-22 19:33 ` [PATCH net-next 3/9] dt-bindings: phy-common-props: RX and TX lane polarity inversion Vladimir Oltean
2025-12-04 16:13 ` Rob Herring (Arm)
2025-11-22 19:33 ` [PATCH net-next 4/9] dt-bindings: net: xpcs: allow properties from phy-common-props.yaml Vladimir Oltean
2025-12-04 16:13 ` Rob Herring (Arm)
2025-11-22 19:33 ` [PATCH net-next 5/9] phy: add phy_get_rx_polarity() and phy_get_tx_polarity() Vladimir Oltean
2025-11-25 4:01 ` Jakub Kicinski
2025-11-25 17:02 ` Vladimir Oltean
2025-12-01 8:37 ` Vinod Koul
2025-12-01 8:41 ` Krzysztof Kozlowski
2025-12-04 15:34 ` Vladimir Oltean
2025-12-04 16:48 ` Krzysztof Kozlowski
2025-12-01 19:03 ` Jakub Kicinski
2025-11-22 19:33 ` [PATCH net-next 6/9] net: pcs: xpcs: promote SJA1105 TX polarity inversion to core Vladimir Oltean
2025-11-22 19:33 ` [PATCH net-next 7/9] net: pcs: xpcs: allow lane polarity inversion Vladimir Oltean
2025-11-26 15:17 ` kernel test robot
2025-11-22 19:33 ` [PATCH net-next 8/9] net: phy: air_en8811h: deprecate "airoha,pnswap-rx" and "airoha,pnswap-tx" Vladimir Oltean
2025-11-22 19:33 ` [PATCH net-next 9/9] dt-bindings: net: airoha,en8811h: " Vladimir Oltean
2025-12-04 16:13 ` Rob Herring (Arm)
2025-11-25 14:36 ` Daniel Golle [this message]
2025-12-27 16:12 ` [PATCH net-next 0/9] XPCS polarity inversion via generic device tree properties Bjørn Mork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aSW--slbJWpXK0nv@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=ericwouds@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=kabel@kernel.org \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=lee@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=patrice.chotard@foss.st.com \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).