[U-Boot] [PATCH v2 05/17] Moved initialization of TSI108 Ethernet controller to board_eth_init()

Ben Warren biggerbadderben at gmail.com
Mon Sep 1 07:57:30 CEST 2008


Affected boards:
	mpc7448hpc2

Removed initialization of the driver from net/eth.c

Signed-off-by: Ben Warren <biggerbadderben at gmail.com>
---
 board/freescale/mpc7448hpc2/mpc7448hpc2.c |   10 ++++++++++
 drivers/net/tsi108_eth.c                  |    1 +
 include/netdev.h                          |    1 +
 net/eth.c                                 |    4 ----
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/board/freescale/mpc7448hpc2/mpc7448hpc2.c b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
index 6f74c31..cfdbed5 100644
--- a/board/freescale/mpc7448hpc2/mpc7448hpc2.c
+++ b/board/freescale/mpc7448hpc2/mpc7448hpc2.c
@@ -32,6 +32,7 @@
 #include <common.h>
 #include <74xx_7xx.h>
 #include <fdt_support.h>
+#include <netdev.h>
 
 #undef	DEBUG
 
@@ -92,3 +93,12 @@ ft_board_setup(void *blob, bd_t *bd)
 	fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
 #endif
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#if defined(CONFIG_TSI108_ETH)
+	rc = tsi108_eth_initialize(bis);
+#endif
+	return rc;
+}
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index 2534097..50fa765 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -34,6 +34,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/cache.h>
 
 #ifdef DEBUG
diff --git a/include/netdev.h b/include/netdev.h
index b333755..5f6b38f 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -49,6 +49,7 @@ int mcffec_initialize(bd_t *bis);
 int rtl8139_initialize(bd_t *bis);
 int rtl8169_initialize(bd_t *bis);
 int skge_initialize(bd_t *bis);
+int tsi108_eth_initialize(bd_t *bis);
 int uli526x_initialize(bd_t *bis);
 
 /* Boards with PCI network controllers can call this from their board_eth_init()
diff --git a/net/eth.c b/net/eth.c
index 092d426..65ebf2d 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -61,7 +61,6 @@ extern int pcnet_initialize(bd_t*);
 extern int plb2800_eth_initialize(bd_t*);
 extern int ppc_4xx_eth_initialize(bd_t *);
 extern int scc_initialize(bd_t*);
-extern int tsi108_eth_initialize(bd_t*);
 extern int npe_initialize(bd_t *);
 extern int uec_initialize(int);
 
@@ -242,9 +241,6 @@ int eth_initialize(bd_t *bis)
 #ifdef CONFIG_NS8382X
 	ns8382x_initialize(bis);
 #endif
-#if defined(CONFIG_TSI108_ETH)
-	tsi108_eth_initialize(bis);
-#endif
 	if (!eth_devices) {
 		puts ("No ethernet found.\n");
 		show_boot_progress (-64);
-- 
1.5.4.3



More information about the U-Boot mailing list