From patchwork Wed May 16 01:49:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 159486 X-Patchwork-Delegate: joe.hershberger@gmail.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 84023B6FC3 for ; Wed, 16 May 2012 11:43:06 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AFDB728091; Wed, 16 May 2012 03:43:04 +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 bnGtvqJBazPp; Wed, 16 May 2012 03:43:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE1882809C; Wed, 16 May 2012 03:43:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5599F2809C for ; Wed, 16 May 2012 03:43:00 +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 PG0ADieN+E8k for ; Wed, 16 May 2012 03:42:59 +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-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTPS id 6351C28091 for ; Wed, 16 May 2012 03:42:57 +0200 (CEST) Received: by pbcwy7 with SMTP id wy7so356764pbc.3 for ; Tue, 15 May 2012 18:42:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=23Y9C2cqZ1IcjdSnG6TukdZ6boxynx5XGJBkOMfeKGc=; b=H81Dr8pttil/jLU8XcYLKggbDtYoQkxN4P4Iep3eqb61KyRQdjnFAPCNJLlnFcOWnA mDztpNd1P7KW9oOrZLrvY04AuLKzEhERG3syVklFobSwrS8kqNuTmrQ6QNRKKj2DEilv HmBlgTm80HsB0Hvu21wI0GfnvYEFuePWoVVjMPMVoMWLiTfW5ayvo0ZNIkS+5fGqXx9M jCQRhR5SmD1GPcmjvNQVOTtIZ+y9HwwNXg9f/no3VkQ76b8Z/IF2+LJDi4Gt4Q0gtmFr grGr+pZV7WBmd1LRLabSN3slK1hb1tAKg+Ne3qkLmIZi4ifa0+Z6NwnQ0zdWKjqNUllu c/dA== Received: by 10.68.223.67 with SMTP id qs3mr11162012pbc.142.1337132575950; Tue, 15 May 2012 18:42:55 -0700 (PDT) Received: from xps-iwamatsu.renesas.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPS id ix5sm3645935pbc.18.2012.05.15.18.42.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 May 2012 18:42:55 -0700 (PDT) From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de Date: Wed, 16 May 2012 10:49:39 +0900 Message-Id: <1337132979-5517-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Mailer: git-send-email 1.7.10 X-Gm-Message-State: ALoCoQlYf3DVjo01ea4YaVITW77UHt2G9yUlnv8FxP/OCq4j9YNRSvNMRJyZKc012a8rv/70OMRg Cc: Nobuhiro Iwamatsu Subject: [U-Boot] [PATCH v2] net: sh-eth: Add support Gigabit of SH7734 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 SH7734 support GMII. This add register infomation and the function which enable GMII. Signed-off-by: Nobuhiro Iwamatsu --- V2: Remove debug code drivers/net/sh_eth.c | 11 ++++++++++- drivers/net/sh_eth.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index c1abe7c..0f6fdde 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -348,7 +348,7 @@ static int sh_eth_phy_config(struct sh_eth_dev *eth) phydev = phy_connect( miiphy_get_dev_by_name(dev->name), - port_info->phy_addr, dev, PHY_INTERFACE_MODE_MII); + port_info->phy_addr, dev, CONFIG_SH_ETHER_PHY_MODE); port_info->phydev = phydev; phy_config(phydev); @@ -405,6 +405,9 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) outl(TPAUSER_UNLIMITED, TPAUSER(port)); #endif +#if defined(CONFIG_CPU_SH7734) + outl(CONFIG_SH_ETHER_SH7734_MII, RMII_MII(port)); +#endif /* Configure phy */ ret = sh_eth_phy_config(eth); if (ret) { @@ -434,6 +437,12 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) outl(0, RTRATE(port)); #endif } +#if defined(CONFIG_CPU_SH7763) || defined(CONFIG_CPU_SH7734) + else if (phy->speed == 1000) { + printf(SHETHER_NAME ": 1000Base/"); + outl(GECMR_1000B, GECMR(port)); + } +#endif /* Check if full duplex mode is supported by the phy */ if (phy->duplex) { diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index 46d8b81..132ea7a 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h @@ -225,6 +225,7 @@ struct sh_eth_dev { #define GECMR(port) (BASE_IO_ADDR + 0x05b0) #define MAHR(port) (BASE_IO_ADDR + 0x05C0) #define MALR(port) (BASE_IO_ADDR + 0x05C8) +#define RMII_MII(port) (BASE_IO_ADDR + 0x0790) #endif