Skip to contentSkip to conversation

Make nboot skip bad blocks

PATCH New Ladislav Michl 4 participants 5 messages Mar 13, 2009 – Mar 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make nboot skip bad blocks

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

common/cmd_nand.c +2 -3
index 11f9096..f915fb6 100644
@@ -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);
#1 lore raw

PATCH 1/1 Make nboot skip bad blocks

Quoted 3 lines · 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

#2 lore raw

PATCH 1/1 Make nboot skip bad blocks

Quoted 9 lines · Mike Frysinger
Quoted 3 lines · 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

#3 lore raw

PATCH 1/1 Make nboot skip bad blocks

Dear Scott,

In message <[email protected]>

Quoted 11 lines · Ladislav Michl
Quoted 9 lines · Mike Frysinger
Quoted 3 lines · 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 ?

Quoted 5 lines

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

Signature · 4 lines
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.
#4 lore raw

PATCH 1/1 Make nboot skip bad blocks

In reply to Ladislav Michl
Quoted 11 lines · Ladislav Michl
Quoted 9 lines · Mike Frysinger
Quoted 3 lines · 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 ?

Quoted 5 lines

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