Skip to contentSkip to conversation

am35xx, twister: could not write nand flash

U-Boot Heiko Schocher 2 participants 2 messages Jun 15, 2012

lore
Share & tools
lore
#0 lore raw

Hello Scott,

I currently tried current U-Boot HEAD

commit fedab338f3459315cb69627fcf46032ec8df1753
Merge: 74b5b5d f6b690e
Author: Wolfgang Denk <[email protected]>
Date: Thu Jun 7 23:42:17 2012 +0200

Merge branch 'master' of git://git.denx.de/u-boot-video

on the twister board, and detected that a "run update" fails with:

twister => run update
SW ECC selected

NAND erase: device 0 offset 0x80000, size 0x100000 Erasing at 0x160000 -- 100% complete.
OK

NAND write:
(board hangs ...)

Environment var:
update=nandecc sw;nand erase ${uboot_addr} 100000;nand write ${loadaddr} ${uboot_addr} 80000

So I started "git bisection":

[hs at pollux u-boot]$ git bisect start
[hs at pollux u-boot]$ git bisect bad
[hs at pollux u-boot]$ git bisect good 415d386877df49eb051b85ef74fa59a16dc17c7d
Bisecting: 211 revisions left to test after this (roughly 8 steps) [...]
[hs at pollux u-boot]$ git bisect bad 418396e212b59bf907dbccad997ff50f7eb61b16 is the first bad commit commit 418396e212b59bf907dbccad997ff50f7eb61b16

Author: Scott Wood <[email protected]>
Date:   Fri Mar 2 14:01:57 2012 -0600

nand: extend .raw accesses to work on multiple pages

A use for this is to read, modify, erase, and write an entire block as a single unit, as a replacement for the biterr command. This way gives more flexibility in that you can also test multiple bit errors, errors in the ECC, etc.

:040000 040000 ad5ce55a0fdf3a40e1aaae0546aae68bf7a0b480 f57e87a8630715e37170b5bb3a109a58b6b89333 M common
:040000 040000 83834ae80a73f20357132875078f643b4064f9dd ed0004e44b4da8b2734168a3950733afba0a0b64 M doc
[hs at pollux u-boot]$

following patch helps:

common/cmd_nand.c +1 -1
index fa44295..edeb093 100644
@@ -617,7 +617,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 
                 s = strchr(cmd, '.');
 
-               if (!strcmp(s, ".raw")) {
+               if ((s != NULL) && (!strcmp(s, ".raw"))) {
                         raw = 1;
 
                         if (arg_off(argv[3], &dev, &off, &size))

What do you think? Is this a correct fix, and I should sent this as a real patch, or did I overlook something?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw
Quoted 74 lines · Heiko Schocher

Hello Scott,

I currently tried current U-Boot HEAD

commit fedab338f3459315cb69627fcf46032ec8df1753
Merge: 74b5b5d f6b690e
Author: Wolfgang Denk <[email protected]>
Date: Thu Jun 7 23:42:17 2012 +0200

Merge branch 'master' of git://git.denx.de/u-boot-video

on the twister board, and detected that a "run update" fails with:

twister => run update
SW ECC selected

NAND erase: device 0 offset 0x80000, size 0x100000 Erasing at 0x160000 -- 100% complete.
OK

NAND write:
(board hangs ...)

Environment var:
update=nandecc sw;nand erase ${uboot_addr} 100000;nand write ${loadaddr} ${uboot_addr} 80000

So I started "git bisection":

[hs at pollux u-boot]$ git bisect start
[hs at pollux u-boot]$ git bisect bad
[hs at pollux u-boot]$ git bisect good 415d386877df49eb051b85ef74fa59a16dc17c7d
Bisecting: 211 revisions left to test after this (roughly 8 steps) [...]
[hs at pollux u-boot]$ git bisect bad 418396e212b59bf907dbccad997ff50f7eb61b16 is the first bad commit commit 418396e212b59bf907dbccad997ff50f7eb61b16

Author: Scott Wood <[email protected]>
Date:   Fri Mar 2 14:01:57 2012 -0600

nand: extend .raw accesses to work on multiple pages

A use for this is to read, modify, erase, and write an entire block
as a
single unit, as a replacement for the biterr command. This way gives more flexibility in that you can also test multiple bit errors, errors in the ECC, etc.

:040000 040000 ad5ce55a0fdf3a40e1aaae0546aae68bf7a0b480
f57e87a8630715e37170b5bb3a109a58b6b89333 M common
:040000 040000 83834ae80a73f20357132875078f643b4064f9dd
ed0004e44b4da8b2734168a3950733afba0a0b64 M doc
[hs at pollux u-boot]$

following patch helps:

common/cmd_nand.c +1 -1
index fa44295..edeb093 100644
@@ -617,7 +617,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc,
 char * const argv[])
 
                s = strchr(cmd, '.');
 
-               if (!strcmp(s, ".raw")) {
+               if ((s != NULL) && (!strcmp(s, ".raw"))) {
                        raw = 1;
 
                        if (arg_off(argv[3], &dev, &off, &size))
Quoted 2 lines

What do you think? Is this a correct fix, and I should sent this as a real patch, or did I overlook something?

This is the correct fix, and I have a pull request pending that contains it. :-)

-Scott