summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2014-05-05 11:52:28 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-05-25 16:25:12 +0200
commit5835823da3a357468bc90c2b74bad3193555b918 (patch)
tree64be8d3ae9e0dd8e0d69935130ddda0e422e4c96 /arch/arm
parent7d20d7eb1334706546708acd966c0c7f807726e8 (diff)
sunxi: add gmac Ethernet support
Add support for the GMAC Ethernet controller on Allwinner A20 (sun7i) processors. Enable for the Cubietruck. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Jens Kuske <jenskuske@gmail.com> Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/armv7/sunxi/board.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index b5c0cb7487..49c94489ee 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -11,6 +11,8 @@
*/
#include <common.h>
+#include <netdev.h>
+#include <miiphy.h>
#include <serial.h>
#ifdef CONFIG_SPL_BUILD
#include <spl.h>
@@ -86,3 +88,24 @@ 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)
+{
+ int rc;
+
+#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