Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-phy@lists.infradead.org
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Horatiu Vultur" <horatiu.vultur@microchip.com>,
	"Bjørn Mork" <bjorn@mork.no>, "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>,
	"Neil Armstrong" <neil.armstrong@linaro.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: [PATCH v2 net-next 00/10] PHY polarity inversion via generic device tree properties
Date: Sat,  3 Jan 2026 23:03:53 +0200	[thread overview]
Message-ID: <20260103210403.438687-1-vladimir.oltean@nxp.com> (raw)

Introduce "rx-polarity" and "tx-polarity" device tree properties.
Convert two existing networking use cases - the EN8811H Ethernet PHY and
the Mediatek LynxI PCS.

Requested merge strategy:
Patches 1-5 through linux-phy
linux-phy provides stable branch or tag to netdev
patches 6-10 through netdev

Changes since v1:
- API changes: split error code from returned value; introduce two new
  helpers for simple driver cases
- Add KUnit tests
- Bug fixes in core code and in drivers
- Defer XPCS patches for later (*)
- Convert Mediatek LynxI PCS
- Logical change: rx-polarity and tx-polarity refer to the currently
  described block, and not necessarily to device pins
- Apply Rob's feedback
- Drop the "joint maintainership" idea. The request is for patches 1-6
  to be applied through linux-phy, then provide a stable PR branch, then
  apply patches 7-12 through netdev.

(*) To simplify the generic XPCS driver, I've decided to make
"tx-polarity" default to <PHY_POL_NORMAL>, rather than <PHY_POL_NORMAL>
OR <PHY_POL_INVERT> for SJA1105. But in order to avoid breakage, it
creates a hard dependency on this patch set being merged *first*:
https://lore.kernel.org/netdev/20251118190530.580267-1-vladimir.oltean@nxp.com/
so that the SJA1105 driver can provide an XPCS fwnode with the right
polarity specified. All patches in context can be seen at:
https://github.com/vladimiroltean/linux/tree/phy-polarity-inversion

v1 at:
https://lore.kernel.org/linux-phy/20251122193341.332324-1-vladimir.oltean@nxp.com/

Original cover letter:

Polarity inversion (described in patch 4/10) is a feature with at least
4 potential new users waiting for a generic description:
- Horatiu Vultur with the lan966x SerDes
- Daniel Golle with the MaxLinear GSW1xx switches
- Bjørn Mork with the AN8811HB Ethernet PHY
- 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.

This set contains an implementation of a generic feature that should
cater to all known needs that were identified during my documentation
phase.

Apart from what is converted here, we also have the following, which I
did not touch:
- "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 (10):
  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: ensure protocol-names are unique
  dt-bindings: phy-common-props: RX and TX lane polarity inversion
  phy: add phy_get_rx_polarity() and phy_get_tx_polarity()
  dt-bindings: net: airoha,en8811h: deprecate "airoha,pnswap-rx" and
    "airoha,pnswap-tx"
  net: phy: air_en8811h: deprecate "airoha,pnswap-rx" and
    "airoha,pnswap-tx"
  dt-bindings: net: pcs: mediatek,sgmiisys: deprecate "mediatek,pnswap"
  net: pcs: pcs-mtk-lynxi: pass SGMIISYS OF node to PCS
  net: pcs: pcs-mtk-lynxi: deprecate "mediatek,pnswap"

 .../bindings/net/airoha,en8811h.yaml          |  11 +-
 .../bindings/net/pcs/mediatek,sgmiisys.yaml   |   7 +-
 .../bindings/phy/phy-common-props.yaml        | 157 ++++++++
 .../bindings/phy/transmit-amplitude.yaml      | 103 -----
 MAINTAINERS                                   |  10 +
 drivers/net/dsa/mt7530-mdio.c                 |   4 +-
 drivers/net/ethernet/mediatek/mtk_eth_soc.c   |  19 +-
 drivers/net/pcs/Kconfig                       |   1 +
 drivers/net/pcs/pcs-mtk-lynxi.c               |  63 ++-
 drivers/net/phy/Kconfig                       |   1 +
 drivers/net/phy/air_en8811h.c                 |  53 ++-
 drivers/phy/Kconfig                           |  22 +
 drivers/phy/Makefile                          |   2 +
 drivers/phy/phy-common-props-test.c           | 380 ++++++++++++++++++
 drivers/phy/phy-common-props.c                | 216 ++++++++++
 include/dt-bindings/phy/phy.h                 |   4 +
 include/linux/pcs/pcs-mtk-lynxi.h             |   5 +-
 include/linux/phy/phy-common-props.h          |  32 ++
 18 files changed, 944 insertions(+), 146 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-test.c
 create mode 100644 drivers/phy/phy-common-props.c
 create mode 100644 include/linux/phy/phy-common-props.h

-- 
2.34.1



             reply	other threads:[~2026-01-03 21:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-03 21:03 Vladimir Oltean [this message]
2026-01-03 21:03 ` [PATCH v2 net-next 01/10] dt-bindings: phy: rename transmit-amplitude.yaml to phy-common-props.yaml Vladimir Oltean
2026-01-03 21:03 ` [PATCH v2 net-next 02/10] dt-bindings: phy-common-props: create a reusable "protocol-names" definition Vladimir Oltean
2026-01-06 18:23   ` Rob Herring (Arm)
2026-01-03 21:03 ` [PATCH v2 net-next 03/10] dt-bindings: phy-common-props: ensure protocol-names are unique Vladimir Oltean
2026-01-06 18:22   ` Rob Herring (Arm)
2026-01-03 21:03 ` [PATCH v2 net-next 04/10] dt-bindings: phy-common-props: RX and TX lane polarity inversion Vladimir Oltean
2026-01-03 21:03 ` [PATCH v2 net-next 05/10] phy: add phy_get_rx_polarity() and phy_get_tx_polarity() Vladimir Oltean
2026-01-07  8:12   ` Bjørn Mork
2026-01-10 18:04     ` Vladimir Oltean
2026-01-10 18:08       ` Bjørn Mork
2026-01-10 18:19         ` Vladimir Oltean
2026-01-03 21:03 ` [PATCH v2 net-next 06/10] dt-bindings: net: airoha,en8811h: deprecate "airoha,pnswap-rx" and "airoha,pnswap-tx" Vladimir Oltean
2026-01-03 21:04 ` [PATCH v2 net-next 07/10] net: phy: air_en8811h: " Vladimir Oltean
2026-01-06 19:03   ` Bjørn Mork
2026-01-06 22:16     ` Vladimir Oltean
2026-01-10 18:41     ` Vladimir Oltean
2026-01-03 21:04 ` [PATCH v2 net-next 08/10] dt-bindings: net: pcs: mediatek,sgmiisys: deprecate "mediatek,pnswap" Vladimir Oltean
2026-01-06 18:24   ` Rob Herring (Arm)
2026-01-03 21:04 ` [PATCH v2 net-next 09/10] net: pcs: pcs-mtk-lynxi: pass SGMIISYS OF node to PCS Vladimir Oltean
2026-01-03 21:04 ` [PATCH v2 net-next 10/10] net: pcs: pcs-mtk-lynxi: deprecate "mediatek,pnswap" Vladimir Oltean

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=20260103210403.438687-1-vladimir.oltean@nxp.com \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bjorn@mork.no \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.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=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=neil.armstrong@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=robh@kernel.org \
    --cc=vkoul@kernel.org \
    /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