From patchwork Fri Jun 18 05:35:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 56125 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 B4C5D1007D4 for ; Fri, 18 Jun 2010 15:43:01 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPUKE-00065x-Ep; Fri, 18 Jun 2010 05:41:12 +0000 Received: from mail-pw0-f49.google.com ([209.85.160.49]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPUEt-0007FM-3w; Fri, 18 Jun 2010 05:35:41 +0000 Received: by mail-pw0-f49.google.com with SMTP id 6so354181pwj.36 for ; Thu, 17 Jun 2010 22:35:38 -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=PTm6xeYUqEDVGoEQMAOctbaJHyJYw7jsq+dVm3o7pbM=; b=qXBm6fFG7bJQ21hFe5akZ2T+rGJAWbgtDFnBI2CilNhXkksvn8tJn1L2Q2bAij61Sg qqcdnqjB7mdXG7JrkCGM78u/KATlrYQ7o8dajCr4DUar/nrfDjVItu1bHIJ1qNNStkeQ rXdQq71uHDHhVKRkmBtOyW72H4cQXr09lGd3E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HS8DGVVG2m1tpzi48CPHkAlbGjJHkaANzpz5TBmFa+1wazsDUdYxtAFBIhLo16T6lO k44J+dkvi0umusjDF8XjZtRNVEwP0JP6jegkgQUB6nbm+zsojl3cDkzUkclcgWZZilrG T9BiNHt6xsqyMrsszIhgVtdKnO+TMtdpd9QTc= MIME-Version: 1.0 Received: by 10.142.75.2 with SMTP id x2mr401453wfa.40.1276839336938; Thu, 17 Jun 2010 22:35:36 -0700 (PDT) Received: by 10.142.114.3 with HTTP; Thu, 17 Jun 2010 22:35:36 -0700 (PDT) Date: Fri, 18 Jun 2010 13:35:36 +0800 Message-ID: Subject: [PATCH 16/25] pxa3xx_nand: update ns2cycle calculation method From: Haojian Zhuang To: Marc Kleine-Budde , David Woodhouse , David Woodhouse , linux-mtd@lists.infradead.org, Eric Miao , linux-arm-kernel X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100618_013540_297415_0ED37A0D X-CRM114-Status: GOOD ( 17.49 ) 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.160.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 1a69fbe2f0f27f9a77ca425f844acfae525d1338 Mon Sep 17 00:00:00 2001 From: Lei Wen Date: Fri, 4 Jun 2010 14:10:45 +0800 Subject: [PATCH 16/25] 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(-) { diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 1e75df4..bdcc881 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -318,7 +318,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, const struct pxa3xx_nand_timing *t)