pxa3xx_nand: update ns2cycle calculation method
Subsystems (2)
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 <[email protected]>
--- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/pxa3xx_nand.c +0 -0
@@ -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)
{
Signature · 1 line
1.7.0.4