]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mtd: nand: omap_gpmc: support reading metadata from OOB
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 11 Feb 2015 15:24:20 +0000 (16:24 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 4 Mar 2015 12:56:13 +0000 (13:56 +0100)
drivers/mtd/nand/omap_gpmc.c

index f809a783a5bbe9c2fde767484e91f51c67802469..94c18c97d030919f2d87325c028c1bbe1e028cfc 100644 (file)
@@ -665,6 +665,12 @@ static int omap_read_page_bch(struct mtd_info *mtd, struct nand_chip *chip,
                /* read syndrome */
                chip->ecc.calculate(mtd, p, &ecc_calc[i]);
 
                /* read syndrome */
                chip->ecc.calculate(mtd, p, &ecc_calc[i]);
 
+               if (oob_required) {
+                       /* reread the OOB area to get the metadata */
+                       chip->cmdfunc(mtd, NAND_CMD_RNDOUT, mtd->writesize, page);
+                       chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
+               }
+
                data_pos += eccsize;
                oob_pos += eccbytes;
        }
                data_pos += eccsize;
                oob_pos += eccbytes;
        }