From patchwork Wed May 9 07:54:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 157880 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 DC9AEB6FA0 for ; Wed, 9 May 2012 17:48:34 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D3A02808F; Wed, 9 May 2012 09:48:32 +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 wxGOj6LUZwM2; Wed, 9 May 2012 09:48:32 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C0B4D28084; Wed, 9 May 2012 09:48:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BA7A28084 for ; Wed, 9 May 2012 09:48:27 +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 ijJOP-6Co-9Q for ; Wed, 9 May 2012 09:48:26 +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-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by theia.denx.de (Postfix) with ESMTPS id 4BBA32805F for ; Wed, 9 May 2012 09:48:24 +0200 (CEST) Received: by dacx6 with SMTP id x6so868896dac.3 for ; Wed, 09 May 2012 00:48:23 -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=+ja5TQ9OGS8VCp3uqG6ED8hlYYgj1PnPsp+FHhTmOZg=; b=FiW87kCLmCUqMP0rsTMxOh/NStDP45RqiiDTgycLgzIh7v/BJd78vZRJJ5xz3jo2rK lzWfdGwJ9pE0vJEcxmuMlcjGbrt3JPPx7z736/dKW12jYOoPnsZtAvLNP5sGts0WTPAx 5wk9LNQGhQNERsG1KDwheK4TJ8nmMbsAleJ3KMPnWAVkjSI+SwOzW6sMCk1YCfgsSuKr T02uNIx30iYQVnZtGydJkAqNbDrazc7xxmAPmkM3XOWsoQDZJZD1bDebk2ig22CgGEKy Gy0TYITorXCegIsBr5IDUiiRvNpHPPCFYDqSZVabQ4cuX2Fd2/sz5GIa/VbWDIv0I4BC 65/Q== Received: by 10.68.235.69 with SMTP id uk5mr3272666pbc.10.1336549703000; Wed, 09 May 2012 00:48:23 -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 tx5sm903600pbc.40.2012.05.09.00.48.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 00:48:22 -0700 (PDT) From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de Date: Wed, 9 May 2012 16:54:57 +0900 Message-Id: <1336550097-5806-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Mailer: git-send-email 1.7.10 X-Gm-Message-State: ALoCoQmjJpG6astJNx7TAxcCcP+u05217W4YwAuQmyTsA85N9xeS04l4Qre4gaSmb36l7hV3dDOt Cc: joe.hershberger@ni.com, Nobuhiro Iwamatsu Subject: [U-Boot] [PATCH] 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 CC: Joe Hershberger --- drivers/net/sh_eth.c | 12 +++++++++++- drivers/net/sh_eth.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index c1abe7c..f060d44 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -346,9 +346,10 @@ static int sh_eth_phy_config(struct sh_eth_dev *eth) struct eth_device *dev = port_info->dev; struct phy_device *phydev; + printf("dev->name %s\n", dev->name); 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 +406,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 +438,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