* [U-Boot] [PATCH] cmd_nand.c: Fix 'nand dump' after latest MTD resync
@ 2012-02-23 22:47 Tom Rini
2012-02-24 0:55 ` Tom Rini
2012-02-28 20:56 ` Scott Wood
0 siblings, 2 replies; 3+ messages in thread
From: Tom Rini @ 2012-02-23 22:47 UTC (permalink / raw)
To: u-boot
With 2a8e0fc nand_do_read_ops changed in behavior slightly (keeping in sync
with the kernel which did this change in b64d39d8) such that the OOB data is
always copied into oobbuf and never appended to datbuf. Within U-Boot only
the nand_dump function (for the dump nand subcommand) was expecting the OOB
data to only be appended to datbuf. So we now change nand_dump to not
malloc extra space, correct the comment about datbuf and OOB data and switch
the pointer to oobbuf before printing.
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Tom Rini <trini@ti.com>
---
common/cmd_nand.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 3e2edb8..fa96a52 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -48,7 +48,7 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
last = off;
- datbuf = malloc(nand->writesize + nand->oobsize);
+ datbuf = malloc(nand->writesize);
oobbuf = malloc(nand->oobsize);
if (!datbuf || !oobbuf) {
puts("No memory for page buffer\n");
@@ -59,7 +59,7 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
struct mtd_oob_ops ops;
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 = nand->writesize;
ops.ooblen = nand->oobsize;
ops.mode = MTD_OOB_RAW;
@@ -85,6 +85,7 @@ static int nand_dump(nand_info_t *nand, ulong off, int only_oob, int repeat)
}
puts("OOB:\n");
i = nand->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]);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] cmd_nand.c: Fix 'nand dump' after latest MTD resync
2012-02-23 22:47 [U-Boot] [PATCH] cmd_nand.c: Fix 'nand dump' after latest MTD resync Tom Rini
@ 2012-02-24 0:55 ` Tom Rini
2012-02-28 20:56 ` Scott Wood
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2012-02-24 0:55 UTC (permalink / raw)
To: u-boot
On Thu, Feb 23, 2012 at 3:47 PM, Tom Rini <trini@ti.com> wrote:
> With 2a8e0fc nand_do_read_ops changed in behavior slightly (keeping in sync
> with the kernel which did this change in b64d39d8) such that the OOB data is
> always copied into oobbuf and never appended to datbuf. ?Within U-Boot only
> the nand_dump function (for the dump nand subcommand) was expecting the OOB
> data to only be appended to datbuf. ?So we now change nand_dump to not
> malloc extra space, correct the comment about datbuf and OOB data and switch
> the pointer to oobbuf before printing.
bah, sorry for the dupe, git send-email lied.
--
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] cmd_nand.c: Fix 'nand dump' after latest MTD resync
2012-02-23 22:47 [U-Boot] [PATCH] cmd_nand.c: Fix 'nand dump' after latest MTD resync Tom Rini
2012-02-24 0:55 ` Tom Rini
@ 2012-02-28 20:56 ` Scott Wood
1 sibling, 0 replies; 3+ messages in thread
From: Scott Wood @ 2012-02-28 20:56 UTC (permalink / raw)
To: u-boot
On 02/23/2012 04:47 PM, Tom Rini wrote:
> With 2a8e0fc nand_do_read_ops changed in behavior slightly (keeping in sync
> with the kernel which did this change in b64d39d8) such that the OOB data is
> always copied into oobbuf and never appended to datbuf. Within U-Boot only
> the nand_dump function (for the dump nand subcommand) was expecting the OOB
> data to only be appended to datbuf. So we now change nand_dump to not
> malloc extra space, correct the comment about datbuf and OOB data and switch
> the pointer to oobbuf before printing.
>
> Cc: Scott Wood <scottwood@freescale.com>
> Signed-off-by: Tom Rini <trini@ti.com>
> ---
> common/cmd_nand.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
Applied to u-boot-nand-flash
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-28 20:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 22:47 [U-Boot] [PATCH] cmd_nand.c: Fix 'nand dump' after latest MTD resync Tom Rini
2012-02-24 0:55 ` Tom Rini
2012-02-28 20:56 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox