RE: [PATCH net-next 1/4] dt-bindings: net: add dt binding for realtek rtl82xx phy

From: Joakim Zhang
Date: Tue Jun 01 2021 - 23:15:02 EST



Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: 2021年6月2日 10:39
> To: Joakim Zhang <qiangqing.zhang@xxxxxxx>
> Cc: davem@xxxxxxxxxxxxx; kuba@xxxxxxxxxx; robh+dt@xxxxxxxxxx;
> hkallweit1@xxxxxxxxx; linux@xxxxxxxxxxxxxxx; f.fainelli@xxxxxxxxx;
> dl-linux-imx <linux-imx@xxxxxxx>; netdev@xxxxxxxxxxxxxxx;
> devicetree@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net-next 1/4] dt-bindings: net: add dt binding for realtek
> rtl82xx phy
>
> > +properties:
> > + rtl821x,clkout-disable:
> > + description: Disable CLKOUT clock.
> > + type: boolean
> > +
> > + rtl821x,aldps-disable:
> > + description: Disable ALDPS mode.
> > + type: boolean
>
> I think most of the problems are the ambiguity in the binding.
>
> If rtl821x,clkout-disable is not present, should it enable the CLKOUT?
> That needs clear define here.
No, don't need to, CLKOUT clock default is enabled after PHY hardware reset. Add this property for users
request to disable this clock output. I will improve the description.

> Do we actually want a tristate here?
>
> rtl821x,clkout = <true>;
>
> means ensure the clock is outputting.
>
> rtl821x,clkout = <false>;
>
> means ensure the clock is not outputting.
I think it's unnecessary. A boolean type here is enough.

> And if the property is not in DT at all, leave the hardware alone, at either its
> default value, or whatever came before has set it to?
Seems not.
1. If enable CLKOUT in boot loader or keep the hardware default value (CLKOUT enabled), DT would work with this patch.
2. If disable CLKOUT in boot loader, with this patch, driver would enable this clock if this property is not in DT.

So, I need first read PHYCR2 register, if DT has property then disable the clock, if not, keep the original value?

However, for ALDPS mode, the hardware default value is disabled. The driver enable ALDPS by default which caused issue at my side. So need a property to disable it.

We had better add a property like " rtl821x,aldps-enable", but It seems break the existing behavior.

Best Regards,
Joakim Zhang
> Andrew