summaryrefslogtreecommitdiff
path: root/board/sunxi/board.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-03-17 13:53:03 +0100
committerKlaus Goger <klaus.goger@theobroma-systems.com>2016-09-18 12:38:56 +0200
commitc925ff29540e234ff86448eb33bee38ae16d0bc1 (patch)
tree9e59533af2c4e49514f181516d846f12cd530c25 /board/sunxi/board.c
parentcccf8cead87dd8d0f6e111c301a04226c66a848f (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/sunxi/board.c')
-rw-r--r--board/sunxi/board.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 80eae9cd48..e16718f308 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();
}