From patchwork Tue Dec 7 01:38:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lei Wen X-Patchwork-Id: 74484 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 793A4B70B0 for ; Tue, 7 Dec 2010 12:29:41 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ADD2A28193; Tue, 7 Dec 2010 02:29:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bOW-rv02uHjJ; Tue, 7 Dec 2010 02:29:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF11D2816A; Tue, 7 Dec 2010 02:29:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1B52F2816A for ; Tue, 7 Dec 2010 02:29:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YkVAfvYoa8Jn for ; Tue, 7 Dec 2010 02:29:33 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from dakia2.marvell.com (dakia2.marvell.com [65.219.4.35]) by theia.denx.de (Postfix) with ESMTPS id 06F1F28142 for ; Tue, 7 Dec 2010 02:29:31 +0100 (CET) X-ASG-Debug-ID: 1291685368-081cf18a0001-4l7tJC Received: from maili.marvell.com (maili.marvell.com [10.68.76.51]) by dakia2.marvell.com with ESMTP id oP9NIGxxbh1T9zRr; Mon, 06 Dec 2010 17:29:28 -0800 (PST) X-Barracuda-Envelope-From: leiwen@marvell.com Received: from localhost (unknown [10.38.164.83]) by maili.marvell.com (Postfix) with ESMTP id 1512E8A002; Mon, 6 Dec 2010 17:29:28 -0800 (PST) From: Lei Wen To: Scott Wood , u-boot@lists.denx.de X-ASG-Orig-Subj: [U-BOOT][PATCH V2] onenand: fix oob print out issue Date: Tue, 7 Dec 2010 09:38:18 +0800 X-ASG-Orig-Subj: [U-BOOT][PATCH V2] onenand: fix oob print out issue Message-Id: <1291685898-12064-1-git-send-email-leiwen@marvell.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: X-Barracuda-Connect: maili.marvell.com[10.68.76.51] X-Barracuda-Start-Time: 1291685368 X-Barracuda-URL: http://10.68.76.222:80/cgi-mod/mark.cgi X-Barracuda-Spam-Score: -1002.00 X-Barracuda-Spam-Status: No, SCORE=-1002.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=1000.0 Subject: [U-Boot] [U-BOOT][PATCH V2] onenand: fix oob print out issue X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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(-) 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]);