diff options
author | Hans de Goede | 2016-03-17 13:53:03 +0100 |
---|---|---|
committer | Hans de Goede | 2016-03-23 22:04:13 +0100 |
commit | fc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba (patch) | |
tree | 89e35fbbac61b66d4623f91f17d9707b8b8f37bb /arch/arm | |
parent | 948603d4d637a0e04a3214253b911cfc4ed11220 (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 'arch/arm')
-rw-r--r-- | arch/arm/cpu/armv7/sunxi/board.c | 28 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-sunxi/sys_proto.h | 6 |
2 files changed, 6 insertions, 28 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c index e80785ba566..7653148c67e 100644 --- a/arch/arm/cpu/armv7/sunxi/board.c +++ b/arch/arm/cpu/armv7/sunxi/board.c @@ -152,6 +152,7 @@ void s_init(void) timer_init(); gpio_init(); i2c_init_board(); + eth_init_board(); } #ifdef CONFIG_SPL_BUILD @@ -259,30 +260,3 @@ void enable_caches(void) dcache_enable(); } #endif - -#ifdef CONFIG_CMD_NET -/* - * Initializes on-chip ethernet controllers. - * to override, implement board_eth_init() - */ -int cpu_eth_init(bd_t *bis) -{ - __maybe_unused int rc; - -#ifdef CONFIG_MACPWR - gpio_request(CONFIG_MACPWR, "macpwr"); - gpio_direction_output(CONFIG_MACPWR, 1); - mdelay(200); -#endif - -#ifdef CONFIG_SUNXI_GMAC - rc = sunxi_gmac_initialize(bis); - if (rc < 0) { - printf("sunxi: failed to initialize gmac\n"); - return rc; - } -#endif - - return 0; -} -#endif diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h b/arch/arm/include/asm/arch-sunxi/sys_proto.h index 9df37445210..a373319a2b4 100644 --- a/arch/arm/include/asm/arch-sunxi/sys_proto.h +++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h @@ -24,6 +24,10 @@ void sdelay(unsigned long); void return_to_fel(uint32_t lr, uint32_t sp); /* Board / SoC level designware gmac init */ -int sunxi_gmac_initialize(bd_t *bis); +#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC +void eth_init_board(void); +#else +static inline void eth_init_board(void) {} +#endif #endif |