[U-Boot] [PATCH 04/17] Moved initialization of RTL8139 Ethernet controller to board_eth_init()

Ben Warren biggerbadderben at gmail.com
Sun Aug 31 10:46:38 CEST 2008


Affected boards:
	hidden_dragon
	MPC8544DS
	MPC8610HPCN
	R2DPLUS
	TB0229

Removed initialization of the driver from net/eth.c

Signed-off-by: Ben Warren <biggerbadderben at gmail.com>
---
 board/freescale/mpc8544ds/mpc8544ds.c     |    8 ++++++++
 board/freescale/mpc8641hpcn/mpc8641hpcn.c |    8 ++++++++
 board/hidden_dragon/hidden_dragon.c       |    5 +++++
 board/r2dplus/r2dplus.c                   |    5 +++++
 board/tb0229/tb0229.c                     |    5 +++++
 include/netdev.h                          |    4 ++++
 net/eth.c                                 |    4 ----
 7 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c
index 4e976b7..e16fff2 100644
--- a/board/freescale/mpc8544ds/mpc8544ds.c
+++ b/board/freescale/mpc8544ds/mpc8544ds.c
@@ -32,6 +32,7 @@
 #include <miiphy.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <netdev.h>
 
 #include "../common/pixis.h"
 
@@ -507,3 +508,10 @@ ft_board_setup(void *blob, bd_t *bd)
 	}
 }
 #endif
+
+int board_eth_init(bd_t *bis)
+{
+	/* Initialize TSECs */
+	cpu_eth_init(bis);
+	return pci_eth_init(bis);
+}
diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index 1bb563e..97f7f49 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -29,6 +29,7 @@
 #include <asm/io.h>
 #include <libfdt.h>
 #include <fdt_support.h>
+#include <netdev.h>
 
 #include "../common/pixis.h"
 
@@ -379,3 +380,10 @@ get_board_sys_clk(ulong dummy)
 
 	return val;
 }
+
+int board_eth_init(bd_t *bis)
+{
+	/* Initialize TSECs */
+	cpu_eth_init(bis);
+	return pci_eth_init(bis);
+}
diff --git a/board/hidden_dragon/hidden_dragon.c b/board/hidden_dragon/hidden_dragon.c
index 5713a33..8cc727b 100644
--- a/board/hidden_dragon/hidden_dragon.c
+++ b/board/hidden_dragon/hidden_dragon.c
@@ -93,3 +93,8 @@ void pci_init_board(void)
 {
 	pci_mpc824x_init(&hose);
 }
+
+int board_eth_init(bd_t *bis)
+{
+	return pci_eth_init(bis);
+}
diff --git a/board/r2dplus/r2dplus.c b/board/r2dplus/r2dplus.c
index 8fb8ff6..b962dd1 100644
--- a/board/r2dplus/r2dplus.c
+++ b/board/r2dplus/r2dplus.c
@@ -76,3 +76,8 @@ void pci_init_board(void)
 {
 	pci_sh7751_init(&hose);
 }
+
+int board_eth_init(bd_t *bis)
+{
+	return pci_eth_init(bis);
+}
diff --git a/board/tb0229/tb0229.c b/board/tb0229/tb0229.c
index 921bd3a..2abb4a7 100644
--- a/board/tb0229/tb0229.c
+++ b/board/tb0229/tb0229.c
@@ -46,3 +46,8 @@ int checkboard (void)
 
 	return 0;
 }
+
+int board_eth_init(bd_t *bis)
+{
+	return pci_eth_init(bis);
+}
diff --git a/include/netdev.h b/include/netdev.h
index afd46ae..9a5a26c 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -46,6 +46,7 @@ int greth_initialize(bd_t *bis);
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int mcdmafec_initialize(bd_t *bis);
 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 tsec_initialize(bd_t *bis, int index, char *devname);
@@ -58,6 +59,9 @@ int uli526x_initialize(bd_t *bis);
 static int pci_eth_init(bd_t *bis)
 {
 	int num = 0;
+#if defined(CONFIG_RTL8139)
+	num += rtl8139_initialize(bis);
+#endif
 #if defined(CONFIG_RTL8169)
 	num += rtl8169_initialize(bis);
 #endif
diff --git a/net/eth.c b/net/eth.c
index 2639801..a3923bb 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -60,7 +60,6 @@ extern int ns8382x_initialize(bd_t*);
 extern int pcnet_initialize(bd_t*);
 extern int plb2800_eth_initialize(bd_t*);
 extern int ppc_4xx_eth_initialize(bd_t *);
-extern int rtl8139_initialize(bd_t*);
 extern int scc_initialize(bd_t*);
 extern int tsi108_eth_initialize(bd_t*);
 extern int npe_initialize(bd_t *);
@@ -246,9 +245,6 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_TSI108_ETH)
 	tsi108_eth_initialize(bis);
 #endif
-#if defined(CONFIG_RTL8139)
-	rtl8139_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