]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - sitara-epos/sitara-epos-kernel.git/commitdiff
Revert "arch:arm:nand - 14 byte ECC support for BCH8"
authorPhilip, Avinash <avinashphilip@ti.com>
Tue, 6 Mar 2012 03:54:39 +0000 (09:24 +0530)
committerPhilip, Avinash <avinashphilip@ti.com>
Thu, 8 Mar 2012 11:55:25 +0000 (17:25 +0530)
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/omap2.c

index a5df3ecade06c9c761dac0fc34b9cd49bbf38f67..053d72a62e128b1596bb7c4a2dd6d35f3a94339f 100644 (file)
@@ -1995,7 +1995,6 @@ static void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
        const uint8_t *p = buf;
        uint32_t *eccpos = chip->ecc.layout->eccpos;
 
-       memset(ecc_calc, 0, eccsteps * eccbytes);
        for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
                chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
                chip->write_buf(mtd, p, eccsize);
index acacb308fd75a414aeefdbdd7a5d890bdba5fd25..2118bd6bd6d597ad4e778bd64d1e3a41b157b20d 100644 (file)
 #define MAX_HWECC_BYTES_OOB_64     24
 #define JFFS2_CLEAN_MARKER_OFFSET  0x2
 #define BCH_ECC_POS                    0x2
-#define BCH_JFFS2_CLEAN_MARKER_OFFSET  0x3a
+#define BCH_JFFS2_CLEAN_MARKER_OFFSET  0x36
 
 int decode_bch(int select_4_8, unsigned char *ecc, unsigned int *err_loc);
 
@@ -818,8 +818,6 @@ static int omap_read_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
        uint32_t data_pos;
        uint32_t oob_pos;
 
-       struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
-                                                       mtd);
        data_pos = 0;
        /* oob area start */
        oob_pos = (eccsize * eccsteps) + chip->ecc.layout->eccpos[0];
@@ -833,11 +831,7 @@ static int omap_read_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
 
                /* read respective ecc from oob area */
                chip->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_pos, page);
-
-               if (info->ecc_opt == OMAP_ECC_BCH8_CODE_HW)
-                       chip->read_buf(mtd, oob, 13);
-               else
-                       chip->read_buf(mtd, oob, eccbytes);
+               chip->read_buf(mtd, oob, eccbytes);
                /* read syndrome */
                chip->ecc.calculate(mtd, p, &ecc_calc[i]);
 
@@ -984,8 +978,8 @@ static int omap_correct_data(struct mtd_info *mtd, u_char *dat,
                        }
 
                        stat     += count;
-                       calc_ecc  = calc_ecc + 14;
-                       read_ecc  = read_ecc + 14;
+                       calc_ecc  = calc_ecc + eccsize;
+                       read_ecc  = read_ecc + eccsize;
                        dat      += BCH8_ECC_BYTES;
                }
                break;
@@ -1227,7 +1221,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
                        info->nand.ecc.bytes    = 4*7;
                        info->nand.ecc.size     = 4*512;
                } else if (pdata->ecc_opt == OMAP_ECC_BCH8_CODE_HW) {
-                       info->nand.ecc.bytes     = 14;
+                       info->nand.ecc.bytes     = 13;
                        info->nand.ecc.size      = 512;
                        info->nand.ecc.read_page = omap_read_page_bch;
                } else {