From patchwork Wed Sep 25 13:33:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 277864 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 B386E2C0335 for ; Wed, 25 Sep 2013 23:41:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B05284A08A; Wed, 25 Sep 2013 15:40:51 +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 ojZ+c-boDMVh; Wed, 25 Sep 2013 15:40:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9D5B4A08D; Wed, 25 Sep 2013 15:40:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 776384A07F for ; Wed, 25 Sep 2013 15:40:33 +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 pxd9TvvimHgN for ; Wed, 25 Sep 2013 15:40:25 +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 vaxjo.synopsys.com (us02smtp1.synopsys.com [198.182.60.75]) by theia.denx.de (Postfix) with ESMTP id 9EB564A080 for ; Wed, 25 Sep 2013 15:40:20 +0200 (CEST) Received: from WBSNus01mta1 (us01secmta1.synopsys.com [10.9.203.100]) by vaxjo.synopsys.com (Postfix) with ESMTP id 5131FDA73; Wed, 25 Sep 2013 06:34:00 -0700 (PDT) Received: from us01secmta1.internal.synopsys.com (us01secmta1.internal.synopsys.com [127.0.0.1]) by us01secmta1.internal.synopsys.com (Service) with ESMTP id 32B2A27113; Wed, 25 Sep 2013 06:34:00 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.9.202.240]) by us01secmta1.internal.synopsys.com (Service) with ESMTP id EB2D827102; Wed, 25 Sep 2013 06:33:59 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id DE31B7FC; Wed, 25 Sep 2013 06:33:59 -0700 (PDT) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id D91FB7FB; Wed, 25 Sep 2013 06:33:58 -0700 (PDT) Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.27) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.2.298.4; Wed, 25 Sep 2013 06:33:25 -0700 Received: from abrodkin-8560l.internal.synopsys.com (10.121.8.99) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.2.298.4; Wed, 25 Sep 2013 15:33:21 +0200 From: Alexey Brodkin To: Date: Wed, 25 Sep 2013 17:33:10 +0400 Message-ID: <1380115990-24683-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-Originating-IP: [10.121.8.99] Cc: sr@denx.de, Mischa.Jonker@synopsys.com, Alexey Brodkin Subject: [U-Boot] [PATCH] drivers/net/designware - respect "bus mode" register contents on SW reset 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de "bus mode" register contains lots of fields and some of them don't expect to be written with 0 (zero). So since we're only interested in resetting MAC (which is done with setting the least significant bit of this register with "0") I believe it's better to modify only 1 bit of the register. Signed-off-by: Alexey Brodkin Acked-by: Vipin Kumar --- drivers/net/designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 46f6601..f11cb0b 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -112,7 +112,7 @@ static int mac_reset(struct eth_device *dev) ulong start; int timeout = CONFIG_MACRESET_TIMEOUT; - writel(DMAMAC_SRST, &dma_p->busmode); + writel(readl(&dma_p->busmode) | DMAMAC_SRST, &dma_p->busmode); if (priv->interface != PHY_INTERFACE_MODE_RGMII) writel(MII_PORTSELECT, &mac_p->conf);