From patchwork Wed Sep 2 11:04:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 32823 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id D3E2EB708C for ; Wed, 2 Sep 2009 21:04:50 +1000 (EST) Received: by ozlabs.org (Postfix) id C92C5DDD0B; Wed, 2 Sep 2009 21:04:50 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id C7884DDD01 for ; Wed, 2 Sep 2009 21:04:50 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id BAEC3B7DE6 for ; Wed, 2 Sep 2009 21:04:26 +1000 (EST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 05C35B708C for ; Wed, 2 Sep 2009 21:04:19 +1000 (EST) Received: by ozlabs.org (Postfix) id EA87EDDD0C; Wed, 2 Sep 2009 21:04:18 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from www.tglx.de (www.tglx.de [62.245.132.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3DF88DDD0B for ; Wed, 2 Sep 2009 21:04:17 +1000 (EST) Received: from www.tglx.de (www.tglx.de [127.0.0.1]) by www.tglx.de (8.13.8/8.13.8/TGLX-2007100201) with ESMTP id n82B4B9P014972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Sep 2009 13:04:11 +0200 Received: (from bigeasy@localhost) by www.tglx.de (8.13.8/8.13.8/Submit) id n82B4AcM014971; Wed, 2 Sep 2009 13:04:10 +0200 Date: Wed, 2 Sep 2009 13:04:10 +0200 From: Sebastian Andrzej Siewior To: Pantelis Antoniou , Vitaly Bordug Subject: [RFC] net/fs_enet: send a reset request to the PHY on init Message-ID: <20090902110410.GC15401@www.tglx.de> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Key-Id: 97C4700B X-Key-Fingerprint: 09E2 D1F3 9A3A FF13 C3D3 961C 0688 1C1E 97C4 700B X-Virus-Scanned: clamav-milter 0.95.1 at www.tglx.de X-Virus-Status: Clean X-Spam-Status: No, score=-1.6 required=5.0 tests=ALL_TRUSTED,AWL autolearn=failed version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on www.tglx.de Cc: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Usually u-boot sends a phy request in its network init routine. An uboot without network support doesn't do it and I endup without working network. I still can switch between 10/100Mbit (according to the LED on the hub and phy registers) but I can't send or receive any data. At this point I'm not sure if the PowerON Reset takes the PHY a few nsecs too early out of reset or if this reset is required and everyone relies on U-boot performing this reset. Signed-off-by: Sebastian Andrzej Siewior --- This is done on a custom mpc512x board. Unfortunately I don't have other boards to check. The PHY is a AMD Am79C874, phylib uses the generic one. drivers/net/fs_enet/fs_enet-main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index ee15402..a3c962b 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c @@ -823,7 +823,8 @@ static int fs_init_phy(struct net_device *dev) } fep->phydev = phydev; - + phy_write(phydev, MII_BMCR, BMCR_RESET); + udelay(1); return 0; }