[U-Boot] [PATCH v4 3/3] cmd: mdio: Add new parameter to access MMD PHY registers

Vladimir Oltean vladimir.oltean at nxp.com
Thu Jan 24 20:48:57 UTC 2019


On 1/24/19 10:19 PM, Carlo Caione wrote:
> On 24/01/2019 20:12, Vladimir Oltean wrote:
>>
>> I still think I haven't successfully made my point.
>> If "mdio read 3.1" is a C45-only thing, "mdio read 1" is a C22-only
>> thing, then why do you need a new command "mdio rmmd 3.1" to do C45
>> emulation over C22? Is there any overlap I'm missing that mandates a new
>> syntax to differentiate? Can the command not simply see whether the PHY
>> is C22, and if it is and the MMD address is non-zero, just emulate it
>> via 0xd and 0xe writes?
> 
> Ok, I got your point now. I didn't give much thought on this TBH, good
> question.
> 
> Do we currently have a way in U-Boot to differentiate between C22 and
> C45 PHYs? The generic_10g PHY should be C45 but is that the only one
> currently supported?
> 
> --
> Carlo Caione
> 

I can't completely answer that, TBH I don't even know who is supposed to 
make that distinction.
For Freescale parts that is a call for the MDIO bus driver to make, for 
good or bad (see drivers/net/fm/memac_phy.c where dev_addr is compared 
to MDIO_DEVAD_NONE).
And in your patch, phy_write_mmd is only a wrapper over bus->write in 
the end, with some more logic to handle C22 indirection.
So my question of unifying "mdio rmmd" with "mdio read" translates into: 
Does it make sense to also handle the check with MDIO_DEVAD_NONE in 
phy_write_mmd, instead of jumping straight ahead to perform indirection? 
The goal would then be to just call phy_write_mmd from cmd/mdio.c 
regardless of the target PHY's clause.
-Vladimir


More information about the U-Boot mailing list