summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch b/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
new file mode 100644
index 00000000..21eb1e9f
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
@@ -0,0 +1,63 @@
1From fb4dfff6a6e107e0e526801e7add4a9aaeab1eab Mon Sep 17 00:00:00 2001
2From: kishore kadiyala <kishore.kadiyala@ti.com>
3Date: Mon, 2 May 2011 11:10:38 +0000
4Subject: [PATCH 27/32] omap : nand : fix subpage ecc issue with prefetch
5
6For prefetch engine, read and write got broken in commit '2c01946c'.
7We never hit a scenario of not getting 'gpmc_prefetch_enable'
8call success.
9When reading/writing a subpage with a non divisible by 4 ecc number
10of bytes, the mis-aligned bytes gets handled first before enabling
11the Prefetch engine, then it reads/writes rest of the bytes.
12
13Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
14Signed-off-by: Vimal Singh <vimal.newwork@gmail.com>
15Reported-by: Bryan DE FARIA <bdefaria@adeneo-embedded.com>
16---
17 drivers/mtd/nand/omap2.c | 12 +++++-------
18 1 files changed, 5 insertions(+), 7 deletions(-)
19
20diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
21index 832f111..471a39b 100644
22--- a/drivers/mtd/nand/omap2.c
23+++ b/drivers/mtd/nand/omap2.c
24@@ -275,11 +275,10 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
25 if (ret) {
26 /* PFPW engine is busy, use cpu copy method */
27 if (info->nand.options & NAND_BUSWIDTH_16)
28- omap_read_buf16(mtd, buf, len);
29+ omap_read_buf16(mtd, (u_char *)p, len);
30 else
31- omap_read_buf8(mtd, buf, len);
32+ omap_read_buf8(mtd, (u_char *)p, len);
33 } else {
34- p = (u32 *) buf;
35 do {
36 r_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
37 r_count = r_count >> 2;
38@@ -305,7 +304,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
39 struct omap_nand_info, mtd);
40 uint32_t w_count = 0;
41 int i = 0, ret = 0;
42- u16 *p;
43+ u16 *p = (u16 *)buf;
44 unsigned long tim, limit;
45
46 /* take care of subpage writes */
47@@ -321,11 +320,10 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
48 if (ret) {
49 /* PFPW engine is busy, use cpu copy method */
50 if (info->nand.options & NAND_BUSWIDTH_16)
51- omap_write_buf16(mtd, buf, len);
52+ omap_write_buf16(mtd, (u_char *)p, len);
53 else
54- omap_write_buf8(mtd, buf, len);
55+ omap_write_buf8(mtd, (u_char *)p, len);
56 } else {
57- p = (u16 *) buf;
58 while (len) {
59 w_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
60 w_count = w_count >> 1;
61--
621.6.6.1
63