summaryrefslogtreecommitdiff
path: root/board/sunxi
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-01-25 12:10:48 +0100
committerHans de Goede <hdegoede@redhat.com>2015-02-02 13:55:14 +0100
commitc13f60d92a1c31c131a53ff8e994e4c8eebb8311 (patch)
tree685c5822870b576ab2ccab53a02f572e8a4a873a /board/sunxi
parente1a0888ed224cc4c4e019a37b7b0331b11745e4d (diff)
sunxi: Add a GMAC Transmit Clock Delay Chain Kconfig option
And use this to set the GMAC Transmit Clock Delay Chain value on Banana boards, rather then keying of CONFIG_TARGET_FOO. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'board/sunxi')
-rw-r--r--board/sunxi/Kconfig6
-rw-r--r--board/sunxi/gmac.c11
2 files changed, 8 insertions, 9 deletions
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index f48b8c05f8..15e3d463fc 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -380,4 +380,10 @@ config USB_KEYBOARD
Say Y here to add support for using a USB keyboard (typically used
in combination with a graphical console).
+config GMAC_TX_DELAY
+ int "GMAC Transmit Clock Delay Chain"
+ default 0
+ ---help---
+ Set the GMAC Transmit Clock Delay Chain value.
+
endif
diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
index 4e4615e12f..8849132627 100644
--- a/board/sunxi/gmac.c
+++ b/board/sunxi/gmac.c
@@ -24,20 +24,13 @@ int sunxi_gmac_initialize(bd_t *bis)
#ifdef CONFIG_RGMII
setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
CCM_GMAC_CTRL_GPIT_RGMII);
+ setbits_le32(&ccm->gmac_clk_cfg,
+ CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY));
#else
setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_SRC_MII |
CCM_GMAC_CTRL_GPIT_MII);
#endif
- /*
- * In order for the gmac nic to work reliable on the Bananapi, we
- * need to set bits 10-12 GTXDC "GMAC Transmit Clock Delay Chain"
- * of the GMAC clk register to 3.
- */
-#if defined CONFIG_TARGET_BANANAPI || defined CONFIG_TARGET_BANANAPRO
- setbits_le32(&ccm->gmac_clk_cfg, 0x3 << 10);
-#endif
-
#ifndef CONFIG_MACH_SUN6I
/* Configure pin mux settings for GMAC */
for (pin = SUNXI_GPA(0); pin <= SUNXI_GPA(16); pin++) {