Commit c1044a1e authored by Michal Simek's avatar Michal Simek Committed by Wolfgang Denk
Browse files

net: emaclite: Move RX/TX ping pong initialization to



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

Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent 9b94755a
...@@ -71,12 +71,18 @@ int fsl_init2 (void) { ...@@ -71,12 +71,18 @@ int fsl_init2 (void) {
int board_eth_init(bd_t *bis) int board_eth_init(bd_t *bis)
{ {
/* int ret = 0;
* 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.
*/
#ifdef CONFIG_XILINX_EMACLITE #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 #endif
return ret;
} }
...@@ -342,7 +342,8 @@ static int emaclite_recv(struct eth_device *dev) ...@@ -342,7 +342,8 @@ static int emaclite_recv(struct eth_device *dev)
} }
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 eth_device *dev;
struct xemaclite *emaclite; struct xemaclite *emaclite;
...@@ -359,12 +360,8 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr) ...@@ -359,12 +360,8 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr)
dev->priv = emaclite; dev->priv = emaclite;
#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG emaclite->txpp = txpp;
emaclite->txpp = 1; emaclite->rxpp = rxpp;
#endif
#ifdef CONFIG_XILINX_EMACLITE_RX_PING_PONG
emaclite->rxpp = 1;
#endif
sprintf(dev->name, "Xelite.%lx", base_addr); sprintf(dev->name, "Xelite.%lx", base_addr);
......
...@@ -97,7 +97,8 @@ int uli526x_initialize(bd_t *bis); ...@@ -97,7 +97,8 @@ int uli526x_initialize(bd_t *bis);
int armada100_fec_register(unsigned long base_addr); int armada100_fec_register(unsigned long base_addr);
int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr,
unsigned long dma_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() /* Boards with PCI network controllers can call this from their board_eth_init()
* function to initialize whatever's on board. * function to initialize whatever's on board.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment