From nobody Tue Dec 2 02:06:41 2025 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 3509336A00B; Thu, 20 Nov 2025 16:27:04 +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=1763656024; cv=none; b=SwjmSt4V7PJHkwNTrdlCQh50eMuLQozhmOJvkE/5sQXCnh97jLWY87MHPSf61DcKyUCGnqlMQ/TVHMbuIKEabCHlpkHCcJznPw3PYcNxGCjOReqE/9Fc1ubvsS7Zk6IR4eVEZtvnjhGB6vnU73I5IdKFuB7JF6c2F7jHcNEMAko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763656024; c=relaxed/simple; bh=OweOwTJ7iRHriV/3fFMI8DxPPwMu/XvNOTvcHJ/FBOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eFhZKG8wkec7URzB9GLUOTThT0S/yeDRVCk7QzSGgO2WO4hvpQt359EEux0CgK66BOdpoxqT4zc+acgbs21J6rIwFkfI3cAkRC1VLmQGi2iDxAOqWaDWjwKcbOKeV1WFwnWghFoUfHJcOjx71iP+iESb2t/fLo6DScYiG1b0XlQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fdETgA+g; 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="fdETgA+g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE44CC4CEF1; Thu, 20 Nov 2025 16:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763656024; bh=OweOwTJ7iRHriV/3fFMI8DxPPwMu/XvNOTvcHJ/FBOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdETgA+g3R0EW6aeW24bHZPgm6m62uRkdrkMSCVi0kiUZewS7iAJ97yY89ZtTQuSk DO0hsLOu/n557vc1K7hsKouuh9xfSsZCAiBQt043xMJR5x2ESkQPcilKWCXMSI1wS9 FU3v07driVnBcdVUJ+Zw8acieRE7aNLP81fjfaILvO1S3ru4mGR8oIhNrupORw5boJ bjAd3+dpbKdMkoZpfuCKYCWGMHrzNlsm8S+A/AuLY2kQLzfPGDJl7a4/F3A6FmvEul kByIz41Rw460euta3a8d9P/W3isykL/Gu9mJGhpi0TE04S4A4fYEuMRL3oX8onHZ99 ZALHhLjG8v1ew== 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, Neil Armstrong , Dave Stevenson , Sean Anderson , Vineeth Karumanchi , Abin Joseph Subject: [RFC net-next v1 7/7] net: macb: add mpfs specific usrio configuration Date: Thu, 20 Nov 2025 16:26:09 +0000 Message-ID: <20251120-unspoken-licking-5c9263746766@spud> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251120-jubilant-purposely-67ec45ce4e2f@spud> References: <20251120-jubilant-purposely-67ec45ce4e2f@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=2990; i=conor.dooley@microchip.com; h=from:subject:message-id; bh=G93/q3yEc1yTjdzyW1V6PNGqUts7lOELWRE7rxMzpvM=; b=owGbwMvMwCVWscWwfUFT0iXG02pJDJnyjtK7S6/pLjiezpBr8WV9wQf+7r47SanNTzT8PGVWa 0tqL+brKGVhEONikBVTZEm83dcitf6Pyw7nnrcwc1iZQIYwcHEKwEQ+T2b4K5iq3y1x2dJuTlFo c8iavutfrm/+N1/V6I3ahnnP8md+TWL476iluaLKWCL5l4i+fVUT60MHFsPnszPvnfdyTRRc8P8 eNwA= 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 AFAICT. Signed-off-by: Conor Dooley --- This may actually be a waste of time, since a) the peripheral is reset by the driver during probe which zeroes it, b) the timer-adjust mode is not permitted, so setting a 1 here is not ever done and c) the value written by the driver to the usrio register starts as zero, so would clear this bit anyway, were it to be set somehow. The alternative would be just setting the usrio struct pointer to NULL since none of the caps that would cause it to be accessed are set on this platform. --- 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 59881c48485b..d30682db410a 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -770,6 +770,7 @@ #define MACB_CAPS_QUEUE_DISABLE 0x00000800 #define MACB_CAPS_QBV 0x00001000 #define MACB_CAPS_USRIO_HAS_MII 0x00002000 +#define MACB_CAPS_USRIO_TSUCLK_SOURCE 0x00004000 #define MACB_CAPS_PCS 0x01000000 #define MACB_CAPS_HIGH_SPEED 0x02000000 #define MACB_CAPS_CLK_HW_CHG 0x04000000 @@ -1217,6 +1218,7 @@ struct macb_usrio_config { u32 rgmii; u32 refclk; u32 hdfctlen; + u32 tsu_source; }; =20 struct macb_config { diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 4ad1409dab63..dd14bb4c9e26 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4649,6 +4649,9 @@ static int macb_init(struct platform_device *pdev) if (bp->caps & MACB_CAPS_USRIO_HAS_CLKEN) val |=3D bp->usrio->refclk; =20 + if (bp->caps & MACB_CAPS_USRIO_TSUCLK_SOURCE) + val |=3D bp->usrio->tsu_source; + macb_or_gem_writel(bp, USRIO, val); } =20 @@ -5219,6 +5222,10 @@ static const struct macb_usrio_config at91_default_u= srio =3D { .refclk =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_usrio =3D { .mii =3D 0, .rmii =3D 1, @@ -5342,11 +5349,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_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