diff options
author | Sukumar Ghorai <s-ghorai@ti.com> | 2011-01-28 05:12:07 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-02-17 18:32:54 -0500 |
commit | 317379a975c07fe63bc4f86dabd668df96ff3df2 (patch) | |
tree | 04cf76a6b0c8caec5f3d7eb810dc165fdb96eaa5 /drivers/mtd | |
parent | 4e070376165a9b7f245fada77645b81352c6ec78 (diff) |
omap3: nand: configurable fifo threshold to gain the throughput
Configure the FIFO THREASHOLD value different for read and write to keep busy
both filling and to drain out of FIFO at reading and writing.
Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/omap2.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index fbe841467175..f1648fd5924a 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -244,7 +244,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | /* configure and start prefetch transfer */ | 246 | /* configure and start prefetch transfer */ |
247 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); | 247 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
248 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0); | ||
248 | if (ret) { | 249 | if (ret) { |
249 | /* PFPW engine is busy, use cpu copy method */ | 250 | /* PFPW engine is busy, use cpu copy method */ |
250 | if (info->nand.options & NAND_BUSWIDTH_16) | 251 | if (info->nand.options & NAND_BUSWIDTH_16) |
@@ -289,7 +290,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd, | |||
289 | } | 290 | } |
290 | 291 | ||
291 | /* configure and start prefetch transfer */ | 292 | /* configure and start prefetch transfer */ |
292 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1); | 293 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
294 | PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1); | ||
293 | if (ret) { | 295 | if (ret) { |
294 | /* PFPW engine is busy, use cpu copy method */ | 296 | /* PFPW engine is busy, use cpu copy method */ |
295 | if (info->nand.options & NAND_BUSWIDTH_16) | 297 | if (info->nand.options & NAND_BUSWIDTH_16) |
@@ -345,8 +347,9 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
345 | int ret; | 347 | int ret; |
346 | unsigned long tim, limit; | 348 | unsigned long tim, limit; |
347 | 349 | ||
348 | /* The fifo depth is 64 bytes. We have a sync at each frame and frame | 350 | /* The fifo depth is 64 bytes max. |
349 | * length is 64 bytes. | 351 | * But configure the FIFO-threahold to 32 to get a sync at each frame |
352 | * and frame length is 32 bytes. | ||
350 | */ | 353 | */ |
351 | int buf_len = len >> 6; | 354 | int buf_len = len >> 6; |
352 | 355 | ||
@@ -387,7 +390,8 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr, | |||
387 | OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC); | 390 | OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC); |
388 | } | 391 | } |
389 | /* configure and start prefetch transfer */ | 392 | /* configure and start prefetch transfer */ |
390 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x1, len, is_write); | 393 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
394 | PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write); | ||
391 | if (ret) | 395 | if (ret) |
392 | /* PFPW engine is busy, use cpu copy method */ | 396 | /* PFPW engine is busy, use cpu copy method */ |
393 | goto out_copy; | 397 | goto out_copy; |
@@ -522,7 +526,8 @@ static void omap_read_buf_irq_pref(struct mtd_info *mtd, u_char *buf, int len) | |||
522 | init_completion(&info->comp); | 526 | init_completion(&info->comp); |
523 | 527 | ||
524 | /* configure and start prefetch transfer */ | 528 | /* configure and start prefetch transfer */ |
525 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); | 529 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
530 | PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0); | ||
526 | if (ret) | 531 | if (ret) |
527 | /* PFPW engine is busy, use cpu copy method */ | 532 | /* PFPW engine is busy, use cpu copy method */ |
528 | goto out_copy; | 533 | goto out_copy; |
@@ -569,8 +574,9 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd, | |||
569 | info->buf = (u_char *) buf; | 574 | info->buf = (u_char *) buf; |
570 | init_completion(&info->comp); | 575 | init_completion(&info->comp); |
571 | 576 | ||
572 | /* configure and start prefetch transfer */ | 577 | /* configure and start prefetch transfer : size=24 */ |
573 | ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1); | 578 | ret = gpmc_prefetch_enable(info->gpmc_cs, |
579 | (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1); | ||
574 | if (ret) | 580 | if (ret) |
575 | /* PFPW engine is busy, use cpu copy method */ | 581 | /* PFPW engine is busy, use cpu copy method */ |
576 | goto out_copy; | 582 | goto out_copy; |