]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
onenand: fix oob print out issue
authorLei Wen <leiwen@marvell.com>
Tue, 7 Dec 2010 01:38:18 +0000 (09:38 +0800)
committerScott Wood <scottwood@freescale.com>
Tue, 7 Dec 2010 22:04:20 +0000 (16:04 -0600)
Seems original implementation forget to set the pointer to point
to the oobbuf, so when we want to see oob buf, we see nothing...
Fix it by get pointer as the oobbuf set.

Signed-off-by: Lei Wen <leiwen@marvell.com>
common/cmd_onenand.c

index 33108f1b34a833a789cc26f0d95f62bac7b518a7..cb2ba70517d4608feb0fc8fdf835b13dddc8a896 100644 (file)
@@ -293,7 +293,7 @@ static int onenand_dump(struct mtd_info *mtd, ulong off, int only_oob)
        addr = (loff_t) off;
        memset(&ops, 0, sizeof(ops));
        ops.datbuf = datbuf;
-       ops.oobbuf = oobbuf; /* must exist, but oob data will be appended to ops.datbuf */
+       ops.oobbuf = oobbuf;
        ops.len = mtd->writesize;
        ops.ooblen = mtd->oobsize;
        ops.retlen = 0;
@@ -319,6 +319,8 @@ static int onenand_dump(struct mtd_info *mtd, ulong off, int only_oob)
        }
        puts("OOB:\n");
        i = mtd->oobsize >> 3;
+       p = oobbuf;
+
        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]);