From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 481E9D0E6F1 for ; Tue, 25 Nov 2025 14:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hlo1yMgjaHenlqUO9EGQko6ejHNuL0KKU1IarQIQ+vU=; b=0MryVe/9s3nnuQPGlAkfyv+FrU AHkej5GaO2w7BPZZgpvGJiOyz49Ai2ejqGNLrcq+4debZ1e6A7Qju0PmR30q5zTT+3j/CdPw6CqFv MGHz5imMeG9fqzPFLeG+7EfOgxnKBC8ap3JflAcc+78ZeGhVxAJuHxwievDducsV84zJjPbg9KLEi FH6S1Itv3NZJmssPuPVdVF1pbattXiviAYx4CKnlFnthrmMq3CFuAfZcD7d/SIBZZV6aulxBUR6mM FzUMNRUpO31IQ46khzy4FyuHtHZbX+BQJTFOdhFAq4kZgWImfQ8NP75JO7Cvqq941CbsIVu8kglic 79W3/7Ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vNuAA-0000000DRaC-2ttk; Tue, 25 Nov 2025 14:37:02 +0000 Received: from pidgin.makrotopia.org ([2a07:2ec0:3002::65]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vNuA8-0000000DRZQ-0bib; Tue, 25 Nov 2025 14:37:01 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.98.2) (envelope-from ) id 1vNu9y-000000003cW-1OUO; Tue, 25 Nov 2025 14:36:50 +0000 Date: Tue, 25 Nov 2025 14:36:42 +0000 From: Daniel Golle To: Vladimir Oltean 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 , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Matthias Brugger , AngeloGioacchino Del Regno , Eric Woudstra , Marek =?iso-8859-1?Q?Beh=FAn?= , Lee Jones , Patrice Chotard Subject: Re: [PATCH net-next 0/9] XPCS polarity inversion via generic device tree properties Message-ID: References: <20251122193341.332324-1-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251122193341.332324-1-vladimir.oltean@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251125_063700_211469_3CE8C404 X-CRM114-Status: GOOD ( 25.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 >