提交 5b0d4d7c 编写于 作者: M Matt Reimer 提交者: David Woodhouse

[MTD] [NAND] pxa3xx: convert from ns to clock ticks more accurately

The various fields in NDTR{01} are in units of clock ticks minus one, but the
ns2cycle macro mistakenly adds one, inflating the number of clock ticks and
making it impossible to set any of these fields to zero.
Signed-off-by: NMatt Reimer <mreimer@vpop.net>
Signed-off-by: NEric Miao <eric.miao@marvell.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 7f9938d0
......@@ -298,7 +298,7 @@ static struct pxa3xx_nand_flash *builtin_flash_types[] = {
#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) - 1)
static void pxa3xx_nand_set_timing(struct pxa3xx_nand_info *info,
const struct pxa3xx_nand_timing *t)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册