Re: [PATCH 4/5] arm64: dts: allwinner: a527: add EMAC0 to Radxa A5E board

Jernej Škrabec
2025-04-24T19:21:13Z

Dne četrtek, 24. april 2025 ob 21:05:17 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> On Fri, Apr 25, 2025 at 3:02 AM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > In my experience, vendor DT has proper delays specified, just 7 instead of
> > > 700, for example. What they get wrong, or better said, don't care, is phy
> > > mode. It's always set to rgmii because phy driver most of the time ignores
> > > this value and phy IC just uses mode set using resistors. Proper way here
> > > would be to check schematic and set phy mode according to that. This method
> > > always works, except for one board, which had resistors set wrong and
> > > phy mode configured over phy driver was actually fix for it.
> >
> > What PHY driver is this? If it is ignoring the mode, it is broken.
> >
> > We have had problems in the past in this respect. A PHY driver which
> > ignored the RGMII modes, and strapping was used. That 'worked' until
> > somebody built a board with broken strapping and added code to respect
> > the RGMII mode, overriding the strapping. It made that board work, but
> > broke lots of others which had the wrong RGMII mode....
> >
> > If we have this again, i would like to know so we can try to get in
> > front of the problem, before we have lots of broken boards...
>
> I think the incident you are referring to is exactly the one that Jernej
> mentioned.
>
> And regarding the bad PHY driver, it could simply be that the PHY driver
> was not built or not loaded, hence the kernel falling back to the generic
> one, which of course doesn't know how to set the modes.

Mainline is sorted out as far as I'm aware. Broken PHY drivers are part
of BSP code drops, from where these values are taken from. So, for sure
I wouldn't trust phy mode set in BSP code, but allwinner,tx-delay-ps and
allwinner,rx-delay-ps are usually trustworthy.

Best regards,
Jernej