]> git.sur5r.net Git - u-boot/commitdiff
net: emaclite: Move RX/TX ping pong initialization to
authorMichal Simek <monstr@monstr.eu>
Wed, 12 Oct 2011 23:23:22 +0000 (23:23 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 23 Oct 2011 21:32:44 +0000 (23:32 +0200)
Init RX/TX ping pong directly from board not in the driver.

Signed-off-by: Michal Simek <monstr@monstr.eu>
board/xilinx/microblaze-generic/microblaze-generic.c
drivers/net/xilinx_emaclite.c
include/netdev.h

index 183e4dc8b83fdebbaf5acd5379c343be204adbbc..9b2952f04eeeac01e4ef96cfe77e52f7d754f59c 100644 (file)
@@ -71,12 +71,18 @@ int fsl_init2 (void) {
 
 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;
 }
index ac3dae13ba77bdab3cf8d1d7fc1fd33142fbae5b..9791b9a534f12f3fb17ea44c581c29e6234d4ec8 100644 (file)
@@ -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 xemaclite *emaclite;
@@ -359,12 +360,8 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long 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.%lx", base_addr);
 
index a6246777fd67f87173d3e955a13f73ed35f5e7c7..54b52a51df27e01c16c0dd25d589508b17c11e9b 100644 (file)
@@ -97,7 +97,8 @@ int uli526x_initialize(bd_t *bis);
 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.