diff options
author | Ladislav Michl <ladis@linux-mips.org> | 2009-03-13 14:38:19 +0100 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2009-03-17 12:04:22 -0500 |
commit | 0987505540918b2464b73069af3a5b766dbd3ceb (patch) | |
tree | 489ba9b709aa5f9e609e4f172dc7a40b63875085 | |
parent | b3dd629e78870ba2dc9f8032978721c0fa02a856 (diff) | |
download | u-boot-imx-0987505540918b2464b73069af3a5b766dbd3ceb.zip u-boot-imx-0987505540918b2464b73069af3a5b766dbd3ceb.tar.gz u-boot-imx-0987505540918b2464b73069af3a5b766dbd3ceb.tar.bz2 |
NAND: Make nboot skip bad blocks
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:
Device 0 bad blocks:
00780000
014a0000
02000000
02cc0000
04aa0000
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 ...
...
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r-- | common/cmd_nand.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); |