* [U-Boot] [PATCH] Make nboot skip bad blocks
@ 2009-03-13 13:38 Ladislav Michl
2009-03-15 21:59 ` Mike Frysinger
0 siblings, 1 reply; 5+ messages in thread
From: Ladislav Michl @ 2009-03-13 13:38 UTC (permalink / raw)
To: u-boot
Hi,
nboot command currently does not skip bad blocks and gives read error when
loading image stored over bad block. With patch applied, nboot works as
expected:
# nand bad
Device 0 bad blocks:
00780000
014a0000
02000000
02cc0000
04aa0000
# boot
Loading from NAND 128MiB 3,3V 8-bit, offset 0x2c00000
Image Name: Linux-2.6.22-omap1
Created: 2008-11-20 23:44:32 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1052520 Bytes = 1 MB
Load Address: 10008000
Entry Point: 10008000
Skipping bad block 0x02cc0000
Automatic boot of image at addr 0x10400000 ...
...
CHANGELOG
* nboot: skip bad block when loading image from NAND
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 11f9096..f915fb6 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -511,7 +511,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
printf("\nLoading from %s, offset 0x%lx\n", nand->name, offset);
cnt = nand->writesize;
- r = nand_read(nand, offset, &cnt, (u_char *) addr);
+ r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
if (r) {
puts("** Read error\n");
show_boot_progress (-56);
@@ -543,8 +543,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,
}
show_boot_progress (57);
- /* FIXME: skip bad blocks */
- r = nand_read(nand, offset, &cnt, (u_char *) addr);
+ r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr);
if (r) {
puts("** Read error\n");
show_boot_progress (-58);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Make nboot skip bad blocks
2009-03-13 13:38 [U-Boot] [PATCH] Make nboot skip bad blocks Ladislav Michl
@ 2009-03-15 21:59 ` Mike Frysinger
2009-03-16 15:15 ` Ladislav Michl
0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2009-03-15 21:59 UTC (permalink / raw)
To: u-boot
On Friday 13 March 2009 09:38:19 Ladislav Michl wrote:
> nboot command currently does not skip bad blocks and gives read error when
> loading image stored over bad block. With patch applied, nboot works as
> expected:
iirc, some people proposed a new command or an option to nboot to get skip
behavior (e.g. nboot.jffs2), but i dont see the value in nboot never skipping
bad blocks. when would anyone ever want to use a boot command and have bad
blocks attempt to be processed ?
i.e. your patch sounds good to me ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090315/feae4342/attachment.pgp
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Make nboot skip bad blocks
2009-03-15 21:59 ` Mike Frysinger
@ 2009-03-16 15:15 ` Ladislav Michl
2009-03-16 19:59 ` Wolfgang Denk
2009-03-17 17:00 ` Scott Wood
0 siblings, 2 replies; 5+ messages in thread
From: Ladislav Michl @ 2009-03-16 15:15 UTC (permalink / raw)
To: u-boot
On Sun, Mar 15, 2009 at 05:59:28PM -0400, Mike Frysinger wrote:
> On Friday 13 March 2009 09:38:19 Ladislav Michl wrote:
> > nboot command currently does not skip bad blocks and gives read error when
> > loading image stored over bad block. With patch applied, nboot works as
> > expected:
>
> iirc, some people proposed a new command or an option to nboot to get skip
> behavior (e.g. nboot.jffs2), but i dont see the value in nboot never skipping
> bad blocks. when would anyone ever want to use a boot command and have bad
> blocks attempt to be processed ?
Ah... Are you reffering to "Loading from NAND using 'nboot' Periodically Fails
Where 'nand read' Succeeds" thread?
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/41977/
It seems conclusion was to skip bad blocks by default, but no patch went in.
I'm considering it a bug fix and therefore -rc material...
Best regards,
ladis
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Make nboot skip bad blocks
2009-03-16 15:15 ` Ladislav Michl
@ 2009-03-16 19:59 ` Wolfgang Denk
2009-03-17 17:00 ` Scott Wood
1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2009-03-16 19:59 UTC (permalink / raw)
To: u-boot
Dear Scott,
In message <20090316151552.GA4330@localhost.localdomain>
Ladislav Michl wrote:
> On Sun, Mar 15, 2009 at 05:59:28PM -0400, Mike Frysinger wrote:
> > On Friday 13 March 2009 09:38:19 Ladislav Michl wrote:
> > > nboot command currently does not skip bad blocks and gives read error when
> > > loading image stored over bad block. With patch applied, nboot works as
> > > expected:
> >
> > iirc, some people proposed a new command or an option to nboot to get skip
> > behavior (e.g. nboot.jffs2), but i dont see the value in nboot never skipping
> > bad blocks. when would anyone ever want to use a boot command and have bad
> > blocks attempt to be processed ?
>
> Ah... Are you reffering to "Loading from NAND using 'nboot' Periodically Fails
> Where 'nand read' Succeeds" thread?
> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/41977/
> It seems conclusion was to skip bad blocks by default, but no patch went in.
> I'm considering it a bug fix and therefore -rc material...
Could you please comment?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It's a small world, but I wouldn't want to paint it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] Make nboot skip bad blocks
2009-03-16 15:15 ` Ladislav Michl
2009-03-16 19:59 ` Wolfgang Denk
@ 2009-03-17 17:00 ` Scott Wood
1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2009-03-17 17:00 UTC (permalink / raw)
To: u-boot
On Mon, Mar 16, 2009 at 04:15:52PM +0100, Ladislav Michl wrote:
> On Sun, Mar 15, 2009 at 05:59:28PM -0400, Mike Frysinger wrote:
> > On Friday 13 March 2009 09:38:19 Ladislav Michl wrote:
> > > nboot command currently does not skip bad blocks and gives read error when
> > > loading image stored over bad block. With patch applied, nboot works as
> > > expected:
> >
> > iirc, some people proposed a new command or an option to nboot to get skip
> > behavior (e.g. nboot.jffs2), but i dont see the value in nboot never skipping
> > bad blocks. when would anyone ever want to use a boot command and have bad
> > blocks attempt to be processed ?
>
> Ah... Are you reffering to "Loading from NAND using 'nboot' Periodically Fails
> Where 'nand read' Succeeds" thread?
> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/41977/
> It seems conclusion was to skip bad blocks by default, but no patch went in.
> I'm considering it a bug fix and therefore -rc material...
No, it was worse than that -- I sent a patch to fix it, but the boot
portion of it was broken and incomplete. I'll apply this and send
another patch to fix another bug.
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-17 17:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-13 13:38 [U-Boot] [PATCH] Make nboot skip bad blocks Ladislav Michl
2009-03-15 21:59 ` Mike Frysinger
2009-03-16 15:15 ` Ladislav Michl
2009-03-16 19:59 ` Wolfgang Denk
2009-03-17 17:00 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox