linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] net: dwmac-imx: add imx93 clock input support in RMII mode
@ 2024-12-27  9:59 Mathieu Othacehe
  2025-01-03  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Othacehe @ 2024-12-27  9:59 UTC (permalink / raw)
  To: Alexandre Torgue, Jose Abreu, Andrew Lunn, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: netdev, linux-stm32, linux-arm-kernel, imx, linux-kernel,
	Mathieu Othacehe

If the rmii_refclk_ext boolean is set, configure the ENET QOS TX_CLK pin
direction to input. Otherwise, it defaults to output.

That mirrors what is already happening for the imx8mp in the
imx8mp_set_intf_mode function.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
Changelog:
v2: regmap_update_bits -> regmap_clear_bits

 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index 43e0fbba4f77b..4ac7a78f4b14b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -36,6 +36,8 @@
 #define MX93_GPR_ENET_QOS_INTF_SEL_RMII		(0x4 << 1)
 #define MX93_GPR_ENET_QOS_INTF_SEL_RGMII	(0x1 << 1)
 #define MX93_GPR_ENET_QOS_CLK_GEN_EN		(0x1 << 0)
+#define MX93_GPR_ENET_QOS_CLK_SEL_MASK		BIT_MASK(0)
+#define MX93_GPR_CLK_SEL_OFFSET			(4)
 
 #define DMA_BUS_MODE			0x00001000
 #define DMA_BUS_MODE_SFT_RESET		(0x1 << 0)
@@ -108,13 +110,21 @@ imx8dxl_set_intf_mode(struct plat_stmmacenet_data *plat_dat)
 static int imx93_set_intf_mode(struct plat_stmmacenet_data *plat_dat)
 {
 	struct imx_priv_data *dwmac = plat_dat->bsp_priv;
-	int val;
+	int val, ret;
 
 	switch (plat_dat->mac_interface) {
 	case PHY_INTERFACE_MODE_MII:
 		val = MX93_GPR_ENET_QOS_INTF_SEL_MII;
 		break;
 	case PHY_INTERFACE_MODE_RMII:
+		if (dwmac->rmii_refclk_ext) {
+			ret = regmap_clear_bits(dwmac->intf_regmap,
+						dwmac->intf_reg_off +
+						MX93_GPR_CLK_SEL_OFFSET,
+						MX93_GPR_ENET_QOS_CLK_SEL_MASK);
+			if (ret)
+				return ret;
+		}
 		val = MX93_GPR_ENET_QOS_INTF_SEL_RMII;
 		break;
 	case PHY_INTERFACE_MODE_RGMII:
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] net: dwmac-imx: add imx93 clock input support in RMII mode
  2024-12-27  9:59 [PATCH v2] net: dwmac-imx: add imx93 clock input support in RMII mode Mathieu Othacehe
@ 2025-01-03  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-03  2:40 UTC (permalink / raw)
  To: Mathieu Othacehe
  Cc: alexandre.torgue, joabreu, andrew+netdev, davem, edumazet, kuba,
	pabeni, mcoquelin.stm32, shawnguo, s.hauer, kernel, festevam,
	netdev, linux-stm32, linux-arm-kernel, imx, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 27 Dec 2024 10:59:22 +0100 you wrote:
> If the rmii_refclk_ext boolean is set, configure the ENET QOS TX_CLK pin
> direction to input. Otherwise, it defaults to output.
> 
> That mirrors what is already happening for the imx8mp in the
> imx8mp_set_intf_mode function.
> 
> Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
> 
> [...]

Here is the summary with links:
  - [v2] net: dwmac-imx: add imx93 clock input support in RMII mode
    https://git.kernel.org/netdev/net-next/c/94c16fd4df90

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-03  2:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-27  9:59 [PATCH v2] net: dwmac-imx: add imx93 clock input support in RMII mode Mathieu Othacehe
2025-01-03  2:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).