[PATCH] ARM: i.MX6Q: Add fixup for RTL8211E Gigabit Ethernet PHY

Панов Андрей rockford at yandex.ru
Wed Mar 4 11:08:42 PST 2015


Hello!

04.03.2015, 02:29, "Arnd Bergmann" <arnd at arndb.de>:
> On Tuesday 03 March 2015 20:42:59 Andrey Panov wrote:
>>  +static int rtl8211e_phy_fixup(struct phy_device *dev)
>>  +{
>>  +       phy_write(dev, 0x00, 0x3140);
>>  +       mdelay(10);
>>  +       phy_write(dev, 0x00, 0x3340);
>>  +       mdelay(10);
>>  +
>>  +       return 0;
>>  +}
>
> mdelay(10) is rather evil, can you use msleep(10) here instead?

Yes

>>  +               phy_register_fixup_for_uid(PHY_ID_RTL8211E, 0xffffffff,
>>  +                               rtl8211e_phy_fixup);
>
> How do you ensure that this fixup is only applied on the boards that need
> it, rather than all machines that happen to have this phy?

I've thought that if there no other fixups in code here checking a particular 
board where they run, this isn't necessary.
This SoC has only one ethernet MAC and if it is connected to this PHY, 
it should be initalized this way independently of board, like other code here does, I think.

This code just does forcibly restart autonegotiation.
I can wrap it in if(!of_machine_is_compatible(...)){}, if it is need.

And I see, mask is wrong - I should use 0x001fffff.

I'll resend a patch, thanks.

--
 Андрей



More information about the linux-arm-kernel mailing list