From patchwork Sun May 26 18:37:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Silbe X-Patchwork-Id: 246466 X-Patchwork-Delegate: prafulla@marvell.com 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 EB58E2C0087 for ; Mon, 27 May 2013 06:51:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7AF8D4A029; Sun, 26 May 2013 22:51:14 +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 QGgD8J0JF-Ef; Sun, 26 May 2013 22:51:14 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0DFB74A053; Sun, 26 May 2013 22:49:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 034324A026 for ; Sun, 26 May 2013 20:42:57 +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 Iv8AKmJLObO2 for ; Sun, 26 May 2013 20:42:56 +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 b.mx.chost.de (setoy2.chost.de [87.106.8.89]) by theia.denx.de (Postfix) with ESMTPS id 943974A029 for ; Sun, 26 May 2013 20:42:48 +0200 (CEST) Received: from sshgate.chost.de (sshgate.chost.de [::ffff:87.106.80.19]) by b.mx.chost.de with esmtp; Sun, 26 May 2013 20:37:43 +0200 id 0EF4FC66.51A25677.000003F7 Received: by sshgate.chost.de (sSMTP sendmail emulation); Sun, 26 May 2013 20:37:42 +0200 Received: (nullmailer pid 20144 invoked by uid 8193); Sun, 26 May 2013 18:37:32 -0000 From: Sascha Silbe To: u-boot@lists.denx.de Date: Sun, 26 May 2013 20:37:02 +0200 Message-Id: <1369593423-19763-10-git-send-email-t-uboot@infra-silbe.de> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1369593423-19763-1-git-send-email-t-uboot@infra-silbe.de> References: <1369593423-19763-1-git-send-email-t-uboot@infra-silbe.de> X-Mailman-Approved-At: Sun, 26 May 2013 22:49:45 +0200 Cc: Rabeeh Khoury , Luka Perkov , Daniel Stodden , Andy Fleming Subject: [U-Boot] [PATCH v4 09/10] NET: mvgbe: add support for Dove 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: Sebastian Hesselbarth Marvell Dove also uses mvgbe as ethernet driver, therefore add support for Dove to reuse the current driver. Signed-off-by: Sebastian Hesselbarth Signed-off-by: Sascha Silbe --- v3->v4: removed EBAR_DRAM_CS* for Dove drivers/net/mvgbe.c | 9 ++++++++- drivers/net/mvgbe.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index 7f0ddf5..57692e3 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -43,6 +43,8 @@ #include #elif defined(CONFIG_ORION5X) #include +#elif defined(CONFIG_DOVE) +#include #endif #include "mvgbe.h" @@ -286,7 +288,11 @@ static void set_dram_access(struct mvgbe_registers *regs) else win_param.enable = 1; /* Enable the access */ - /* Enable DRAM bank */ +#ifdef CONFIG_DOVE + /* Choose DRAM as target */ + win_param.attrib = 0; +#else + /* Choose one DRAM bank (chip select line) as target */ switch (i) { case 0: win_param.attrib = EBAR_DRAM_CS0; @@ -306,6 +312,7 @@ static void set_dram_access(struct mvgbe_registers *regs) win_param.attrib = 0; break; } +#endif /* Set the access control for address window(EPAPR) RD/WR */ set_access_control(regs, &win_param); } diff --git a/drivers/net/mvgbe.h b/drivers/net/mvgbe.h index d8a5429..22b571e 100644 --- a/drivers/net/mvgbe.h +++ b/drivers/net/mvgbe.h @@ -308,10 +308,12 @@ #define EBAR_TARGET_GUNIT 0x00000007 /* Window attrib */ +#if !defined(CONFIG_DOVE) #define EBAR_DRAM_CS0 0x00000E00 #define EBAR_DRAM_CS1 0x00000D00 #define EBAR_DRAM_CS2 0x00000B00 #define EBAR_DRAM_CS3 0x00000700 +#endif /* DRAM Target interface */ #define EBAR_DRAM_NO_CACHE_COHERENCY 0x00000000