From patchwork Wed Sep 13 01:54:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andes X-Patchwork-Id: 813142 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xsQSt2WgZz9sNr for ; Wed, 13 Sep 2017 12:23:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C4AB1C2206F; Wed, 13 Sep 2017 02:20:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 16430C22115; Wed, 13 Sep 2017 02:20:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4819AC22243; Wed, 13 Sep 2017 02:18:54 +0000 (UTC) Received: from ATCSQR.andestech.com (exmail.andestech.com [59.124.169.137]) by lists.denx.de (Postfix) with ESMTPS id 219C7C22304 for ; Wed, 13 Sep 2017 02:18:50 +0000 (UTC) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id v8D2CtUr033225; Wed, 13 Sep 2017 10:12:55 +0800 (GMT-8) (envelope-from uboot@andestech.com) Received: from app09.andestech.com (10.0.4.97) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Wed, 13 Sep 2017 10:18:29 +0800 From: Andes To: , , Date: Wed, 13 Sep 2017 09:54:59 +0800 Message-ID: <1505267699-10017-1-git-send-email-uboot@andestech.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [10.0.4.97] X-DNSRBL: X-MAIL: ATCSQR.andestech.com v8D2CtUr033225 Subject: [U-Boot] [PATCH 3/3] nds32: ftmac100: Fix write mac addr fail problem. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: rick After soft reset complete, write mac address immediately will fail. Add delay to work around this problem. Signed-off-by: rick --- drivers/net/ftmac100.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 4e45f00..e64bf3d 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -40,7 +40,12 @@ static void ftmac100_reset(struct ftmac100_data *priv) writel (FTMAC100_MACCR_SW_RST, &ftmac100->maccr); while (readl (&ftmac100->maccr) & FTMAC100_MACCR_SW_RST) - ; + mdelay(1); + /* + * When soft reset complete, write mac address immediately maybe fail somehow + * Wait for a while can avoid this problem + */ + mdelay(1); } /*