From patchwork Tue Jun 28 11:40:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 102357 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 DADA4B6F6E for ; Tue, 28 Jun 2011 21:42:03 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 446CC280A8; Tue, 28 Jun 2011 13:41:56 +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 OTuamDxyIVKP; Tue, 28 Jun 2011 13:41:56 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5E335280D9; Tue, 28 Jun 2011 13:41:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 511DE280D9 for ; Tue, 28 Jun 2011 13:41:39 +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 PtjfcpSIFnlx for ; Tue, 28 Jun 2011 13:41:37 +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-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id 8551E280B6 for ; Tue, 28 Jun 2011 13:41:30 +0200 (CEST) Received: by mail-yx0-f172.google.com with SMTP id 4so42907yxp.3 for ; Tue, 28 Jun 2011 04:41:30 -0700 (PDT) Received: by 10.150.74.13 with SMTP id w13mr8294791yba.313.1309261290690; Tue, 28 Jun 2011 04:41:30 -0700 (PDT) Received: from localhost.localdomain (d122-104-32-184.sbr6.nsw.optusnet.com.au [122.104.32.184]) by mx.google.com with ESMTPS id 5sm1223607ybq.23.2011.06.28.04.41.28 (version=SSLv3 cipher=OTHER); Tue, 28 Jun 2011 04:41:30 -0700 (PDT) From: Graeme Russ To: u-boot@lists.denx.de Date: Tue, 28 Jun 2011 21:40:57 +1000 Message-Id: <1309261269-4363-5-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.5.2.317.g391b14 In-Reply-To: <1309261269-4363-1-git-send-email-graeme.russ@gmail.com> References: <1309261269-4363-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH v1 (WIP) 04/16] [Timer]Allow reset_timer() only for Nios2 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Graeme Russ --- drivers/block/mg_disk.c | 2 ++ drivers/mtd/cfi_flash.c | 4 ++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c index b74307a..2198017 100644 --- a/drivers/block/mg_disk.c +++ b/drivers/block/mg_disk.c @@ -91,7 +91,9 @@ static unsigned int mg_wait (u32 expect, u32 msec) u32 from, cur, err; err = MG_ERR_NONE; +#ifdef CONFIG_NIOS2 reset_timer(); +#endif from = get_timer(0); status = readb(mg_base() + MG_REG_STATUS); diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 6039e1f..3ac6c80 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -573,7 +573,9 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector, #endif /* Wait for command completion */ +#ifdef CONFIG_NIOS2 reset_timer(); +#endif start = get_timer (0); while (flash_is_busy (info, sector)) { if (get_timer (start) > tout) { @@ -662,7 +664,9 @@ static int flash_status_poll(flash_info_t *info, void *src, void *dst, #endif /* Wait for command completion */ +#ifdef CONFIG_NIOS2 reset_timer(); +#endif start = get_timer(0); while (1) { switch (info->portwidth) {