[PATCH 01/06] pxa3xx_nand: update ns2cycle calculation method

Lei Wen leiwen at marvell.com
Tue Aug 17 05:24:06 EDT 2010


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 <leiwen at marvell.com>
---
 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 e02fa4f..4d89f37 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -363,7 +363,7 @@ static struct pxa3xx_nand_flash *builtin_flash_types[] = {
 #define tAR_NDTR1(r)	(((r) >> 0) & 0xf)

 /* 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)

 /* convert nand flash controller clock cycles to nano-seconds */
 #define cycle2ns(c, clk)	((((c) + 1) * 1000000 + clk / 500) / (clk / 1000))
-- 
1.7.0.4

--0016363ba71c37c94b048e041a1c
Content-Type: text/x-patch; charset=US-ASCII; 
	name="0001-pxa3xx_nand-update-ns2cycle-calculation-method.patch"
Content-Disposition: attachment; 
	filename="0001-pxa3xx_nand-update-ns2cycle-calculation-method.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gcypxq4k0

RnJvbSA5MDY0YjJjODc3Y2FkNTYwZmRhNzU3NzU2NGIzMzY5YzAwMjViN2RmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBMZWkgV2VuIDxsZWl3ZW5AbWFydmVsbC5jb20+CkRhdGU6IFR1
ZSwgMTcgQXVnIDIwMTAgMTc6MjQ6MDYgKzA4MDAKU3ViamVjdDogW1BBVENIIDAxLz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