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 f809a78..94c18c9 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]);
 
+               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;
        }