From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22C393CF04C; Tue, 10 Mar 2026 17:18:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163131; cv=none; b=l6if3B+F90SlD3aTqK9ksjUD64TDsuSXJ3+3SCHQhqBFWKQeLJRxCWpd6rEe736JwmvzbkrL3c/0v/CLqNcjTrjBwK6ctoACdLG6MrvpH5VV8OIV4mh+78L8n0BnSXXdlzE3MKu+NtfoF0KZPi8K7gB8ZhSv58gHtFyqpZN0Nr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163131; c=relaxed/simple; bh=qXfofFT/trjhnPdhGlUBXmgmmTY9bSQeDk+832YPFio=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=psw88ZyK46yTT/9oypZRwAprCHuokB4U6nCmo7qC87zoH8/WG0CK6/hVZUAZAZrfK+ESKFLoPVU0D3It65MLcPWUhSTVnYi6oIoHvEo9WsPmUEEjgM6TXj5az8Ugh4WwhlI2YPcviFQJZ4WEb2dvjOvuIJECJb/aK0tUQ0D1bv4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PX8Qge1b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PX8Qge1b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 701EAC19425; Tue, 10 Mar 2026 17:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163130; bh=qXfofFT/trjhnPdhGlUBXmgmmTY9bSQeDk+832YPFio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PX8Qge1beJjFZZhJXX9r/RSuw2aszipZq/ZWwNu6D+XAYhHg3p1nWsHvYLky84HXH yLx3kbsPRmdARnQqTfjnxuvHeoyd+kdL/ny2humwv1mpOjcIo2gxs1YKaBav0Vv757 Jsnvxrp9tvuF325WgLj6fa+r07/b1nVMZ4gvhYp6bds93Gfa46JuYv0SBwDHukiW8s CN2VFVjNy6zz+6qLUI/+bNrDt0Opu8cuIf8qmtfm29GFw9UMd61XKgJlA7YvjdMycX INboE/33ZuXKN+7TO8fFLCdPaE9wJw+8FVce802X2sBrZgnjZIIVANwnzm2qnF+9GF Ictm9HdGF6HjQ== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 01/10] net: macb: rename macb_default_usrio to at91_default_usrio as not all platforms have mii mode control in usrio Date: Tue, 10 Mar 2026 17:17:08 +0000 Message-ID: <20260310-upwind-reborn-ff32b74ff6c3@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=10810; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=EKLjoCWb4dd6fnjRibapsUL7p5viCWSXvbtWmX4ncIU=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgnRMjxVk3wlsjfp89Yf2hlkS8nf2yi4OP7S+gFXlu dXP3o6UjlIWBjEuBlkxRZbE230tUuv/uOxw7nkLM4eVCWQIAxenAExkej3DX7EX3y6t2SeZd7qb Y4VMZvrRm49znS+zr5mxJ/En0K7fMgz/FD60Cdi9C9q1e/vUpYGKvNy7ZExMq4yWLAt/LrUoJuo RDwA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley Calling this structure macb_default_usrio is misleading, I believe, as it implies that it should be used if your platform has nothing special to do in usrio. Since usrio is platform dependent, the default here is probably for each usrio to do nothing, with the macb documentation I have access to prescribing no standard behaviour here. We noticed that this was problematic because on mpfs, a bit that macb_default_usrio sets to deal with the MII mode actually changes the source for the tsu_clk to something with how the majority of mpfs devices are actually configured! Rename it to at91_default_usrio, since that's where the values actually come from for these. I have no idea if any of the other platforms that use the default actually copied at91's usrio configuration or if they have usrio configurations where what the driver does has no impact. Gate touching these bits behind a capability, like the clken refclock usrio knob, so that platforms without the MII mode stuff can avoid running this code. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb.h | 1 + drivers/net/ethernet/cadence/macb_main.c | 108 +++++++++++++---------- 2 files changed, 63 insertions(+), 46 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 87414a2ddf6e3..8cb0b3778ee9e 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -779,6 +779,7 @@ #define MACB_CAPS_DMA_PTP BIT(22) #define MACB_CAPS_RSC BIT(23) #define MACB_CAPS_NO_LSO BIT(24) +#define MACB_CAPS_USRIO_HAS_MII BIT(25) =20 /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 5bc35f651ebd2..778d2115f66fc 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4613,13 +4613,15 @@ static int macb_init(struct platform_device *pdev) =20 if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) { val =3D 0; - if (phy_interface_mode_is_rgmii(bp->phy_interface)) - val =3D bp->usrio->rgmii; - else if (bp->phy_interface =3D=3D PHY_INTERFACE_MODE_RMII && - (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) - val =3D bp->usrio->rmii; - else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) - val =3D bp->usrio->mii; + if (bp->caps & MACB_CAPS_USRIO_HAS_MII) { + if (phy_interface_mode_is_rgmii(bp->phy_interface)) + val =3D bp->usrio->rgmii; + else if (bp->phy_interface =3D=3D PHY_INTERFACE_MODE_RMII && + (bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) + val =3D bp->usrio->rmii; + else if (!(bp->caps & MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII)) + val =3D bp->usrio->mii; + } =20 if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN) val |=3D bp->usrio->refclk; @@ -4637,13 +4639,6 @@ static int macb_init(struct platform_device *pdev) return 0; } =20 -static const struct macb_usrio_config macb_default_usrio =3D { - .mii =3D MACB_BIT(MII), - .rmii =3D MACB_BIT(RMII), - .rgmii =3D GEM_BIT(RGMII), - .refclk =3D MACB_BIT(CLKEN), -}; - #if defined(CONFIG_OF) /* 1518 rounded up */ #define AT91ETHER_MAX_RBUFF_SZ 0x600 @@ -5218,6 +5213,13 @@ static int eyeq5_init(struct platform_device *pdev) return ret; } =20 +static const struct macb_usrio_config at91_default_usrio =3D { + .mii =3D MACB_BIT(MII), + .rmii =3D MACB_BIT(RMII), + .rgmii =3D GEM_BIT(RGMII), + .refclk =3D MACB_BIT(CLKEN), +}; + static const struct macb_usrio_config sama7g5_usrio =3D { .mii =3D 0, .rmii =3D 1, @@ -5228,104 +5230,114 @@ static const struct macb_usrio_config sama7g5_usr= io =3D { =20 static const struct macb_config fu540_c000_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | - MACB_CAPS_GEM_HAS_PTP, + MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D fu540_c000_clk_init, .init =3D fu540_c000_init, .jumbo_max_len =3D 10240, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config at91sam9260_config =3D { - .caps =3D MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, + .caps =3D MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII= | + MACB_CAPS_USRIO_HAS_MII, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config sama5d3macb_config =3D { .caps =3D MACB_CAPS_SG_DISABLED | - MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, + MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | + MACB_CAPS_USRIO_HAS_MII, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config pc302gem_config =3D { - .caps =3D MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, + .caps =3D MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config sama5d2_config =3D { - .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO, + .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, .jumbo_max_len =3D 10240, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config sama5d29_config =3D { - .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP, + .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config sama5d3_config =3D { .caps =3D MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE | - MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO, + MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, .jumbo_max_len =3D 10240, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config sama5d4_config =3D { - .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, + .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 4, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config emac_config =3D { - .caps =3D MACB_CAPS_NEEDS_RSTONUBR | MACB_CAPS_MACB_IS_EMAC, + .caps =3D MACB_CAPS_NEEDS_RSTONUBR | MACB_CAPS_MACB_IS_EMAC | + MACB_CAPS_USRIO_HAS_MII, .clk_init =3D at91ether_clk_init, .init =3D at91ether_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config np4_config =3D { .caps =3D MACB_CAPS_USRIO_DISABLED, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config zynqmp_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | - MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH, + MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D init_reset_optional, .jumbo_max_len =3D 10240, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config zynq_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF | - MACB_CAPS_NEEDS_RSTONUBR, + MACB_CAPS_NEEDS_RSTONUBR | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config mpfs_config =3D { @@ -5335,7 +5347,7 @@ static const struct macb_config mpfs_config =3D { .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D init_reset_optional, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, .max_tx_length =3D 4040, /* Cadence Erratum 1686 */ .jumbo_max_len =3D 4040, }; @@ -5343,7 +5355,8 @@ static const struct macb_config mpfs_config =3D { static const struct macb_config sama7g5_gem_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | - MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP, + MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, @@ -5353,7 +5366,8 @@ static const struct macb_config sama7g5_gem_config = =3D { static const struct macb_config sama7g5_emac_config =3D { .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII | - MACB_CAPS_GEM_HAS_PTP, + MACB_CAPS_GEM_HAS_PTP | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, @@ -5364,12 +5378,13 @@ static const struct macb_config versal_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH | MACB_CAPS_NEED_TSUCLK | MACB_CAPS_QUEUE_DISABLE | - MACB_CAPS_QBV, + MACB_CAPS_QBV | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D init_reset_optional, .jumbo_max_len =3D 10240, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config eyeq5_config =3D { @@ -5380,17 +5395,18 @@ static const struct macb_config eyeq5_config =3D { .clk_init =3D macb_clk_init, .init =3D eyeq5_init, .jumbo_max_len =3D 10240, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config raspberrypi_rp1_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | MACB_CAPS_JUMBO | - MACB_CAPS_GEM_HAS_PTP, + MACB_CAPS_GEM_HAS_PTP | + MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D &at91_default_usrio, .jumbo_max_len =3D 10240, }; =20 @@ -5431,7 +5447,7 @@ static const struct macb_config default_gem_config = =3D { .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &macb_default_usrio, + .usrio =3D NULL, .jumbo_max_len =3D 10240, }; =20 --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6E6E2D877A; Tue, 10 Mar 2026 17:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163136; cv=none; b=GCsYr78hK2MKBuTspfNr8E4z9gxm7tpHhPASqGjTiyv0kZJDvmpSdsgDNQjlz25kWNJdiowuTRQGaZs62XYPVbpss5HS6X5z0+dQXuE7B5Mq4N9bc0xA23A1lloiBSCBWkr8NOu1QmtmBYBK6pJBO/7dZlKbgniQsQ91lDKe+Xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163136; c=relaxed/simple; bh=5Jkuep/vLlDigVeWmTs/DhOngIlPtkb5pESGRVTgEIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kqh4MB61xibk9S723GM5/mzd4753gICu6xI/JYPM7dehfDo/AgaXMbfQeTwqRd7E9BUxovqzCgiHMWohb1oTnxrAbDshNhNLMyRzW/fTT5/mgslkwsQN/C2vg1327CyZdvbUlLlo8bsIftsX4EpETJQqV2XpTxu+P+z1n5n4kuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pPnAXDVd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pPnAXDVd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28D13C19423; Tue, 10 Mar 2026 17:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163136; bh=5Jkuep/vLlDigVeWmTs/DhOngIlPtkb5pESGRVTgEIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pPnAXDVdJoTPpBTkapU2A3TIBE2FUFpy0bw/IRWPFMvV9/XT+e6GPf/agr63hluW5 11Bcyy2WRQZOBhLFOFL6ZbUdXTZDtlh9BlKMVv70nFXhasoSvmfruYKvA1aC5fvXcy EWJPVxMBgle+4eN7RvgLGLuW7y5juM/of87hIYRjlvXnzaT0spIyQSySTaByU6co/7 Cdgx1Q8fHUpPzYc1QOCkfx6/ksIuucwkjGYICvFHYQlbQDbi0kTesjuzbVL/npJd8O NpNrF4qo9GJmSTVPrWcDj/VkZlC2AvA+ax/9G82JOEAdBa4fw3G+If9MbYzYCs+aFf fmn6nWZdUa3yA== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 02/10] net: macb: split USRIO_HAS_CLKEN capability in two Date: Tue, 10 Mar 2026 17:17:09 +0000 Message-ID: <20260310-pushiness-twentieth-8b6ba59bf8c9@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3502; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=TDcEt4gO7nw+FrU/aV4qA0N2hA+cJ3rWCHECrYVPXVw=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgnT3mFyeb1rdtnTi+8fcsepllveShO3a/z9nWrfkQ dD8mos2HaUsDGJcDLJiiiyJt/tapNb/cdnh3PMWZg4rE8gQBi5OAZgIUxcjQ7duoMZzgRm3Hxmn 9G+SFJrZxqx9Xl1y0qq9qq9yqo+Jf2b4nyoSPO++YjHrWq6u49pBveYmS2SelG9cbnjq8Hn+GJ0 1fAA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley While trying to rework the internal/external refclk selection on sama7g5, Ryan and I noticed that the sama7g5 was "overloading" the meaning of MACB_CAPS_USRIO_HAS_CLKEN, using it differently to how it was originally intended. Originally, on the macb hardware on sam9620 et al, MACB_CAPS_USRIO_HAS_CLKEN represented the hardware having a bit that needed to be set to turn on the input clock to the transceivers. The sama7g5 doesn't have this bit, so for some reason the decision was made to reuse this capability flag to control selection of internal/external references. Split the caps in two, so that capabilities do what they say on the tin, and allow reworking the refclk selection handling without impacting the older devices that use MACB_CAPS_USRIO_CLKEN for its original purpose. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb.h | 2 ++ drivers/net/ethernet/cadence/macb_main.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 8cb0b3778ee9e..baf48f02d7e27 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -780,6 +780,7 @@ #define MACB_CAPS_RSC BIT(23) #define MACB_CAPS_NO_LSO BIT(24) #define MACB_CAPS_USRIO_HAS_MII BIT(25) +#define MACB_CAPS_USRIO_HAS_REFCLK_SOURCE BIT(26) =20 /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 @@ -1211,6 +1212,7 @@ struct macb_usrio_config { u32 rmii; u32 rgmii; u32 refclk; + u32 clken; u32 hdfctlen; }; =20 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 778d2115f66fc..d908850c59498 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4357,7 +4357,7 @@ static void macb_configure_caps(struct macb *bp, } =20 if (refclk_ext) - bp->caps |=3D MACB_CAPS_USRIO_HAS_CLKEN; + bp->caps |=3D MACB_CAPS_USRIO_HAS_REFCLK_SOURCE; =20 dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps); } @@ -4624,6 +4624,9 @@ static int macb_init(struct platform_device *pdev) } =20 if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN) + val |=3D bp->usrio->clken; + + if (bp->caps & MACB_CAPS_USRIO_HAS_REFCLK_SOURCE) val |=3D bp->usrio->refclk; =20 macb_or_gem_writel(bp, USRIO, val); @@ -5217,7 +5220,7 @@ static const struct macb_usrio_config at91_default_us= rio =3D { .mii =3D MACB_BIT(MII), .rmii =3D MACB_BIT(RMII), .rgmii =3D GEM_BIT(RGMII), - .refclk =3D MACB_BIT(CLKEN), + .clken =3D MACB_BIT(CLKEN), }; =20 static const struct macb_usrio_config sama7g5_usrio =3D { @@ -5355,6 +5358,7 @@ static const struct macb_config mpfs_config =3D { static const struct macb_config sama7g5_gem_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | + MACB_CAPS_USRIO_HAS_REFCLK_SOURCE | MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, @@ -5365,7 +5369,8 @@ static const struct macb_config sama7g5_gem_config = =3D { =20 static const struct macb_config sama7g5_emac_config =3D { .caps =3D MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | - MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII | + MACB_CAPS_MIIONRGMII | + MACB_CAPS_USRIO_HAS_REFCLK_SOURCE | MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_USRIO_HAS_MII, .dma_burst_length =3D 16, --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E1743C9ED0; Tue, 10 Mar 2026 17:19:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163142; cv=none; b=PjpKhuoDrP/HeHFnTC06NB760QBxamAI2eSoMYVE6vjq//WCR+D7t+PBbaksLRBFL1PWvb9HPv0mwJNBAC79r1F5We8cQpRBV7GERj0EzGKZImXYf52Xs5bYEvOvAPlKSoyBXADUpsjBa/7w7Zk0MmSTYvmh7RJMadlbJ+ZSx3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163142; c=relaxed/simple; bh=YUjxJF2Qr9YfAZ+BooBI432WLTxTi2gxDGv7r0zGnd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bknCagSJ2Fotw9NA67NsK9iYVVhQe0kIUz9is5LkT4ccIXbqOmtyrhy4z8hnVCWiYtLqGTatANJHGycH8J6vSxF9IZVgvqg0etp9TZbp2om8JBropGDFInfhZ8o7cFaX6fePEcP4vgycTIKDEe+mAM1VJHPrwL1WK52E8hwxZhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nMixdcVO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nMixdcVO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5EABC2BC87; Tue, 10 Mar 2026 17:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163142; bh=YUjxJF2Qr9YfAZ+BooBI432WLTxTi2gxDGv7r0zGnd4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nMixdcVOistAJIq0ewUNe/ndKJ1oHMibR0pp3XXNQDTt1fxyohpnf5g4uhm8EfY97 QCg00srsD8QpOqRzRmoXz8aS6KInGP+9ehToJM8MhcSSV/qrOq89GU1M+17vvLF3ua 5ElntDk1/MadosHcumGKS200q3w5yVaBYTD9WozG/Wqd87KZn1JE07OM2TKeneTzsc tpF+Urb8fWvpNk5DyRAUas1xYXj4W5n81aUDTR6aei9heA07Mp0ItB4wa6XnDOc7+B gp872qEWIQOH/PDyiZzjQYi1zzlrTTfzmfQCTzzJ7IlM1t88CEm7gzTLh565gExOGq HE6JFgKfUgWhA== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 03/10] dt-bindings: net: cdns,macb: replace cdns,refclk-ext with cdns,refclk-source Date: Tue, 10 Mar 2026 17:17:10 +0000 Message-ID: <20260310-sneak-handclap-c150d8f1236b@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2441; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=1c/eg0vschSSxuR+95KDlkVYxNRVuIpwZ6UtMicQR0k=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgnTn+lTXsKy4fSz0TqzRjT/Jrdpf3j2enNJxInRbc 6XV0i9PO0pZGMS4GGTFFFkSb/e1SK3/47LDuectzBxWJpAhDFycAjCRQFlGht/C0kdSP2osvqmn oHKSs3Z35503ojqhq5x6z1jatpX++cTIcMea5fZi5wvTTKsP+xnYfUvK2DJtYiNzU5/Haz8zgQn r+AA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley Ryan added cdns,refclk-ext with the intent of decoupling the source of the reference clock on sama7g5 (and related platforms) from the compatible. Unfortunately, the default for sama7g5-emac is an external reference clock, so this property had no effect there, so that compatibility with older devicetrees is preserved. Replace cdns,refclk-ext with one that supports both default states and therefore is usable for sama7g5-emac. For now, limit it to only the platforms that have USRIO controlled reference clock selection, but this could be generalised in the future. Signed-off-by: Conor Dooley --- .../devicetree/bindings/net/cdns,macb.yaml | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documen= tation/devicetree/bindings/net/cdns,macb.yaml index cb14c35ba9969..a492357570edd 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -120,12 +120,14 @@ properties: power-domains: maxItems: 1 =20 - cdns,refclk-ext: - type: boolean + cdns,refclk-source: + $ref: /schemas/types.yaml#/definitions/string + enum: + - internal + - external description: - This selects if the REFCLK for RMII is provided by an external sourc= e. - For RGMII mode this selects if the 125MHz REF clock is provided by a= n external - source. + Select whether or not the refclk for RGMII or RMII is provided by an + internal or external source. The default is device specific. =20 cdns,rx-watermark: $ref: /schemas/types.yaml#/definitions/uint32 @@ -196,6 +198,33 @@ allOf: required: - phys =20 + - if: + not: + properties: + compatible: + contains: + enum: + - microchip,sama7g5-gem + - microchip,sama7g5-emac + then: + properties: + cdns,refclk-source: false + + - if: + properties: + compatible: + contains: + enum: + - microchip,sama7g5-emac + then: + properties: + cdns,refclk-source: + default: external + else: + properties: + cdns,refclk-source: + default: internal + unevaluatedProperties: false =20 examples: --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFB793D092C; Tue, 10 Mar 2026 17:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163148; cv=none; b=PaL2R4VIla351nW3vcBSyjJta9sMW9LmglWG5LS9q/r1CNAhLfZJE5hQQWTCkwwVFjJq1qrXtcG94k5tod20axlTO40nOKAFBJqnZ9ae4EdsHJKC04VhfKGv3aOudtoxWGLZsNrHsZohx4Or2c23i0k0TWF80xrEQVkZMjVfXp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163148; c=relaxed/simple; bh=d+MyLOiuyfRC+NF64EIUpcY9qyHiXTVHxjTblw4Yz08=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WGsm7stbUG58gwT0AoeEBeME9OJi/7SmgOsnmLnX3XPwub6qVHsDuSXFspdoBweFWDcDn6hWy/nWTtFIAQXbiys0RtO2Ck/wK3tQy0cJ98YbCqTDNhjtanSBJHpG1fpBFBZl0Nli6ljptxl5a4Uvuifquql6XpNN8s90ih5NemA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SCNeWMn1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SCNeWMn1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DF10C19423; Tue, 10 Mar 2026 17:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163147; bh=d+MyLOiuyfRC+NF64EIUpcY9qyHiXTVHxjTblw4Yz08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SCNeWMn1m35PFvOXY1i1G++rR2Au25weAg7P477mhiUILy/1IvFe4m4e1RIMzCXG3 pQFqWTH3S2EjnABKGPiJwVzMoBlV8y8Keq2IxcmaVVEFszRAPESVc+4CoSkOpaz1V2 GUaUi1xuKbpKRuDmCil2CiNPrEOBiBVjrNPvjztoyMJMd4GvW4W7g6pPWGsw1Q96xl RaPEiGjpB26qhFq8jPKKnkTDq3iqrmeL074laGAsU6+HHHKp0tTp4Z/Z2wFLwvaPXc dJRKl/3nwTVBfk728zRIA6MabbxzRsy2DpIiUumX7G6X+K3uhhhCjWsSCl56Wa5QT6 oJgXFfwzEgW5Q== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 04/10] net: macb: rework usrio refclk selection code Date: Tue, 10 Mar 2026 17:17:11 +0000 Message-ID: <20260310-flinch-placidly-599515687107@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5400; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=2bAmm8yzB8brPeFan+juq3/KVYptD7voFpcvqp+7QWc=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgnSbY+44O3/5smZRfL3atpMfvko/TdibPM+V//xqP TF+EfctHaUsDGJcDLJiiiyJt/tapNb/cdnh3PMWZg4rE8gQBi5OAZhIYA8jQ+OF3MI/qvseT5p3 9NgtVY/o7AvdW47/CTs43dC1aHJzVTvDX5lMt39Lt3na7GRty2P6WXk3do3C78pQvo+/xRQv/G/ 25AAA X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley The USRIO based refclk selection code abuses a capability flag to set the refclk to an external source based on match data/compatible on sama7g5-emac and use an internal source for the gmac. Ryan previously added a property in an attempt to decouple the refclk source from the compatible, because this is not fixed by compatible and there's variance based on the choices made by board designers. Originally when Ryan added it, he removed the capability flag entirely from match data, but this changed the default for the sama7g5-emac and the removal had to be reverted for these devices. Because these devices default to an external refclk, and the current property is only capable of communicating external refclks, there's no way to make the sama7g5-emac use an internal refclk. Additionally, this property has no limiting based on compatible, and if used on a platform with an external refclk that is not controlled by USRIO the capability would be erroneously set. Because of the reuse of the at91_default_usrio struct by non-at91 devices, this could cause the refclk bit to be set in error, on a system where the refclk is externally provided without usrio settings being required. Change the new capability flag so that it actually represents the hardware being capable of controlling the refclk source via USRIO, and move the selection of default behaviour into the macb_usrio_config struct provided as part of match data. Modify the devicetree code to support a new property, "cdns,refclk-source" which will support devices with either default, retaining support for "cdns,refclk-external" for compatibility reasons. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb.h | 1 + drivers/net/ethernet/cadence/macb_main.c | 55 ++++++++++++++++++------ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index baf48f02d7e27..9cd565cb87e4c 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1214,6 +1214,7 @@ struct macb_usrio_config { u32 refclk; u32 clken; u32 hdfctlen; + bool refclk_default_external; }; =20 struct macb_config { diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index d908850c59498..1f9e46cf7e1cb 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4318,12 +4318,8 @@ static const struct net_device_ops macb_netdev_ops = =3D { static void macb_configure_caps(struct macb *bp, const struct macb_config *dt_conf) { - struct device_node *np =3D bp->pdev->dev.of_node; - bool refclk_ext; u32 dcfg; =20 - refclk_ext =3D of_property_read_bool(np, "cdns,refclk-ext"); - if (dt_conf) bp->caps =3D dt_conf->caps; =20 @@ -4356,9 +4352,6 @@ static void macb_configure_caps(struct macb *bp, } } =20 - if (refclk_ext) - bp->caps |=3D MACB_CAPS_USRIO_HAS_REFCLK_SOURCE; - dev_dbg(&bp->pdev->dev, "Cadence caps 0x%08x\n", bp->caps); } =20 @@ -4626,8 +4619,36 @@ static int macb_init(struct platform_device *pdev) if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN) val |=3D bp->usrio->clken; =20 - if (bp->caps & MACB_CAPS_USRIO_HAS_REFCLK_SOURCE) - val |=3D bp->usrio->refclk; + if (bp->caps & MACB_CAPS_USRIO_HAS_REFCLK_SOURCE) { + const char *prop; + bool refclk_ext; + int ret; + + /* Default to whatever was set in the match data for + * this device. There's two properties for refclk + * control, but the boolean one is deprecated so is + * a lower priority to check, no device should have + * both. + */ + refclk_ext =3D bp->usrio->refclk_default_external; + + ret =3D of_property_read_string(pdev->dev.of_node, + "cdns,refclk-source", &prop); + if (!ret) { + if (!strcmp(prop, "external")) + refclk_ext =3D true; + else + refclk_ext =3D false; + } else { + ret =3D of_property_read_bool(pdev->dev.of_node, + "cdns,refclk-ext"); + if (ret) + refclk_ext =3D true; + } + + if (refclk_ext) + val |=3D bp->usrio->refclk; + } =20 macb_or_gem_writel(bp, USRIO, val); } @@ -5223,11 +5244,21 @@ static const struct macb_usrio_config at91_default_= usrio =3D { .clken =3D MACB_BIT(CLKEN), }; =20 -static const struct macb_usrio_config sama7g5_usrio =3D { +static const struct macb_usrio_config sama7g5_gem_usrio =3D { .mii =3D 0, .rmii =3D 1, .rgmii =3D 2, .refclk =3D BIT(2), + .refclk_default_external =3D false, + .hdfctlen =3D BIT(6), +}; + +static const struct macb_usrio_config sama7g5_emac_usrio =3D { + .mii =3D 0, + .rmii =3D 1, + .rgmii =3D 2, + .refclk =3D BIT(2), + .refclk_default_external =3D true, .hdfctlen =3D BIT(6), }; =20 @@ -5364,7 +5395,7 @@ static const struct macb_config sama7g5_gem_config = =3D { .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &sama7g5_usrio, + .usrio =3D &sama7g5_gem_usrio, }; =20 static const struct macb_config sama7g5_emac_config =3D { @@ -5376,7 +5407,7 @@ static const struct macb_config sama7g5_emac_config = =3D { .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &sama7g5_usrio, + .usrio =3D &sama7g5_emac_usrio, }; =20 static const struct macb_config versal_config =3D { --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4212314D08; Tue, 10 Mar 2026 17:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163153; cv=none; b=ourzFSpVk+wez0eaa1GfsILlmc6500x2pLzoYqTV0NLleWR6gagTMNVxWw1jwxiVxcmO1LOsHVi5ICQzLiuRgDSgiArcDnZXtCAZGqP78GHUzL+Xd+k4/0Dw6yQjWl/ftI52J+NF4PRcrMx52fOUKs1nT09IqwU7exOhAnjRNmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163153; c=relaxed/simple; bh=hLF9AXo3lnRxCyN0gi/H0Xuz7Ot4l/b2adjyOOaaEI4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lo4KgMDjbqQo+AIQtDwhVfQ5ZzeQErMwPoBQkQA3bhbAz9gWT4i0tytwOA0G3uXrC1dyDbkbfylkhkADV07YpKdICs/MDOj9egr7//gJkzJp7R9PXFsQKaw425CXkCBUHopxLFI8Rvej1sgvHylFbhI8QhXl74F5zfKEG4JqMCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bwf9qDw/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bwf9qDw/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45606C2BCB3; Tue, 10 Mar 2026 17:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163153; bh=hLF9AXo3lnRxCyN0gi/H0Xuz7Ot4l/b2adjyOOaaEI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bwf9qDw/MyxKklGxC1YMHWeNHNONf3PTOcwDD4Egre0SngpWtcsBvesiwLKTh50Mx twUPpUQyBtpbZ9HFZd2z1eKEIzF2czgc+UvQqRIuCs53UI7vjAFJhfep22/GZC+c2D DWhGCXdky/T/eSKNQGz/cuC053Mgz7Uf7b1K3Zh1eyPd4tSXCKVZiR8OaA7aOXRtn9 mc/hhN9BKI/c0ii/rKR6VidQ5QHZu2fpqyvMsM8vbZTGqsbdAuk/1OGcisp4Ua08LS E53Qb8ui27LsD9n+MWnaC9ihLePi9a54xC2vEMsU+yUxyt21j0vau9OY4HAZWJ5/0j z7vizcfy6LPlQ== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 05/10] net: macb: np4 doesn't need a usrio pointer Date: Tue, 10 Mar 2026 17:17:12 +0000 Message-ID: <20260310-stubbed-passenger-30e7c6736c8f@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=785; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=F9UBzeUId/kao0gPpAeZyIh8nfmZqgwg0AfcGoyheCk=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgnRnL/waZl51aLHuooOxwpu1ZV4f5ND/qXL4K/s11 ynlgs4HO0pZGMS4GGTFFFkSb/e1SK3/47LDuectzBxWJpAhDFycAjARpVBGhn3be72Xx19sM54R xsaVtjxmCluD96SI/ZkeecynY3bM+sHIcC2hKF/LUIFvZvyiR2pvzXz/i4XrpPvEdjAcqd7g+fE MIwA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley USRIO is disabled on this platform, having a pointer to a usrio config structure doesn't actually do anything other than look weird. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 1f9e46cf7e1cb..414a8fa3f99d9 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5349,7 +5349,6 @@ static const struct macb_config np4_config =3D { .caps =3D MACB_CAPS_USRIO_DISABLED, .clk_init =3D macb_clk_init, .init =3D macb_init, - .usrio =3D &at91_default_usrio, }; =20 static const struct macb_config zynqmp_config =3D { --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3AC33D16E4; Tue, 10 Mar 2026 17:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163159; cv=none; b=fItoApdTuEabraOB20P+eZyNrlk3hHVDFrhqxPr5/+Cn4rZzRds6CazqV8TN4RUHBooCq7CIiIw7a31uJcHOPTD29+4Vscp0t1i2Z3URn4zW1t0QxkoSaw7QPVEs5UWKNsaT2J6+7HV91iDEUJwPWA0cUJjo9IonmU/empLKEmI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163159; c=relaxed/simple; bh=ljysWJaHe8TEOROZCjjrq6HOXubs9dLzcABTz31qQqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XHhIHCVhxuazdncwfD8oZxVfcJQMJ/3U6gg1ovFXqEqVcZwjO2+iWuT2AzDi4LY7dbsXanueh0+4luE1nEtbbfM1bihIJp0zhTDfs3+jYsA5MH03aUCwva5nIjtMjbC//iDKdyeaAUGqZVVJpiG3y3v/ReYXxNtCZUvIp+4kXfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sFJsCBlf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sFJsCBlf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01E71C2BCAF; Tue, 10 Mar 2026 17:19:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163159; bh=ljysWJaHe8TEOROZCjjrq6HOXubs9dLzcABTz31qQqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sFJsCBlfOp/+RVCBRcXXRDAX0DDEVTZ54xZU3HKWcvbEWBHtH8oQod1FI6ylRq+5L tbLNkweb2IOj0ypPoDiJP79RgVEvGqdMq6a6udNg3SHcE632oaAtQr5pkkIZwmYnZh kcr0aXdW75xqNnJtj6TTz0spk7EBHBDiHJ55nW3n7zQ1EgipthDYJZyncVQSben4xb k9GAftYqmcWWC9DLNt9IeuCugHkGWTSQ1r/6ZsGtzc+O2QVsahG5W7chZQ/sp2Y/4R BhQEe9Eyq4r8A8FcxAHY+nruyrhEeZhpL4boNhVnwY3xOoMgrfwMmTscEbQuDBUkZo YmpiMFlaVtujw== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 06/10] net: macb: add mpfs specific usrio configuration Date: Tue, 10 Mar 2026 17:17:13 +0000 Message-ID: <20260310-diaphragm-bagginess-7879e62495e5@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2759; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=RSFyKfnVzDv/pOh5f8+B27Gurr5waqnAxeJRhx9T438=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgvR+unE+4/fsbd68etee3lcnOVe8vnFV4yyPyRo5E cu+8NofHaUsDGJcDLJiiiyJt/tapNb/cdnh3PMWZg4rE8gQBi5OAZjIigkM/wOzHse2i+d5Zto9 jFFZEVbsOkW1jPWGw6TTjyapKkzaasDI0JRS/CoxNLfjxZ6uTTbP16Rvdd/M6GwqWeVb/9nsacR LJgA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley On mpfs the driver needs to make sure the tsu clock source is not the fabric, as this requires that the hardware is in Timer Adjust mode, which is not compatible with the linux driver trying to control the hardware. It is unlikely that this will be set, as the peripheral is reset during probe, but if the resets are not provided in devicetree it's probable that this bit is set incorrectly, as U-Boot's macb driver has the same issue with using usrio settings for at91 platforms as the default. Fixes: 8aad66aa59be5 ("net: macb: add polarfire soc reset support") Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb.h | 2 ++ drivers/net/ethernet/cadence/macb_main.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 9cd565cb87e4c..cdb9fb2218c6f 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -781,6 +781,7 @@ #define MACB_CAPS_NO_LSO BIT(24) #define MACB_CAPS_USRIO_HAS_MII BIT(25) #define MACB_CAPS_USRIO_HAS_REFCLK_SOURCE BIT(26) +#define MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE BIT(27) =20 /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 @@ -1214,6 +1215,7 @@ struct macb_usrio_config { u32 refclk; u32 clken; u32 hdfctlen; + u32 tsu_source; bool refclk_default_external; }; =20 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 414a8fa3f99d9..b476bc9663ecd 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4650,6 +4650,9 @@ static int macb_init(struct platform_device *pdev) val |=3D bp->usrio->refclk; } =20 + if (bp->caps & MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE) + val |=3D bp->usrio->tsu_source; + macb_or_gem_writel(bp, USRIO, val); } =20 @@ -5244,6 +5247,10 @@ static const struct macb_usrio_config at91_default_u= srio =3D { .clken =3D MACB_BIT(CLKEN), }; =20 +static const struct macb_usrio_config mpfs_usrio =3D { + .tsu_source =3D 0, +}; + static const struct macb_usrio_config sama7g5_gem_usrio =3D { .mii =3D 0, .rmii =3D 1, @@ -5376,11 +5383,12 @@ static const struct macb_config zynq_config =3D { static const struct macb_config mpfs_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | - MACB_CAPS_GEM_HAS_PTP, + MACB_CAPS_GEM_HAS_PTP | + MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE, .dma_burst_length =3D 16, .clk_init =3D macb_clk_init, .init =3D init_reset_optional, - .usrio =3D &at91_default_usrio, + .usrio =3D &mpfs_usrio, .max_tx_length =3D 4040, /* Cadence Erratum 1686 */ .jumbo_max_len =3D 4040, }; --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 558733D16E4; Tue, 10 Mar 2026 17:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163165; cv=none; b=fkHeum7LcTJCRK/BWgxpXmhtYQipQu+Uws8Gx0qa0WTj67yK2aqubEdbpX7iszZp1qreYcFvd4Z/Z/ntnKuVJPYtIt0RTod7AZpIBujdxl/Ai2WDoVube+zCgab/nTrBBdmJwTwjPGIKJeVh2ZftqPN0+yg/a23is2Cw5SVJREA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163165; c=relaxed/simple; bh=XKo6oEcfxrAO5a6uL1jOlJ673A3wAiggYrYhD1OOv/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RWt+b4eKQwJVaYaDHnus1XCF+cBoiWgu5sdSSPCgPF4KLpK4YZILjZFITZ7319L7GdcSthHwUgd4JSmAtPAJ6Zhv4gJBMVaaejU9ao845nZePXwm3KpRgxM7XeG+GKkvtx7n5rlzapV7J5ENOQKA5ROuVNt94UuAEEVC6j92pYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sNQGP8aw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sNQGP8aw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACBCAC19425; Tue, 10 Mar 2026 17:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163165; bh=XKo6oEcfxrAO5a6uL1jOlJ673A3wAiggYrYhD1OOv/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sNQGP8awIFmI2BSob6KCi/mtqeHWypqZQig0okBXP8w8ZiDMRwXbUXpJXJpYRh/+5 NMhyb4ut+zCHRctYZMaZqnmwsTFJjSSh6VX0Z9JLnXf9ZFJF9Jit7W89qmyBCy6h2F OlT0BcBKhQZnCAlYTHkzW+iLoMGy/EaRZBy+krRUCxSkC6539O1//86z8DX1BC4kSx QNpa6vkoK3XlY5fCiiCGZ4ClUl15Y94LYMExbZIVNoYMcr6IJFSvXaYlXDqKfFTx47 Zvq871TL0AxKknXARgdeQAuy1/BnZQoMOpE1V7IAblLB7DV2KIbk7HJ5MC/vi5VOzj OM/fo7QTgYMKw== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 07/10] net: macb: warn on pclk use as a tsu_clk fallback Date: Tue, 10 Mar 2026 17:17:14 +0000 Message-ID: <20260310-unsubtle-velvet-4bb458cc06ba@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3276; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=NwKelKp1tigxckCA+KrqnMxOmrCbE/r2GTIcp/cWLQA=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgvS2BG/8Wp10pvJn4NknK19+fvX1b+aea4FLi7305 qx3WK34vKOUhUGMi0FWTJEl8XZfi9T6Py47nHvewsxhZQIZwsDFKQATebCNkWH3niuXnzXe67Q3 e1adLzT7lGTwHamyCV8LH8zYNIGRVaiE4X+sy+zda+L7unUWqK+KrZeW3WFg6CbPLPGq5dfhv1I 7PdgA X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley The Candence GEM IP has a configuration parameter which determines the source of the clock used for the timestamp unit (if it is enabled), switching it between using the pclk and a dedicated input. When ptp support was added to the macb driver, a new tsu_clk was added to represent the dedicated input. While this is understandable, I think it is bug prone and that the tsu_clk should represent whatever clock is used for the timestamper and not just that specific input. >From a driver point of view, the benefit of taking the conceptual approach is avoiding misconfiguring the driver when the hardware supports ptp (and it is set as a capability in the relevant per-device structure) but no tsu_clk is provided in devicetree. At the moment, the timestamper will be registered and programmed with an increment that reflects the pclk in these cases, but will malfunction if the pclk and tsu_clk frequencies do not match. Obviously, this means the devicetree incorrectly represents the hardware, but this change in approach would make the driver more resilient without meaningfully impacting correctly described users. Out of the devices that claim MACB_CAPS_GEM_HAS_PTP the fu540, mpfs, sama5d2 and sama7g5-emac (but not sama7g5-gem) are at risk of having this problem with the in-kernel devicetrees. mpfs and sama7g5-emac have been confirmed to be incorrect, and sama5d2 is correct. It may be that the other platforms actually do use the pclk for the timestamper (either by supplying pclk to the tsu_clk input of the IP, or by having the IP block configured to use pclk instead of the tsu_clk input), but at least two are wrong, as they do not use pclk for the tsu_clk, so the driver is registering the ptp clock incorrectly. Add a warning if no tsu_clk is provided on a platform that uses the timerstamper, to encourage people to specifically provide a tsu_clk and avoid silently registering the timerstamper with the wrong clock. If the pclk is actually used, it can be provided as a tsu_clk for improved clarity in devicetrees. While this changes the meaning of the devicetree property, it is backwards compatible as there's no functional change for platforms that didn't provide a tsu_clk and the changed meaning of providing a tsu_clk in the devicetree does not impact platforms that already provided one as the decision about the tsu clock source is at IP instantiation time rather than at runtime, so there's no driver behaviour that needs to change based on the input to the IP used for the timestamping unit. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index b476bc9663ecd..6b37598ac57cd 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3534,6 +3534,7 @@ static unsigned int gem_get_tsu_rate(struct macb *bp) else if (!IS_ERR(bp->pclk)) { tsu_clk =3D bp->pclk; tsu_rate =3D clk_get_rate(tsu_clk); + dev_warn(&bp->pdev->dev, "devicetree missing tsu_clk, using pclk as fall= back\n"); } else return -ENOTSUPP; return tsu_rate; --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3C7B3D1702; Tue, 10 Mar 2026 17:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163170; cv=none; b=r+8mh0kD0LxSnoJuat6d6YSlSUvUr5hMq0ouTdIUBBxqHrHPvzHQSR+DGRSSqretRLsh8WT4k4GctCvMin23stu256bzG8kNGRM9rXz6VJdyfTY+7WEExJhqi7tCMW51q6ETIJ+Of6Ez/e0OC8xlUfi8ulth1gumRC0mMu0hDeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163170; c=relaxed/simple; bh=l0HWcNcVkVo9YLSrRqspDdP84/kdc2LHA5rpvVoVGqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oxu5Sqv2gxkWoRg34JqBiJujXD5qg7+KmSAOXl0AQVNzNybttVi5LY6MgE1jAF2HtY9jL1GYuuktsBKUc7mxB6fPFoznOzed2XifUFI3ff7XkITzp+U1YTqauxTXLPz2W2MIBHwXf77Tgdo5hBuuolVXMt08LaWfxwohEiv1L+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UZOu3jbw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UZOu3jbw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63D81C2BCAF; Tue, 10 Mar 2026 17:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163170; bh=l0HWcNcVkVo9YLSrRqspDdP84/kdc2LHA5rpvVoVGqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZOu3jbwCJQybbw9ITXnq/6jm5sdEpvaO+pzakWGIN+iyNSYTLLBQrrVJbrd1idVB DybwhA0D4ougEcRqKzQY3N4YRh37XIXm03vtPrUhecWaT6kICBhAOSfcPQu6zKE0zK BbLFZDPLFdD9iHsUglpz5krTCzo8mskSRB367Xkmbx91gFSLrobe3B4okgNBfdqIR3 jjom2dj3pT88Xcnvdb4uEKRdZ2N6kYYIBCP0qYrODBczDflStGNgQaJyhb0uC4J3df wV8Ojw8QDjkE2u3Avb3ERM6xrUmPVREwxR2jkYto+Hozb+H72DReSd8/Vzeg1Ra29F zVeznfyxV7fEA== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 08/10] net: macb: clean up tsu clk rate acquisition Date: Tue, 10 Mar 2026 17:17:15 +0000 Message-ID: <20260310-undefined-unfocused-805b5f2d3b37@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1291; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=pBzsAzv0f5XjXC1axq0Olq90oNiYo0A1zmrCQdWDjrw=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgvRMZz1RyXH1WvCHJZxzkUWcxREP8bC0lU/neAeYM hRfYb7SUcrCIMbFICumyJJ4u69Fav0flx3OPW9h5rAygQxh4OIUgInEzGT4Z5Ta9aBIhzcmk3Ph vnTjuc1xro67WCsSdZ7HCfTq7n5wlpHhf6Jd9lSnx3qf/E61ss7fvejji/+v+B+t3DhX1VmLV0q FAQA= X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley tsu_clk is grabbed during probe, so doesn't need to be re-grabbed here. pclk is mandatory, probe will fail if it is err/NULL, so there's no need to check it here or have a !pclk 3rd arm. Simplify gem_get_tsu_rate() to account for these facts. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 6b37598ac57cd..38e75c2e097bf 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3527,16 +3527,14 @@ static unsigned int gem_get_tsu_rate(struct macb *b= p) struct clk *tsu_clk; unsigned int tsu_rate; =20 - tsu_clk =3D devm_clk_get(&bp->pdev->dev, "tsu_clk"); - if (!IS_ERR(tsu_clk)) - tsu_rate =3D clk_get_rate(tsu_clk); - /* try pclk instead */ - else if (!IS_ERR(bp->pclk)) { + if (!IS_ERR_OR_NULL(bp->tsu_clk)) { + tsu_rate =3D clk_get_rate(bp->tsu_clk); + } else { tsu_clk =3D bp->pclk; tsu_rate =3D clk_get_rate(tsu_clk); dev_warn(&bp->pdev->dev, "devicetree missing tsu_clk, using pclk as fall= back\n"); - } else - return -ENOTSUPP; + } + return tsu_rate; } =20 --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A87E73D3CEC; Tue, 10 Mar 2026 17:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163176; cv=none; b=sYVAXg4QKTP2xa95cyiE1A1MfkUFPZQ96Ie2r1MyqxBdMzaKBqCj+lVjH97vYlbK5R2lxlCakevRFy0nM+XCc2FPIdcAETZYmSGT+S61dsKRHFxzLhbiZeJDFYovyoMTqKoOYntBlW3FU6ct5Q/f93HyFtUBRY1P/ziN6my7wn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163176; c=relaxed/simple; bh=4Jefrf9Fj15twe5ClL92NgaOwnYD/+HOvjurslPqioo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D+0aSc7DHeDV1Zv4MSjBjuDDqtmHMiGMVmM7IhqTdHV6wJOcn1BSqchE2YXFpuRdDm23oycSoewyUrMam2yFQUQxr66RDFQphED/dNHM6x6GsgOehXHCoqECw+dmTy6xOeOJ0fLX4T7MAB8cjgGs/kPuizyJus2JnO77Y+pwFik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hapoV9Uc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hapoV9Uc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AD98C2BCB4; Tue, 10 Mar 2026 17:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163176; bh=4Jefrf9Fj15twe5ClL92NgaOwnYD/+HOvjurslPqioo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hapoV9Uci77yy+KzMxuehDevksM7h75V5zqUMWJYQyqBZMMINcYAoGBgX6R85O6BY He5priq/mvJzO57LrbW3lPt6xl65NLDzaButDFp3uOmVTKeuqoaAgU7aTW7mItY3Wl gEECSuRDwiJr94c0SfNwrYwJI3avfoOE/EvtD7r8RmFb899UaVsWQEzuRhu5tEaat1 lEkECSsEWui+P2jq5BZTh6DCPWd9mt6B+glC5GELg74F+KA8au1klN0lN0GHiPtntQ mdmf2YyTyjn0SRklmQKCGQM2OBnhBBOGq0BIoIgIJBYn+0bDMvZNE5bKj6A+nglZKM nGk3slVlFnkAg== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 09/10] dt-bindings: net: macb: add property indicating timer adjust mode Date: Tue, 10 Mar 2026 17:17:16 +0000 Message-ID: <20260310-aviator-upswing-80e8543a2300@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2043; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=PwUkqjIET53ZYiiF+Rx5ytj1SfxTmti7f7XTTfzPPXc=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgvReF159pbtLr/n67uzumtDNa3zro+dsFvugeHNSU XbxUf0JHaUsDGJcDLJiiiyJt/tapNb/cdnh3PMWZg4rE8gQBi5OAZjI5bmMDFPNc492vbZdwh+x 8f+OgJtLp/N+FW0wbJT/e6TO+t9R6whGhodH5xoccbyccONvPsurWTvV+r7u2uMfmCN04aGL/Jc PxUwA X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley The GEM IP has two methods for modifying the ptp timer. The first of these, named "increment mode", relies on software controlling the timer by setting tsu_timer_incr and tsu_timer_incr_sub_nsec and performing once-off adjustments via the tsu_timer_adjust register. This is what the macb driver uses. The second mechanism, "timer adjust mode" uses the gem_tsu_inc_ctrl and gem_tsu_ms signals to control the timer. These modes are not intended to be used in parallel, but both can be possible on the same device and which mode is used cannot be determined from the compatible on all devices, because some users of the GEM IP are SoC FPGAs that permit configuring how the IP is wired up. Add a property to indicate that gem_tsu_inc_ctrl and gem_tsu_ms are wired up for timer adjust mode. Signed-off-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/net/cdns,macb.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documen= tation/devicetree/bindings/net/cdns,macb.yaml index a492357570edd..84c32664ccb0d 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -139,6 +139,12 @@ properties: that need to be filled, before the forwarding process is activated. Width of the SRAM is platform dependent, and can be 4, 8 or 16 bytes. =20 + cdns,timer-adjust: + type: boolean + description: + Set when the hardware is operating in timer-adjust mode, where the t= imer + is controlled by the gem_tsu_inc_ctrl and gem_tsu_ms inputs. + '#address-cells': const: 1 =20 @@ -188,6 +194,15 @@ allOf: properties: reg: maxItems: 1 + - if: + not: + properties: + compatible: + contains: + const: microchip,mpfs-macb + then: + properties: + cdns,timer-adjust: false =20 - if: properties: --=20 2.51.0 From nobody Wed Apr 8 02:50:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 337CF3D171F; Tue, 10 Mar 2026 17:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163182; cv=none; b=RHTjX0n0bpFzgJ0sRzQam7o1fv7Z60v8ro23VMGuU1DDMF0gRd82B8zIsOn3Omny1lEA0pP0ZSvcN7aeriiaN0okXgKO8CPQ2ZnKOkFYOBqLDKgFKnwsU+GC5AbK84boVC5Vn6WT6DHdTqDD98VlOZpqsZ7/KXB7Yj2p7ur/noE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773163182; c=relaxed/simple; bh=9DLc73kRovjX7PmKOfMC6v7DvLF8VkwF6ivlc5RlT3Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Tsdb0Phr0XLdrY/ZSTcFt06ipBCG2cb1uOLhDbVdbtuwE9pzjyZOv5DhTtaBizZ+YlxyTwH8er8iTZ8kO639L86n/mg0nPJz5vYBJT1qKguM+GZyKhYxNWudc6vkiY5KwirwhlIjsPrX67r+q09B63hay5d6IXa4INYEDlofRRQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LtNAAwQZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LtNAAwQZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C550FC19425; Tue, 10 Mar 2026 17:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773163182; bh=9DLc73kRovjX7PmKOfMC6v7DvLF8VkwF6ivlc5RlT3Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LtNAAwQZEWoDaAVsZHl1xlcSy7lWlO+9QwLPUxI/j1WH8mjZNBBiXqbvRWc+1cTl0 yf65f6i5wm4OoeL6y/p7qP4wgiXmpU++qxFmuroYpxz092UuB4XGlAwW5KM3rKiFJ4 1wnQugkZyQkkK5FWVkpLlQiGsdtX8pgqRw2qwH7SjuevLgVdgKfTwNlw5jATGRqL7b UQAe/oUSFq51MMTusYKQem69YHjxqI7CAWL4y7n4b3VhCdPVRIpndKratErDEhT8C0 ibf6dXW320EKvo/40yN6YK3lOxWzCuuxhdaTHHPC4jEbfxeclrF1tkokWvTVUshSWJ 6LDCnONlQA/3Q== From: Conor Dooley To: netdev@vger.kernel.org Cc: conor@kernel.org, Conor Dooley , Valentina.FernandezAlanis@microchip.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Daire McNamara , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nicolas Ferre , Claudiu Beznea , Richard Cochran , Samuel Holland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph , =?UTF-8?q?Th=C3=A9o=20Lebrun?= , Ryan.Wanner@microchip.com Subject: [PATCH net-next v3 10/10] net: macb: timer adjust mode is not supported Date: Tue, 10 Mar 2026 17:17:17 +0000 Message-ID: <20260310-faceplate-ashy-ca696dd4433d@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260310-moneyless-dispense-7bce14b16388@spud> References: <20260310-moneyless-dispense-7bce14b16388@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1214; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=OqQujPb90kYRx/KgLbRe0CGbTbZ7JG8YWaMugKJ3peY=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJkbgvSn2dU3zSp7xibx5n+F55T0t6LBly+n+V/a6rj7U lmTilJERykLgxgXg6yYIkvi7b4WqfV/XHY497yFmcPKBDKEgYtTACZyfC8jw2O2H3Vyrcb5uad6 n3RGHli0cf8a9U3LEm57c8XU/td7FcrIsCJOWXFGy4Ub+RpM+n//zbhYe6LqV3jzjIUrZN/d01q mwQ4A X-Developer-Key: i=conor.dooley@microchip.com; a=openpgp; fpr=F9ECA03CF54F12CD01F1655722E2C55B37CF380C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Conor Dooley The ptp portion of this driver controls the tsu's timer using the controls for "increment mode", which is not compatible with the hardware trying to control it via the gem_tsu_inc_ctrl and gem_tsu_ms inputs in "timer adjust mode". Abort probe if the property signalling that the relevant signals have been wired up is present. Signed-off-by: Conor Dooley --- drivers/net/ethernet/cadence/macb_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 38e75c2e097bf..3e0ab23e9b9b0 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5577,6 +5577,13 @@ static int macb_probe(struct platform_device *pdev) =20 bp->usrio =3D macb_config->usrio; =20 + if (of_property_read_bool(bp->pdev->dev.of_node, "cdns,timer-adjust") && + IS_ENABLED(CONFIG_MACB_USE_HWSTAMP)) { + dev_err(&pdev->dev, "Timer adjust mode is not supported\n"); + err =3D -EINVAL; + goto err_out_free_netdev; + } + /* By default we set to partial store and forward mode for zynqmp. * Disable if not set in devicetree. */ --=20 2.51.0