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

login
register
mail settings
Submitter Michal Simek
Date Aug. 26, 2011, 12:47 p.m.
Message ID <1314362843-18214-8-git-send-email-monstr@monstr.eu>
Download mbox | patch
Permalink /patch/111775/
State Superseded
Delegated to: Michal Simek
Headers show

Comments

Michal Simek - Aug. 26, 2011, 12:47 p.m.
Init RX/TX ping pong directly in boards not in the driver.

Signed-off-by: Michal Simek <monstr@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(-)

Patch

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);