]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
nand: remove bogus patch imported from TI BSP
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 20 Aug 2012 12:27:55 +0000 (14:27 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 20 Aug 2012 12:27:55 +0000 (14:27 +0200)
common/cmd_nand.c
drivers/mtd/nand/nand_base.c

index f183a575f3ed5cb9e562454fac253ec11fe49da3..0fd3a6c414aa9c35f13a8ec1a9bd60d4614634df 100644 (file)
@@ -47,11 +47,8 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
                off = last + nand->writesize;
 
        last = off;
-#ifndef CONFIG_NAND_AM33XX
+
        datbuf = malloc(nand->writesize);
-#else
-       datbuf = malloc(nand->writesize + nand->oobsize);
-#endif
        oobbuf = malloc(nand->oobsize);
        if (!datbuf || !oobbuf) {
                puts("No memory for page buffer\n");
@@ -88,9 +85,7 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
        }
        puts("OOB:\n");
        i = nand->oobsize >> 3;
-#ifndef CONFIG_NAND_AM33XX
        p = oobbuf;
-#endif
        while (i--) {
                printf("\t%02x %02x %02x %02x %02x %02x %02x %02x\n",
                       p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
index 9b2cea131f13b72fd13e5f6af9c004792f4a5658..de2c713bf15406aa50dc0fa892d0f078c87cb2fb 100644 (file)
@@ -1208,6 +1208,9 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
        int ret = 0;
        uint32_t readlen = ops->len;
        uint32_t oobreadlen = ops->ooblen;
+       uint32_t max_oobsize = ops->mode == MTD_OOB_AUTO ?
+               mtd->oobavail : mtd->oobsize;
+
        uint8_t *bufpoi, *oob, *buf;
 
        stats = mtd->ecc_stats;
@@ -1262,18 +1265,14 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
                        buf += bytes;
 
                        if (unlikely(oob)) {
-                               /* Raw mode does data:oob:data:oob */
-                               if (ops->mode != MTD_OOB_RAW) {
-                                       int toread = min(oobreadlen,
-                                               chip->ecc.layout->oobavail);
+
+                               int toread = min(oobreadlen, max_oobsize);
+
                                if (toread) {
                                        oob = nand_transfer_oob(chip,
                                                oob, ops, toread);
                                        oobreadlen -= toread;
                                }
-                               } else
-                                       buf = nand_transfer_oob(chip,
-                                               buf, ops, mtd->oobsize);
                        }
 
                        if (!(chip->options & NAND_NO_READRDY)) {