From patchwork Tue Apr 23 10:46:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 238872 X-Patchwork-Delegate: monstr@monstr.eu 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 BB21F2C0170 for ; Tue, 23 Apr 2013 20:48:31 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0EBFF4A1A5; Tue, 23 Apr 2013 12:48:26 +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 tXCY6XBw7ySh; Tue, 23 Apr 2013 12:48:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1C874A1D5; Tue, 23 Apr 2013 12:47:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FF434A190 for ; Tue, 23 Apr 2013 12:47:24 +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 RQKsLRoaYyBu for ; Tue, 23 Apr 2013 12:47:23 +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-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by theia.denx.de (Postfix) with ESMTPS id E75D84A1A7 for ; Tue, 23 Apr 2013 12:47:03 +0200 (CEST) Received: by mail-wi0-f182.google.com with SMTP id m6so559187wiv.3 for ; Tue, 23 Apr 2013 03:47:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:content-type :x-gm-message-state; bh=jw9S/XFzur8DPMLAp3BfpWRJMdGrOT4uWKKc+cOlJ6U=; b=RrhhUE3FPlxHAey26Q1HefnPk8td1Ys3ORqgffOzs8lHQMqbOs1EA6t3edNW0h0Jwg Q/g4j+k+iae/ILH1FIK17JlDYMeacRLiHKQqdIjcuQwFrQP8lQmUTk53qSjlbkoyeIGQ veb3e23f+jPjOZTfJWBqWN9Rb4I86itOJzP3o24MvYW4ftNa1Ex0oC0ia805daJCSzTy Hnz6qZRhHsED/V1Tf4kb/GfA7XkXrxxMnKq6VNyfUvS4FU+kASyDi2bgEanzz5G1pFbH mS6v5WoipTn3f+ignL1ci+lEtq7ZLYOURo5UEqfnWI7GBmKCAk31MuCBMJV/LX0ZxvL9 iMdg== X-Received: by 10.194.3.14 with SMTP id 14mr55709413wjy.2.1366714023297; Tue, 23 Apr 2013 03:47:03 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id t7sm25450304wij.2.2013.04.23.03.47.00 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Tue, 23 Apr 2013 03:47:01 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, Joe Hershberger , Albert Aribaud , Tom Rini Date: Tue, 23 Apr 2013 12:46:09 +0200 Message-Id: <52ad86f28d8f704245ac1ed147bc6c403d4e6b0d.1366713845.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmezCtBQ/d5yf4oyWOai4Sp6EcDSj0579N5Fdc/WB9WMC5hwoamm94uq3afiiywHbzj/kay Cc: Peter Crosthwaite , Jagannadha Sutradharudu Teki Subject: [U-Boot] [PATCH v2 10/15] net: gem: Pass phy address to init X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 From: David Andrey Pass the PHY address to the driver init to allow parallel use of both interfaces Signed-off-by: David Andrey Signed-off-by: Michal Simek --- Changes in v2: None board/xilinx/zynq/board.c | 6 ++++-- drivers/net/zynq_gem.c | 8 ++------ include/configs/zynq.h | 1 + include/netdev.h | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) -- 1.8.2.1 diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 3af18f0..546adc8 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -42,10 +42,12 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_ZYNQ_GEM) # if defined(CONFIG_ZYNQ_GEM0) - ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR0); + ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR0, + CONFIG_ZYNQ_GEM_PHY_ADDR0); # endif # if defined(CONFIG_ZYNQ_GEM1) - ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR1); + ret |= zynq_gem_initialize(bis, ZYNQ_GEM_BASEADDR1, + CONFIG_ZYNQ_GEM_PHY_ADDR1); # endif #endif return ret; diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 2d717e9..316816d 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -427,7 +427,7 @@ static int zynq_gem_miiphy_write(const char *devname, uchar addr, return phywrite(dev, addr, reg, val); } -int zynq_gem_initialize(bd_t *bis, int base_addr) +int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr) { struct eth_device *dev; struct zynq_gem_priv *priv; @@ -443,11 +443,7 @@ int zynq_gem_initialize(bd_t *bis, int base_addr) } priv = dev->priv; -#ifdef CONFIG_PHY_ADDR - priv->phyaddr = CONFIG_PHY_ADDR; -#else - priv->phyaddr = -1; -#endif + priv->phyaddr = phy_addr; sprintf(dev->name, "Gem.%x", base_addr); diff --git a/include/configs/zynq.h b/include/configs/zynq.h index ebe1b1b..3b23354 100644 --- a/include/configs/zynq.h +++ b/include/configs/zynq.h @@ -54,6 +54,7 @@ #define CONFIG_NET_MULTI #define CONFIG_ZYNQ_GEM #define CONFIG_ZYNQ_GEM0 +#define CONFIG_ZYNQ_GEM_PHY_ADDR0 7 #if defined(CONFIG_ZYNQ_DCC) # define CONFIG_ARM_DCC diff --git a/include/netdev.h b/include/netdev.h index fd3e243..81117b1 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -104,7 +104,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, int txpp, int rxpp); int xilinx_ll_temac_eth_init(bd_t *bis, unsigned long base_addr, int flags, unsigned long ctrl_addr); -int zynq_gem_initialize(bd_t *bis, int base_addr); +int zynq_gem_initialize(bd_t *bis, int base_addr, int phy_addr); /* * As long as the Xilinx xps_ll_temac ethernet driver has not its own interface * exported by a public hader file, we need a global definition at this point.