]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mtd: nand: omap_gpmc: support reading metadata from OOB KARO-TX-2015-02-27
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, 11 Feb 2015 15:24:20 +0000 (16:24 +0100)
drivers/mtd/nand/omap_gpmc.c

index 06646443ec2ec2692a4d5ec857807e06999a0463..5af213c75849d0615c022d1bceae7f8f2d2abcb4 100644 (file)
@@ -814,6 +814,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;
        }