Hi Fabio, Primoz, Peng,

On 9/24/2024 10:56 AM, Peng Fan wrote:
Subject: Re: [PATCH 1/2] net: fec_mxc: Fix clk_ref rate on iMX93

Hi,

On 23. 09. 24 15:14, Peng Fan (OSS) wrote:
From: Ye Li <[email protected]>

Because iMX93 has a internal 1/2 divider before clock input to
network
controller, so have to set twice frequency rate

Fixes: 09de565f76b ("net: fec_mxc: support i.MX93")
Signed-off-by: Ye Li <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
---
  drivers/net/fec_mxc.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index
0a0d92bc2cd..e5d7f0f3e1e 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1215,6 +1215,9 @@ static int fecmxc_set_ref_clk(struct clk
*clk_ref, phy_interface_t interface)
        else
                return -EINVAL;

+       if (is_imx93())
+               freq = freq << 1;
Humm, but how did it work so far?

On phyboard-segin-imx93, this change breaks fec ethernet.

I had to revert this already in NXP downstream u-boot.
Ah. If you set enet_ref_clk to 250M, then you no need
this change. Otherwise you need this change.

Regards,
Peng.

Just check phyboard-segin-imx93, this board uses RMII not RGMII. It outputs CCM clk_enet_ref on pin ENET1_TX_CLK to external phy for reference clock and loop back it on pad to FEC as RMII clock. So this usage has bypassed the 1/2 divider since the 1/2 divider is inside wakeupmix not on path CCM clk_enet_ref to pad.  We need to change the patch to limit the 1/2 divider only for RGMII on iMX93.

In kernel, clk_enet_ref is assigned by dts, I don't see its rate changed by driver like u-boot.


Best regards,

Ye Li

BR,
Primoz


+
        ret = clk_set_rate(clk_ref, freq);
        if (ret < 0)
                return ret;
--
Primoz Fiser                    | phone: +386-41-390-545
<tel:+386-41-390-545> |
---------------------------------------------------------|
Norik systems d.o.o.            |
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
www.norik.com%2F&data=05%7C02%7Cpeng.fan%40nxp.com%7C482
464a6990d46e9668808dcdbd135d9%7C686ea1d3bc2b4c6fa92cd99c
5c301635%7C0%7C0%7C638626938825379940%7CUnknown%7CTW
FpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW
wiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=kkO%2FnCs8%2FjpZ4ez
JYDHo5T57jmUVPdp%2Fs34CnpwrsGM%3D&reserved=0
<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2
Fwww.norik.com%2F&data=05%7C02%7Cpeng.fan%40nxp.com%7C48
2464a6990d46e9668808dcdbd135d9%7C686ea1d3bc2b4c6fa92cd99
c5c301635%7C0%7C0%7C638626938825421127%7CUnknown%7CT
WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
WwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=0YIItswvK9V9zEcn83I
h0IRjyzNGvqkM7vq4bXnajRI%3D&reserved=0>  | Your embedded
software partner  | email: [email protected] <mailto:[email protected]> |
Slovenia, EU                    | phone: +386-41-540-545
<tel:+386-41-540-545> |

Reply via email to