aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorHans de Goede2016-03-17 13:53:03 +0100
committerHans de Goede2016-03-23 22:04:13 +0100
commitfc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba (patch)
tree89e35fbbac61b66d4623f91f17d9707b8b8f37bb /board
parent948603d4d637a0e04a3214253b911cfc4ed11220 (diff)
sunxi: Fix gmac not working due to cpu_eth_init no longer being called
cpu_eth_init is no longer called for dm enabled eth drivers, this was causing the sunxi gmac eth controller to no longer work in u-boot. This commit fixes this by calling the clock, reset and pinmux setup function from s_init() and enabling the phy power pin (if any) from board_init(). The enabling of phy power cannot be done from s_init because it uses dm and dm is not ready yet at this point. Note that the mdelay is dropped as the phy gets enabled much earlier now, so it is no longer needed. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> Tested-by: Karsten Merker <merker@debian.org> Tested-by: Michael Haas <haas@computerlinguist.org>
Diffstat (limited to 'board')
-rw-r--r--board/sunxi/board.c5
-rw-r--r--board/sunxi/gmac.c14
2 files changed, 6 insertions, 13 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 80eae9cd48a..e16718f3087 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -90,6 +90,11 @@ int board_init(void)
if (ret)
return ret;
+#ifdef CONFIG_MACPWR
+ gpio_request(CONFIG_MACPWR, "macpwr");
+ gpio_direction_output(CONFIG_MACPWR, 1);
+#endif
+
/* Uses dm gpio code so do this here and not in i2c_init_board() */
return soft_i2c_board_init();
}
diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c
index 4e222d88c0d..69eb8ff2d92 100644
--- a/board/sunxi/gmac.c
+++ b/board/sunxi/gmac.c
@@ -6,7 +6,7 @@
#include <asm/arch/clock.h>
#include <asm/arch/gpio.h>
-int sunxi_gmac_initialize(bd_t *bis)
+void eth_init_board(void)
{
int pin;
struct sunxi_ccm_reg *const ccm =
@@ -79,16 +79,4 @@ int sunxi_gmac_initialize(bd_t *bis)
for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++)
sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_GMAC);
#endif
-
-#ifdef CONFIG_DM_ETH
- return 0;
-#else
-# ifdef CONFIG_RGMII
- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII);
-# elif defined CONFIG_GMII
- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII);
-# else
- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII);
-# endif
-#endif
}