[U-Boot] [PATCH v2] net: phy: marvell: Add functions to read PHY's extended registers
York Sun
york.sun at nxp.com
Mon Oct 30 14:56:03 UTC 2017
On 10/30/2017 03:34 AM, Lukasz Majewski wrote:
> Hi York,
>
>> On 10/27/2017 08:23 AM, Lukasz Majewski wrote:
>>> On Fri, 27 Oct 2017 15:06:37 +0000
>>> York Sun <york.sun at nxp.com> wrote:
>>>
>>>> On 10/27/2017 02:12 AM, Lukasz Majewski wrote:
>>>>> This commit allows extended Marvell registers to be read with:
>>>>>
>>>>> foo > mdio rx FEC 3.10
>>>>> Reading from bus FEC
>>>>> PHY at address 0:
>>>>> 3.16 - 0x1063
>>>>> foo > mdio wx FEC 3.10 0x1011
>>>>>
>>>>> The above code changes the way ETH connector LEDs blink.
>>>>>
>>>>> Signed-off-by: Lukasz Majewski <lukma at denx.de>
>>>>>
>>>>> ---
>>>>>
>>>>> Changes in v2:
>>>>> - Provide the readext and writeext callbacks to other marvell ETH
>>>>> PHY devices
>>>>>
>>>>> drivers/net/phy/marvell.c | 47
>>>>> +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47
>>>>> insertions(+)
>>>>>
>>>>> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
>>>>> index b7f300e..19f451d 100644
>>>>> --- a/drivers/net/phy/marvell.c
>>>>> +++ b/drivers/net/phy/marvell.c
>>>>> @@ -104,6 +104,31 @@
>>>>> #define MIIM_88E151x_MODE_SGMII 1
>>>>> #define MIIM_88E151x_RESET_OFFS 15
>>>>>
>>>>> +static int m88e1xxx_phy_extread(struct phy_device *phydev, int
>>>>> addr,
>>>>> + int devaddr, int regnum)
>>>>> +{
>>>>> + int oldpage = phy_read(phydev, MDIO_DEVAD_NONE,
>>>>> MII_MARVELL_PHY_PAGE);
>>>>> + int val;
>>>>> +
>>>>> + phy_write(phydev, MDIO_DEVAD_NONE, MII_MARVELL_PHY_PAGE,
>>>>> devaddr);
>>
>> For register 30 and 31, the page register is 29, not 22.
>
> Yes, for 88E1145 and 88E1149 the page register is 29, not 22 (as it is
> in majority of devices from marvell.c file in u-boot).
>
> It seems like the most practical approach would be as presented in
> patch v1 - just enable this code on PHY which I can test.
>
> If you find other devices (boards) and test the code, then we can add
> it as well.
>
OK. Thanks for trying.
York
More information about the U-Boot
mailing list