[U-Boot] [PATCH 3/3][ppc4xx] Moved initialization of PPC4xx EMAC to cpu_eth_init()

Ben Warren biggerbadderben at gmail.com
Tue Nov 4 08:10:37 CET 2008


Removed initialization of the driver from net/eth.c

Signed-off-by: Ben Warren <biggerbadderben at gmail.com>
---
Rebased against 4xx tree.  Please test and ACK/NAK.

 cpu/ppc4xx/cpu.c |   14 ++++++++++++++
 include/netdev.h |    1 +
 net/eth.c        |    4 ----
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/cpu/ppc4xx/cpu.c b/cpu/ppc4xx/cpu.c
index a676b30..1f0b56c 100644
--- a/cpu/ppc4xx/cpu.c
+++ b/cpu/ppc4xx/cpu.c
@@ -36,6 +36,7 @@
 #include <command.h>
 #include <asm/cache.h>
 #include <ppc4xx.h>
+#include <netdev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -693,3 +694,16 @@ void reset_4xx_watchdog(void)
 	mtspr(tsr, 0x40000000);
 }
 #endif	/* CONFIG_WATCHDOG */
+
+/*
+ * Initializes on-chip ethernet controllers.
+ * to override, implement board_eth_init()
+ */
+int cpu_eth_init(bd_t *bis)
+{
+#if defined(CONFIG_PPC4xx_EMAC)
+	ppc_4xx_eth_initialize(bis);
+#endif
+	return 0;
+}
+
diff --git a/include/netdev.h b/include/netdev.h
index 87d578c..620f9d6 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -58,6 +58,7 @@ int natsemi_initialize(bd_t *bis);
 int ns8382x_initialize(bd_t *bis);
 int pcnet_initialize(bd_t *bis);
 int plb2800_eth_initialize(bd_t *bis);
+int ppc_4xx_eth_initialize (bd_t *bis);
 int rtl8139_initialize(bd_t *bis);
 int rtl8169_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
diff --git a/net/eth.c b/net/eth.c
index a354e76..c4534d0 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -44,7 +44,6 @@ extern int fec_initialize(bd_t*);
 extern int mpc8220_fec_initialize(bd_t*);
 extern int mv6436x_eth_initialize(bd_t *);
 extern int mv6446x_eth_initialize(bd_t *);
-extern int ppc_4xx_eth_initialize(bd_t *);
 extern int scc_initialize(bd_t*);
 extern int npe_initialize(bd_t *);
 extern int uec_initialize(int);
@@ -159,9 +158,6 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_DB64460) || defined(CONFIG_P3Mx)
 	mv6446x_eth_initialize(bis);
 #endif
-#if defined(CONFIG_PPC4xx_EMAC)
-	ppc_4xx_eth_initialize(bis);
-#endif
 #ifdef SCC_ENET
 	scc_initialize(bis);
 #endif
-- 
1.5.4.3



More information about the U-Boot mailing list