Subject: Re: [Bugme-new] [Bug 33042] New: Marvell 88E1145 phy configured incorrectly in fiber mode

From: David Daney <[email-masked]>
Date: Mon, 11 Apr 2011 14:18:51 -0700

On 04/11/2011 02:02 PM, Andrew Morton wrote:
>
> (switched to email.  Please respond via emailed reply-to-all, not via the
> bugzilla web interface).
>
> On Mon, 11 Apr 2011 09:28:18 GMT
> [email-masked] wrote:
>
>> https://bugzilla.kernel.org/show_bug.cgi?id=33042
>>
>>             Summary: Marvell 88E1145 phy configured incorrectly in fiber
>>                      mode
>>             Product: Drivers
>>             Version: 2.5
>>      Kernel Version: Linux-2.6.39-rc1-00191
>>            Platform: All
>>          OS/Version: Linux
>>                Tree: Mainline
>>              Status: NEW
>>            Severity: normal
>>            Priority: P1
>>           Component: Network
>>          AssignedTo: [email-masked]
>>          ReportedBy: [email-masked]
>>          Regression: No
>>
>>
>> On my board, Marvell 88E1145 phy is attached to Freescale gianfar controller.
>> Backplane connection is detected by u-boot as 1000/Full fiber mode.
>>
>> The network works perfectly in u-boot (dhcp, tftp of large files, ntp). Upon
>> booting, kernel detects the link as 100/Full and no data can be exchanged over
>> the interface.
>>
>> As a quick fix, I tried setting .read_settings method of the 1145 driver to
>> marvell_read_status (instead of genphy_read_status). Now the link is correctly
>> detected as 1000/Full, but the data still can not be exchanged.
>>
>> I assume, there's a configuration bit missing on the kernel side, as there are
>> no such problems in u-boot.
>>

How does your u-boot configure the part?  Does it write any of the 
configuration registers, or is it just the default configuration set via 
the strapping pins?

In any event, you will probably have to read the configuration before 
the drivers/net/phy/marvel.c changes them.  Then compare that to what 
the driver is trying to set.  Then you will either have to override the 
configuration with the device tree "marvell,reg-init" property, or if 
you are not using the device tree, add a 88e1145 specific flag that you 
set when calling phy_connect().

David Daney