Init RX/TX ping pong directly from board not in the driver.
Signed-off-by: Michal Simek <monstr@monstr.eu>
int board_eth_init(bd_t *bis)
{
- /*
- * This board either has PCI NICs or uses the CPU's TSECs
- * pci_eth_init() will return 0 if no NICs found, so in that case
- * returning -1 will force cpu_eth_init() to be called.
- */
+ int ret = 0;
#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
+ ret |= xilinx_emaclite_initialize(bis, XILINX_EMACLITE_BASEADDR,
+ txpp, rxpp);
#endif
+ return ret;
}
}
-int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr)
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
+ int txpp, int rxpp)
{
struct eth_device *dev;
struct xemaclite *emaclite;
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.%lx", base_addr);
int armada100_fec_register(unsigned long base_addr);
int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
unsigned long dma_addr);
-int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr);
+int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
+ int txpp, int rxpp);
/* Boards with PCI network controllers can call this from their board_eth_init()
* function to initialize whatever's on board.