From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [linux-sunxi] [PATCH] sunxi: Fix gmac not working reliable on the Bananapi
Date: Mon, 29 Sep 2014 09:13:37 +0300 [thread overview]
Message-ID: <20140929091337.34888c61@i7> (raw)
In-Reply-To: <1411928001-3455-1-git-send-email-hdegoede@redhat.com>
On Sun, 28 Sep 2014 20:13:21 +0200
Hans de Goede <hdegoede@redhat.com> wrote:
> In order for the gmac nic to work reliable on the Bananapi, we need to poke
> these 2 undocumented bits in the gmac clk register. Since these are
> undocumented, this commit only sets these bits on the Bananapi for now.
>
> I'll contact Allwinner to try and get these bits documented, once they
> are documented we can hopefully replace this hack with a better patch.
Could you please provide a bit more details in the commit message?
What are the symptoms of the problem? How did you come to the idea
to poke these bits? Does the GMAC driver in the linux kernel need a
similar fix/workaround? And if you apply it in the linux kernel, does
it provide any visible changes in performance or anything else?
Also as mentioned in another e-mail
http://lists.denx.de/pipermail/u-boot/2014-September/190096.html
u-boot configures the "912MHz @1.4V" CPU clock frequency/voltage
setup for sun7i hardware. And according to the information from Tony
Zhang, this is supposed to be unreliable for the Banana Pi. So what
happens to this GMAC bug if you just increase the dcdc2 voltage in
u-boot (or reduce the CPU clock frequency)?
I remember that some users suffered from GMAC problems, which turned
out to be caused by just overclocking the CPU to 1.2GHz (a "helful"
SD card image creator decided that the users would like to enjoy
better performance):
http://www.cubieforums.com/index.php/topic,2590.0.html
So it looks like GMAC might be one of those canaries, which die first
on wrong CPU clock frequency/voltage settings.
> Reported-by: Karsten Merker <merker@debian.org>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> board/sunxi/gmac.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
> index e7ff952..f58c963 100644
> --- a/board/sunxi/gmac.c
> +++ b/board/sunxi/gmac.c
> @@ -24,6 +24,15 @@ int sunxi_gmac_initialize(bd_t *bis)
> CCM_GMAC_CTRL_GPIT_MII);
> #endif
>
> + /*
> + * HdG: this is necessary to get GMAC to work reliable on the
> + * Bananapi. We don't know what these undocumented bits do, so this
> + * is a Bananapi specific hack for now.
> + */
> +#ifdef CONFIG_BANANAPI
> + setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
> +#endif
> +
> /* Configure pin mux settings for GMAC */
> for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {
> #ifdef CONFIG_RGMII
--
Best regards,
Siarhei Siamashka
next prev parent reply other threads:[~2014-09-29 6:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-28 18:13 [U-Boot] [PATCH] sunxi: Fix gmac not working reliable on the Bananapi Hans de Goede
[not found] ` <20140928195818.GC4584@excalibur.cnev.de>
2014-09-28 20:54 ` [U-Boot] [linux-sunxi] " Zoltan HERPAI
2014-09-29 6:13 ` Siarhei Siamashka [this message]
[not found] ` <20140929181635.GA4587@excalibur.cnev.de>
2014-09-29 18:35 ` jonsmirl at gmail.com
2014-09-30 12:02 ` Hans de Goede
2014-09-30 12:26 ` jonsmirl at gmail.com
2014-09-30 14:04 ` [U-Boot] [linux-sunxi] " Koen Kooi
2014-09-29 21:37 ` [U-Boot] [linux-sunxi] " Siarhei Siamashka
2014-09-30 7:06 ` [U-Boot] " Ian Campbell
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=20140929091337.34888c61@i7 \
--to=siarhei.siamashka@gmail.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