Patchwork [U-Boot,U-BOOT,V2] onenand: fix oob print out issue

login
register
mail settings
Submitter Lei Wen
Date Dec. 7, 2010, 1:38 a.m.
Message ID <1291685898-12064-1-git-send-email-leiwen@marvell.com>
Download mbox | patch
Permalink /patch/74484/
State Accepted
Commit a430b137eb578cf73be476ff05a43baa2aba1ad8
Headers show

Comments

Lei Wen - Dec. 7, 2010, 1:38 a.m.
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>
---
Changelog:
V1: Initial patch
V2: remove the comment of oob data appended to datbuf

 common/cmd_onenand.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Scott Wood - Dec. 7, 2010, 10:04 p.m.
On Tue, Dec 07, 2010 at 09:38:18AM +0800, Lei Wen wrote:
> 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>
> ---
> Changelog:
> V1: Initial patch
> V2: remove the comment of oob data appended to datbuf

Applied to u-boot-nand-flash

-Scott

Patch

diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index a59ab79..0434e19 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -294,7 +294,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;
@@ -320,6 +320,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]);