[U-Boot] [PATCH 8/8] net: emaclite: Move RX/TX ping pong initialization to board

Michal Simek monstr at monstr.eu
Fri Aug 26 14:47:23 CEST 2011


Init RX/TX ping pong directly in boards not in the driver.

Signed-off-by: Michal Simek <monstr at monstr.eu>
---
 .../xilinx/microblaze-generic/microblaze-generic.c |   11 ++++++++++-
 drivers/net/xilinx_emaclite.c                      |   10 +++-------
 include/netdev.h                                   |    2 +-
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c
index 183e4dc..1a6e568 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -77,6 +77,15 @@ int board_eth_init(bd_t *bis)
 	 * returning -1 will force cpu_eth_init() to be called.
 	 */
 #ifdef CONFIG_XILINX_EMACLITE
-	return xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR);
+	u32 txpp = 0;
+	u32 rxpp = 0;
+# ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
+	txpp = 1;
+# endif
+# ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
+	rxpp = 1;
+# endif
+	return xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR,
+			txpp, rxpp);
 #endif
 }
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index e0b6ce5..cbf82d9 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -346,7 +346,7 @@ static int emaclite_recv(struct eth_device *dev)
 
 }
 
-int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
+int xilinx_emaclite_initialize (bd_t *bis, int base_addr, int txpp, int rxpp)
 {
 	struct eth_device *dev;
 	struct xemaclite *emaclite;
@@ -363,12 +363,8 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
 
 	dev->priv = emaclite;
 
-#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
-	emaclite->txpp = 1;
-#endif
-#ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
-	emaclite->rxpp = 1;
-#endif
+	emaclite->txpp = txpp;
+	emaclite->rxpp = rxpp;
 
 	sprintf(dev->name, "Xelite.%x", base_addr);
 
diff --git a/include/netdev.h b/include/netdev.h
index 6f0a971..5abafbc 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -90,7 +90,7 @@ int smc91111_initialize(u8 dev_num, int base_addr);
 int tsi108_eth_initialize(bd_t *bis);
 int uec_standard_init(bd_t *bis);
 int uli526x_initialize(bd_t *bis);
-int xilinx_emaclite_initialize (bd_t *bis, int base_addr);
+int xilinx_emaclite_initialize (bd_t *bis, int base_addr, int txpp, int rxpp);
 int sh_eth_initialize(bd_t *bis);
 int dm9000_initialize(bd_t *bis);
 int fecmxc_initialize(bd_t *bis);
-- 
1.5.5.6



More information about the U-Boot mailing list