From patchwork Wed Jul 28 05:58:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 60103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9DF1B70A5 for ; Wed, 28 Jul 2010 16:06:04 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OdzkI-0001Cr-UO; Wed, 28 Jul 2010 06:04:03 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OdzeT-00038v-TB; Wed, 28 Jul 2010 05:58:03 +0000 Received: by mail-pz0-f49.google.com with SMTP id 3so2085546pzk.36 for ; Tue, 27 Jul 2010 22:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=SraFVVGJoqh18r2edOHQ6jKh6IubnFdG1d79GkiEsf8=; b=QvRBTWWBrZwbgd2gw/kYGiKY6Rdt+ofmwCQk+FWhFdJMaZzToTTCg0DXaxNEOB6Nwe tRuzUfCB5f1XjKM6xa/kJRdSyFBoV7ZKn2GVtsCPBFzB73ltFtooCq+NwG9+SqXAMi/o 8xmDzIuFbpF/EGEYrFz7zMOsW4dFn3vwdUI5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=hPcBfXP69Y+sGpHUXALRs1DZfwMifzVMr+VbPDE68Wc5a3lAekvcNkXHyDI25xqZsb Uvi8m+hf+WgtMUCDdbyNMvyDJLJm9x2FM9JOMGQ7J9ASYg+johPfOfckG3ZY9YIJJ7th 2SXEDRBLNp1VheFljTorKRAT+tT8vu1F9PJtI= MIME-Version: 1.0 Received: by 10.142.194.15 with SMTP id r15mr11398138wff.276.1280296681464; Tue, 27 Jul 2010 22:58:01 -0700 (PDT) Received: by 10.142.54.6 with HTTP; Tue, 27 Jul 2010 22:58:01 -0700 (PDT) Date: Wed, 28 Jul 2010 13:58:01 +0800 Message-ID: Subject: [PATCH 19/29] pxa3xx_nand: update ns2cycle calculation method From: Haojian Zhuang To: Eric Miao , linux-arm-kernel , David Woodhouse , David Woodhouse , Marc Kleine-Budde , linux-mtd@lists.infradead.org, Lei Wen X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100728_015803_069581_ADC269EE X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (haojian.zhuang[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From 00038338c35050bcb6523a02befd576b3b8ac9ae Mon Sep 17 00:00:00 2001 From: Lei Wen Date: Tue, 22 Jun 2010 22:32:54 +0800 Subject: [PATCH 19/29] pxa3xx_nand: update ns2cycle calculation method For the original method change from plus 1 to minus 1, this way make the default timing like tCS become 0 after calculation, although we set the timing as 0xa... Change the method to no plus and minus, and make the result closer to what the timing specified in the NAND chip spec. Signed-off-by: Lei Wen --- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) const struct pxa3xx_nand_timing *t) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 45c9660..50f653b 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -279,7 +279,7 @@ static const char *mtd_names[] = {"pxa3xx_nand-0", "pxa3xx_nand-1", NULL}; #define NDTR1_tAR(c) (min((c), 15) << 0) /* convert nano-seconds to nand flash controller clock cycles */ -#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) - 1) +#define ns2cycle(ns, clk) (int)((ns) * (clk / 1000000) / 1000) static void pxa3xx_nand_set_timing(struct pxa3xx_nand_info *info,