From patchwork Thu Oct 13 09:23:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 119394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7E92AB6F80 for ; Thu, 13 Oct 2011 20:23:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2FA6928C96; Thu, 13 Oct 2011 11:23:50 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xvf+cVE6N6Eu; Thu, 13 Oct 2011 11:23:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D30C28C87; Thu, 13 Oct 2011 11:23:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6092428C85 for ; Thu, 13 Oct 2011 11:23:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dWETEBOf2sQH for ; Thu, 13 Oct 2011 11:23:39 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ey0-f172.google.com (mail-ey0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id 57F7928C4B for ; Thu, 13 Oct 2011 11:23:29 +0200 (CEST) Received: by mail-ey0-f172.google.com with SMTP id 24so1806127eyg.3 for ; Thu, 13 Oct 2011 02:23:29 -0700 (PDT) Received: by 10.223.62.16 with SMTP id v16mr5012691fah.35.1318497809355; Thu, 13 Oct 2011 02:23:29 -0700 (PDT) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id x4sm19040104fad.1.2011.10.13.02.23.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Oct 2011 02:23:28 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Thu, 13 Oct 2011 11:23:22 +0200 Message-Id: <1318497803-21874-3-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 In-Reply-To: <1318497803-21874-2-git-send-email-monstr@monstr.eu> References: <1318497803-21874-1-git-send-email-monstr@monstr.eu> <1318497803-21874-2-git-send-email-monstr@monstr.eu> Subject: [U-Boot] [PATCH 2/3 v2] net: emaclite: Move RX/TX ping pong initialization to X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Init RX/TX ping pong directly from board not in the driver. Signed-off-by: Michal Simek --- v2: Fix merge confict - no function change --- .../xilinx/microblaze-generic/microblaze-generic.c | 18 ++++++++++++------ drivers/net/xilinx_emaclite.c | 11 ++++------- include/netdev.h | 3 ++- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 183e4dc..9b2952f 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -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; } diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index ac3dae1..9791b9a 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -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); diff --git a/include/netdev.h b/include/netdev.h index a624677..54b52a5 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -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.