Re: [PATCH net-next 2/3] net: bcmgenet: Pass "main" clock down to the MDIO driver

From: Florian Fainelli
Date: Sat Feb 17 2024 - 12:18:27 EST


Hi Andrew,

On 2/17/2024 7:21 AM, Andrew Lunn wrote:
On Fri, Feb 16, 2024 at 10:42:36AM -0800, Florian Fainelli wrote:
GENET has historically had to create a MDIO platform device for its
controller and pass some auxiliary data to it, like a MDIO completion
callback. Now we also pass the "main" clock to allow for the MDIO bus
controller to manage that clock adequately around I/O accesses.

I guess this code comes from before the times of DT? I would normally
expect to see a clock added to the DT node for the MDIO bus. But if
there is no node, because it is not in DT....

The driver started being DT-only from the get go, however it was also my group's first attempt at upstreaming a driver and we did not get everything right in terms of the DT binding. In particular there was no "mdio" sub-node initially, but we still wanted to be able to split up the MDIO controller part since we knew it was going to be re-used in other designs (bcm_sf2 and later asp2). The platform device was the best we could come up with at the time.

All of our DTBs deployed out there do not have a "clocks" property within the "mdio" sub-mode of the GENET Ethernet node, so that is why we are doing this.

Thanks!
--
Florian

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature