[PATCH 1/2] net: fec_mxc: Fix clk_ref rate on iMX93

Peng Fan peng.fan at nxp.com
Tue Sep 24 08:05:31 CEST 2024


> Subject: RE: [PATCH 1/2] net: fec_mxc: Fix clk_ref rate on iMX93
> 
> > 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 <ye.li at nxp.com>
> > >
> > > 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 <ye.li at nxp.com>
> > > Signed-off-by: Peng Fan <peng.fan at nxp.com>
> > > ---
> > >  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.

I see your board set enet_ref to 50MHz, I have no idea why
set to 100M will break your board which is in rmii mode.
If you set enet_ref to 50MHz, the actually clk will be 25MHz

Regards,
Peng.
> 
> Regards,
> Peng.
> 
> >
> > 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: info at norik.com <mailto:info at norik.com> |
> > Slovenia, EU                    | phone: +386-41-540-545
> > <tel:+386-41-540-545> |



More information about the U-Boot mailing list