1 From 64e4fc11b960da97728e0d87dcf4c1e98f808501 Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <steve@sakoman.com>
3 Date: Thu, 31 Dec 2009 07:05:02 -0800
4 Subject: [PATCH] MTD: NAND: omap2: proper fix for subpage read ECC errors
7 drivers/mtd/nand/omap2.c | 11 +++++++----
8 1 files changed, 7 insertions(+), 4 deletions(-)
10 diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
11 index 1bb799f..75004fe 100644
12 --- a/drivers/mtd/nand/omap2.c
13 +++ b/drivers/mtd/nand/omap2.c
14 @@ -295,11 +295,14 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
17 /* take care of subpage reads */
18 - for (; len % 4 != 0; ) {
19 - *buf++ = __raw_readb(info->nand.IO_ADDR_R);
22 + if (info->nand.options & NAND_BUSWIDTH_16)
23 + omap_read_buf16(mtd, buf, len % 4);
25 + omap_read_buf8(mtd, buf, len % 4);
26 + p = (u32 *) (buf + len % 4);
31 /* configure and start prefetch transfer */
32 ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);