public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] sunxi: Fix gmac not working reliable on the Bananapi
@ 2014-09-28 18:13 Hans de Goede
       [not found] ` <20140928195818.GC4584@excalibur.cnev.de>
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hans de Goede @ 2014-09-28 18:13 UTC (permalink / raw)
  To: u-boot

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.

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
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-09-30 14:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [U-Boot] [linux-sunxi] " Siarhei Siamashka
     [not found]   ` <20140929181635.GA4587@excalibur.cnev.de>
2014-09-29 18:35     ` [U-Boot] [linux-sunxi] " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox