mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: designware-imx: don't set txclk when mode is (r)mii
@ 2025-11-14 15:05 Maud Spierings via B4 Relay
  2025-11-18  8:54 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Maud Spierings via B4 Relay @ 2025-11-14 15:05 UTC (permalink / raw)
  To: Sascha Hauer, BAREBOX; +Cc: Maud Spierings

From: Maud Spierings <maudspierings@gocontroll.com>

Add an early exit to eqos_set_txclk() when the mode is (r)mii.

The "tx" clock is actually something called the "slice 81 clock" which
must always be 50M for the rmii mode. This will later get divided into
the actual tx clock /2 or /20 which does match those clock rates. Still
the provided clock != tx clock when the mode is rmii.

Linux also excludes the mii mode from this clock lookup, even though
the clock rates actually seem to match there. I am not aware why it is
also excluded, it may be best to wait with merging this until [1] has
found an answer. But for now I thought it would be best to match Linux
behaviour.

Link: https://lore.kernel.org/all/aRclKDeHzfJSzpQ3@shell.armlinux.org.uk/ [1]

Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
---
 drivers/net/designware_imx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/designware_imx.c b/drivers/net/designware_imx.c
index ec3558fad0..bc3136f8ff 100644
--- a/drivers/net/designware_imx.c
+++ b/drivers/net/designware_imx.c
@@ -59,10 +59,15 @@ static unsigned long eqos_get_csr_clk_rate_imx(struct eqos *eqos)
 
 static int eqos_set_txclk(struct eqos *eqos, int speed)
 {
+	phy_interface_t interface = eqos->interface;
 	struct eqos_imx_priv *priv = eqos->priv;
 	unsigned long rate;
 	int ret;
 
+	if (interface == PHY_INTERFACE_MODE_RMII ||
+	    interface == PHY_INTERFACE_MODE_MII)
+		return 0;
+
 	switch (speed) {
 	case SPEED_10:
 		rate = 2500000;

---
base-commit: f485ddfccf960959d25462073528d314b8bf1aea
change-id: 20251114-eqos_rmii-dce3331ad692

Best regards,
-- 
Maud Spierings <maudspierings@gocontroll.com>





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

* Re: [PATCH] net: designware-imx: don't set txclk when mode is (r)mii
  2025-11-14 15:05 [PATCH] net: designware-imx: don't set txclk when mode is (r)mii Maud Spierings via B4 Relay
@ 2025-11-18  8:54 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-11-18  8:54 UTC (permalink / raw)
  To: BAREBOX, Maud Spierings via B4 Relay; +Cc: Maud Spierings


On Fri, 14 Nov 2025 16:05:17 +0100, Maud Spierings via B4 Relay wrote:
> Add an early exit to eqos_set_txclk() when the mode is (r)mii.
> 
> The "tx" clock is actually something called the "slice 81 clock" which
> must always be 50M for the rmii mode. This will later get divided into
> the actual tx clock /2 or /20 which does match those clock rates. Still
> the provided clock != tx clock when the mode is rmii.
> 
> [...]

Applied, thanks!

[1/1] net: designware-imx: don't set txclk when mode is (r)mii
      https://git.pengutronix.de/cgit/barebox/commit/?id=173d4f2bfc11 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-11-18  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-14 15:05 [PATCH] net: designware-imx: don't set txclk when mode is (r)mii Maud Spierings via B4 Relay
2025-11-18  8:54 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox