public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add CONFIG_GMAC_TX_DELAY=4 for OlinuXino Lime2
Date: Mon, 21 Mar 2016 22:01:46 +0100	[thread overview]
Message-ID: <56F0613A.2080400@redhat.com> (raw)
In-Reply-To: <56F060A6.1080002@redhat.com>

Hi,

On 21-03-16 21:59, Hans de Goede wrote:
> Hi,
>
> On 21-03-16 19:57, Michael Haas wrote:
>> On 03/21/2016 04:47 PM, Karsten Merker wrote:
>>>>>> 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 :)
>>> At least the Olimex A20-SOM-EVB (which uses the same RTL8211CL
>>> PHY) has the same issue and forcing master mode helps there as
>>> well.  With the above change added on top of v2016.01, I can
>>> successfully boot via tftp on a gigabit link on both the Lime2
>>> and the A20-SOM-EVB, which was impossible before.
>> Great news!
>>
>>>
>>> Some quick iperf measurements on the A20-SOM-EVB with the patch
>>> applied show network throughput comparable to what I get with
>>> other A20-based systems.
>>>
>>> All my other A20-based boards - which don't have problems on
>>> gigabit links - use an RTL8211E instead of the RTL8211CL.  I had
>>> been looking into the source of the gigabit problems on the
>>> A20-SOM-EVB for a while already and talked with Olimex about
>>> them.  Olimex has also been trying to debug the issue and told me
>>> that the problem doesn't seem to occur on all boards, and that
>>> during their tests different RTL8211CL chips (i.e. same chip
>>> model, but with different production date codes) behaved
>>> differently.  This would fit into the hypothesis that there might
>>> be some kind of erratum in at least some series of the RTL8211CL.
>>>
>>>
>>
>> So, Olimex knows about these issues? :/ Perhaps you can CC your contact
>> there once we have a final patch.
>>
>> By the way, I just searched the web for "rtl8211c master mode" and found
>> this [0]:
>>
>> ---%--
>>
>> // The EVK board with RTL8211C requires this sequence per information
>>     // Realtek.
>>     // 1. Register 0x1F, write 0005 -> Page 5
>>     // 2. Register 0x0C, write 0000
>>     // 3. Register 0x01, change bit [7]  to 1
>>     // 4. Register 0x1F, write 0000 -> Page 0
>>
>>     // However, please note that it is not recommended to use the RTL8211CL 125MHz clock output because
>>     // it is not stable when link at Slave mode. If you need the clock output,
>>     // please consider using RTL8211E instead.
>>     // 5. Force manual "master" mode in auto-negotiation.
>>
>>     #if defined(CONFIG_DIGICOLOR_MAINBOARD_THUNDERBOLT_REV1)
>>     if (!RTL8211C_hack) {
>>       // Enable 125 Mhz clock output
>>       gmac_mdio_write(ei, phy_id, 0x1f, 5);
>>       gmac_mdio_write(ei, phy_id, 0x0c, 0);
>>          gmac_mdio_read (ei, phy_id, 0x01, &data);
>>       data |= 0x80;
>>       gmac_mdio_write(ei, phy_id, 0x01, data);
>>       gmac_mdio_write(ei, phy_id, 0x1f, 0);
>>       // Set Manual MASTER Mode
>>          gmac_mdio_read (ei, phy_id, 0x09, &data);
>>       data |= 0x1800;
>>       gmac_mdio_write(ei, phy_id, 0x09, data);
>>       // Restart Autonegotiation
>>          gmac_mdio_read (ei, phy_id, 0x00, &data);
>>       data |= 0x0200;
>>       gmac_mdio_write(ei, phy_id, 0x00, data);
>>       // All done now.
>>       RTL8211C_hack = 1;
>>     }
>>     #endif
>>
>> %---
>>
>>
>> I guess we are not the first to find this out the hard way. If the issue
>> is related to an internal clock of the RTL8211C, is there perhaps an
>> external clock we can use?
>
> Oh good catch, so I believe that we should submit a patch to the u-boot
> realtek phy driver which:
>
> 1) Adds a seperate init function for the RTL8211C
> 2) In that function set the force master mode bit and then
>     call the init function currently used for RTL8211C and others,
>     this assumes that the more generic init function will not reset
>     the force master mode bit.
>
> Good work! I believe we're quite close to a fix now :)

Hmm, I just realized / read that RTL8211B and RTL8211C have the same
phyid, maybe there is some other reg which we can use to differentiate
between them ?

Otherwise we are back to having a #ifdef for the fix ...

Regards,

Hans

  reply	other threads:[~2016-03-21 21:01 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
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 [this message]
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=56F0613A.2080400@redhat.com \
    --to=hdegoede@redhat.com \
    --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