[U-Boot] [PATCH u-boot 1/2] net: phy: Add support for accessing MMD PHY registers

Carlo Caione ccaione at baylibre.com
Tue Jan 22 22:53:55 UTC 2019


On 22/01/19 22:21, Joe Hershberger wrote:
>On Wed, Jan 16, 2019 at 12:06 PM Carlo Caione <ccaione at baylibre.com> wrote:
>>
>> Two new helper functions (phy_read_mmd() and phy_write_mmd()) are added
>> to allow access to the MMD PHY registers.
>>
>> The MMD PHY registers can be accessed by two means:
>>
>> 1. Using two new MMD access function hooks in the PHY driver. These
>> functions can be implemented when the PHY driver does not support the
>> standard IEEE Compatible clause 45 access mechanism described in clause
>> 22 or if the PHY uses its own non-standard access mechanism.
>>
>> 2. The standard clause 45 access extensions to the MMD registers through
>> the indirection registers (clause 22) in all the other cases.
>>
>> Signed-off-by: Carlo Caione <ccaione at baylibre.com>
>
>This seems like a duplicate of https://patchwork.ozlabs.org/patch/1015782/

Well, I should have looked better. Interestingly I was going to use my
patch to fix the exact same issue on a different PHY.

The problem I see with that patch is that it is assuming that all the 
PHY devices support clause 45 access extension using the clause 22 
registers. This is not always true (see for example [0]). That's why I 
added two new hooks in the PHY driver.

On a side note looking at that patch it seems that 'addr' (documented as 
the PHY address in the same patch) is being passed to 'phy_write' where 
we should have the 'devad' parameter instead (MDIO_DEVAD_NONE)?

>The command patch should probably be adapted to use that.

Let me know if you think it is valuable still to add the two hooks on 
top of that patch.

Thanks,

[0] https://patchwork.ozlabs.org/patch/351634/

-- 
Carlo Caione


More information about the U-Boot mailing list