From patchwork Tue Sep 13 07:10:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 114440 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 2CB3DB71C7 for ; Tue, 13 Sep 2011 17:12:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B564328313; Tue, 13 Sep 2011 09:12:16 +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 Opw9yePrFuFq; Tue, 13 Sep 2011 09:12:16 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0A0A282B5; Tue, 13 Sep 2011 09:11:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 680BD28289 for ; Tue, 13 Sep 2011 09:10:55 +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 8zZ5wuZLxlAb for ; Tue, 13 Sep 2011 09:10:52 +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-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 8F95A28278 for ; Tue, 13 Sep 2011 09:10:39 +0200 (CEST) Received: by mail-bw0-f44.google.com with SMTP id q10so195011bka.3 for ; Tue, 13 Sep 2011 00:10:39 -0700 (PDT) Received: by 10.204.150.132 with SMTP id y4mr1072694bkv.359.1315897839325; Tue, 13 Sep 2011 00:10:39 -0700 (PDT) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id z7sm454187bkt.5.2011.09.13.00.10.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Sep 2011 00:10:38 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Tue, 13 Sep 2011 09:10:03 +0200 Message-Id: <1315897821-23049-9-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 In-Reply-To: <1315897821-23049-8-git-send-email-monstr@monstr.eu> References: <1315897821-23049-1-git-send-email-monstr@monstr.eu> <1315897821-23049-2-git-send-email-monstr@monstr.eu> <1315897821-23049-3-git-send-email-monstr@monstr.eu> <1315897821-23049-4-git-send-email-monstr@monstr.eu> <1315897821-23049-5-git-send-email-monstr@monstr.eu> <1315897821-23049-6-git-send-email-monstr@monstr.eu> <1315897821-23049-7-git-send-email-monstr@monstr.eu> <1315897821-23049-8-git-send-email-monstr@monstr.eu> Subject: [U-Boot] [PATCH 08/26] net: emaclite: Move RX/TX ping pong initialization to board 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 --- .../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 c4366c2..eca6ef9 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -347,7 +347,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; @@ -364,12 +365,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 5d78148..8b71011 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -94,7 +94,8 @@ int smc911x_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, 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.