Re: [PATCH net-next 2/2] net: mdio: add a driver for PIC64-HPSC/HX MDIO controller
From: Charles Perry
Date: Thu Mar 19 2026 - 17:39:22 EST
On Thu, Mar 19, 2026 at 08:53:01PM +0100, Andrew Lunn wrote:
> > My idea is that if someone wants to use whatever is the hardware default
> > or what was set by the bootloader, they have an option to do so. For that
> > reason, I made the clock and the clock-frequency optional. This is
> > something I can do without if you think it will homogenize better with new
> > drivers.
> >
> > Now I just realized that I can achieve this by just making the
> > clock-frequency optional and not the clock.
>
> It gets complicated pretty quickly, if you leave things open.
>
> 802.3 sets a maximum of 2.5Mhz. When this driver takes over the
> hardware, and there is no hint from device tree what frequency to use,
> but the hardware is configured to 50Mhz, what should it do? Trust the
> bootloader? Or assume the bootloader or something else has messed it
> up? Same goes for 1KHz?
>
> Is the hardware default documented in the datasheet? Does it default
> to 2.5Mhz?
No, it defaults to something rather slow: 610 KHz (assuming the input clock
is 156.25MHz, divides by 256)
>
> > - mdio-airoha.c: use 2.5MHz if not specified
>
> I personally would do this. This keeps you in line with 802.3. Anybody
> wanting to do anything else then uses clock-frequency, so the
> intention is clearly documented.
Ok, sounds good, I'll use this policy.
Thanks,
Charles