drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The current eMDIO MDC rate is 558 kHz on i.MX95 B0. This is very low,
but also very compatible. However, for example NXP TJA1120 PHY needs
at minimum 1 MHz MDC clock and 558 kHz does not work with that PHY.
As a minimum change, increase the MDC clock to 1.2 MHz which should be
equally very compatible, since even old PHYs like LAN8210Ai, KSZ8794,
DP83822 support up to 2.5 MHz MDC clock frequency, and it covers the
NXP TJA1120 as well. There is no known rationale for why the 558 kHz
was picked when the eMDIO driver was added.
Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: Clark Wang <xiaoning.wang@nxp.com>
Cc: Claudiu Manoil <claudiu.manoil@nxp.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Wei Fang <wei.fang@nxp.com>
Cc: imx@lists.linux.dev
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
---
NOTE: Alternatively, I can either add a DT property to configure the
clock rate, or model the clock as clock hw divider and then use
assigned-clock-rates DT property to configure the desired rate?
---
drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
index 998aaa394e9c4..30ea91cea00e5 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
@@ -24,7 +24,7 @@
#define ENETC_EMDIO_CFG \
(MDIO_CFG_HOLD(2) | \
- MDIO_CFG_CLKDIV(258) | \
+ MDIO_CFG_CLKDIV(138) | \
MDIO_CFG_NEG)
#define MDIO_CTL_DEV_ADDR(x) ((x) & 0x1f)
--
2.53.0
Hi, On 2026/9/24 8:30, Marek Vasut wrote: > The current eMDIO MDC rate is 558 kHz on i.MX95 B0. This is very low, > but also very compatible. However, for example NXP TJA1120 PHY needs > at minimum 1 MHz MDC clock and 558 kHz does not work with that PHY. > > As a minimum change, increase the MDC clock to 1.2 MHz which should be > equally very compatible, since even old PHYs like LAN8210Ai, KSZ8794, > DP83822 support up to 2.5 MHz MDC clock frequency, and it covers the > NXP TJA1120 as well. There is no known rationale for why the 558 kHz > was picked when the eMDIO driver was added. > > Signed-off-by: Marek Vasut <marex@nabladev.com> > --- > Cc: "David S. Miller" <davem@davemloft.net> > Cc: Andrew Lunn <andrew+netdev@lunn.ch> > Cc: Clark Wang <xiaoning.wang@nxp.com> > Cc: Claudiu Manoil <claudiu.manoil@nxp.com> > Cc: Eric Dumazet <edumazet@google.com> > Cc: Jakub Kicinski <kuba@kernel.org> > Cc: Paolo Abeni <pabeni@redhat.com> > Cc: Vladimir Oltean <vladimir.oltean@nxp.com> > Cc: Wei Fang <wei.fang@nxp.com> > Cc: imx@lists.linux.dev > Cc: linux-kernel@vger.kernel.org > Cc: netdev@vger.kernel.org > --- > NOTE: Alternatively, I can either add a DT property to configure the > clock rate, or model the clock as clock hw divider and then use > assigned-clock-rates DT property to configure the desired rate? There's a documented DT property, at Documentation/devicetree/bindings/net/mdio.yaml : clock-frequency: description: Desired MDIO bus clock frequency in Hz. Values greater than IEEE 802.3 defined 2.5MHz should only be used when all devices on the bus support the given clock speed. If the property is absent, you should configure the standard 2.5MHz rate by default, instead of 1.2MHz. > --- > drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c > index 998aaa394e9c4..30ea91cea00e5 100644 > --- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c > +++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c > @@ -24,7 +24,7 @@ > > #define ENETC_EMDIO_CFG \ > (MDIO_CFG_HOLD(2) | \ > - MDIO_CFG_CLKDIV(258) | \ > + MDIO_CFG_CLKDIV(138) | \ > MDIO_CFG_NEG) > > #define MDIO_CTL_DEV_ADDR(x) ((x) & 0x1f)
> If the property is absent, you should configure the standard 2.5MHz rate by
> default, instead of 1.2MHz.
Agreed. 802.3 says all devices on the bus should support 2.5Mhz. So i
see no real risk increasing it to whatever the hardware can do close,
but less than that.
Andrew
---
pw-bot: cr
© 2016 - 2026 Red Hat, Inc.