public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michael Haas <haas@computerlinguist.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add CONFIG_GMAC_TX_DELAY=4 for OlinuXino Lime2
Date: Sun, 20 Mar 2016 16:28:10 +0100	[thread overview]
Message-ID: <56EEC18A.1040807@computerlinguist.org> (raw)
In-Reply-To: <56EEA975.6060301@redhat.com>

On 03/20/2016 02:45 PM, Hans de Goede wrote:
> Hi,
>
> On 19-03-16 14:40, Michael Haas wrote:
>> On 03/19/2016 10:32 AM, Hans de Goede wrote:
>>> Hi,
>>>
>>> On 19-03-16 09:39, Fran?ois-David Collin wrote:
>>>> Hi,
>>>>
>>>> As I?m banging my head on this too, please allow me to provide some
>>>> details
>>>> I got two stable situations :
>>>> The Lime2 is connected directly to the Gbit interface of my laptop,
>>>> speed are OK:
>>>
>>> Michael Haas' work to debug this by looking at the phy registers
>>> seems to be the most promising so-far, the clk reg and axp209
>>> registers all seem to be identical between good and bad setups.
>>>
>>> Can you try to:
>>>
>>> 1) Stop the boot in u-boot (press a key on the serial console)
>>> 2) Bring up the network, e.g. type "dhcp" then ctrl+c when it tries
>>> to tftp
>>> 3) Do: "mii read 1 0x11" in u-boot and record the output ?
>>>
>>> Regards,
>>>
>>> Hans
>>
>> Hi all,
>>
>> i have diffed and cross-compared logs of several working and broken tftp
>> downloads. The most significant
>> difference between working and broken was registers 0xa, 0x1c and 0x2a
>> in the first MII page.
>>
>> These registers started making sense when I looked at the datasheet for
>> the RTL8211CL. Previously, I was looking at the RTL8211E.
>>
>> 0xA was set to 7800 for working runs and 3800 for broken runs. The
>> difference is bit 14 in the GBSR: 'MASTER/SLAVE Configuration
>> Resolution'. In the broken runs, the autonegotation configured the
>> OlinuXino to 'slave'. I have whipped up a quick patch which disable the
>> master/slave part of the autonegotiation and force master mode.
>>
>> The patch itself is quite terrible as it's forcing the master mode bits
>> for every phy, not just for the RTL8211CL. It's good enough for testing,
>> however, and I seem to be getting consistent download speeds. There are
>> occasional hangs when booting the downloaded kernel, but that is
>> probably a different issue.
>>
>> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
>> index 51b5746..484b2be 100644
>> --- a/drivers/net/phy/phy.c
>> +++ b/drivers/net/phy/phy.c
>> @@ -170,6 +170,7 @@ int genphy_restart_aneg(struct phy_device *phydev)
>>   int genphy_config_aneg(struct phy_device *phydev)
>>   {
>>          int result;
>> +       phy_write(phydev, MDIO_DEVAD_NONE, 0x09, 0x1A00);
>>
>>          if (AUTONEG_ENABLE != phydev->autoneg)
>>                  return genphy_setup_forced(phydev);
>>
>> Please test this change and let me know. If it's successful, I will
>> submit a proper version.
>
> Good catch, I wonder why we need this. I believe that the proper version
> should probably be wrapped in a #ifdef CONFIG_REALTEK_PHY_FORCE_MASTER
> and then add a Kconfig option for this (and enable it in the lime2
> defconfig), forcing this on all rtl8211cl phy-s seems wrong, unless
> someone can dig up an errata from realtek which said we should.

I was going to add that in realtek.c, not in phy.c - as soon as I figure
out which section there is applicable. I have started a new thread
asking about that.
>
> Are any other sunxi boards impacted by the same problem that you know ?
>

No, I don't know of any other boards, but I have not looked very hard :)

Michael

  reply	other threads:[~2016-03-20 15:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15  5:41 [U-Boot] [PATCH] Add CONFIG_GMAC_TX_DELAY=4 for OlinuXino Lime2 Michael Haas
     [not found] ` <20160315180914.GA1878@excalibur.cnev.de>
2016-03-15 20:41   ` Tom Rini
2016-03-16  8:32   ` Michael Haas
2016-03-16  9:29     ` Hans de Goede
2016-03-16 10:53       ` Hans de Goede
     [not found]       ` <20160316203642.GC1817@excalibur.cnev.de>
2016-03-17  5:28         ` Michael Haas
2016-03-17 10:52           ` Hans de Goede
2016-03-17 21:53             ` Michael Haas
2016-03-18  7:41               ` Hans de Goede
     [not found]                 ` <20160318190220.GC1815@excalibur.cnev.de>
2016-03-18 19:06                   ` Michael Haas
2016-03-20  8:36                     ` Michael Haas
2016-03-20 10:05                       ` François-David Collin
2016-03-18 20:32             ` Michael Haas
2016-03-18 21:53             ` Michael Haas
2016-03-19  8:39               ` François-David Collin
2016-03-19  9:32                 ` Hans de Goede
2016-03-19  9:35                   ` Michael Haas
2016-03-19  9:45                   ` Michael Haas
2016-03-19 13:40                   ` Michael Haas
2016-03-19 14:35                     ` François-David Collin
2016-03-20 13:45                     ` Hans de Goede
2016-03-20 15:28                       ` Michael Haas [this message]
2016-03-20 18:51                         ` Hans de Goede
     [not found]                           ` <20160321154714.GA4751@excalibur.cnev.de>
2016-03-21 18:57                             ` Michael Haas
2016-03-21 20:59                               ` Hans de Goede
2016-03-21 21:01                                 ` Hans de Goede
2016-03-21 21:47                                   ` Michael Haas
2016-03-21 22:00                                     ` Hans de Goede
2016-03-22  5:12                                       ` Michael Haas
2016-03-22  8:46                                 ` Peter Korsgaard
2016-03-22  8:57                                   ` Hans de Goede
2016-03-22  9:01                                     ` Michael Haas
2016-03-22  9:50                                     ` Peter Korsgaard
     [not found]                             ` <20160321173000.GD4751@excalibur.cnev.de>
2016-03-21 20:56                               ` Hans de Goede
  -- strict thread matches above, loose matches on Subject: below --
2016-03-18 17:33 François-David Collin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56EEC18A.1040807@computerlinguist.org \
    --to=haas@computerlinguist.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox