From patchwork Mon Nov 14 14:02:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bertrand.cachet@heig-vd.ch X-Patchwork-Id: 125542 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 0D96FB71F9 for ; Tue, 15 Nov 2011 01:02:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 28B5928626; Mon, 14 Nov 2011 15:02:21 +0100 (CET) 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 1bXJFCm4qkbL; Mon, 14 Nov 2011 15:02:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0B23E2861F; Mon, 14 Nov 2011 15:02:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E28912861F for ; Mon, 14 Nov 2011 15:02:17 +0100 (CET) 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 bdGIyfWb9zUa for ; Mon, 14 Nov 2011 15:02:17 +0100 (CET) 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 heig-vd.ch (mailcl1.heig-vd.ch [193.134.216.182]) by theia.denx.de (Postfix) with ESMTP id 2C61C2861E for ; Mon, 14 Nov 2011 15:02:15 +0100 (CET) Received: from [10.192.41.23] (helo=EINTFE01A.einet.ad.eivd.ch) by heig-vd.ch stage1 with esmtp (Exim MailCleaner) id 1RPxg7-0007Ex-9k for from ; Mon, 14 Nov 2011 15:38:31 +0100 Received: from localhost.localdomain (10.192.51.133) by EINTFE01A.einet.ad.eivd.ch (10.192.41.25) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 14 Nov 2011 15:02:13 +0100 From: Bertrand Cachet To: Date: Mon, 14 Nov 2011 15:02:09 +0100 Message-ID: <1321279329-32568-1-git-send-email-bertrand.cachet@heig-vd.ch> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-Originating-IP: [10.192.51.133] Cc: Bertrand Cachet Subject: [U-Boot] [PATCH] Improve Power Management in SMC911X driver. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From datasheet, when READY bit is set inside PM_CTRL register, it means that device is already in *normal* (D0) mode => it doesn't need to be wake-up. With this patch, we only wake-up (writing on TEST_BYTE register) if PM_MODE bits of PM_CTRL register is in D1/D2 mode. Signed-off-by: Bertrand Cachet --- drivers/net/smc911x.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h index 8ce08a9..61f7669 100644 --- a/drivers/net/smc911x.h +++ b/drivers/net/smc911x.h @@ -471,8 +471,12 @@ static void smc911x_reset(struct eth_device *dev) { int timeout; - /* Take out of PM setting first */ - if (smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) { + /* Take out of PM setting first */ + /* + * If PMT_CTRL_READY bit is set to 1b => power management is + * already ready + */ + if ((smc911x_reg_read(dev, PMT_CTRL) & PMT_CTRL_READY) == 0) { /* Write to the bytetest will take out of powerdown */ smc911x_reg_write(dev, BYTE_TEST, 0x0);