Processor: AM3894
SDK: u-boot-2010.06-psp04.04.00.01, linux-2.6.37-psp04.04.00.01
NAND: Micron MT29F2G16Ax
Kernel File system: JFFS2
ECC method: Hamming Code
When kernel start up, following information is given:
Write verify error (ECC correction failed) at 0033d000.
Wrote:
00000000: 85 19 02 e0 50 00 00 00 d5 3b 8c 47 02 00 00 00
00000010: 02 00 00 00 80 81 00 00 00 00 00 00 9c 00 00 00
00000020: 54 01 00 00 54 01 00 00 54 01 00 00 90 00 00 00
... ...
000007d0: f4 ba df 86 e1 cd 22 77 f9 ff 17 40 a0 36 13 48
000007e0: 7d 04 50 3d 40 80 01 00 08 29 70 e0 85 19 02 e0
000007f0: a6 0a 00 00 78 f7 16 e9 45 00 00 00 c3 03 00 00
Read back:
00000000: 85 19 02 e0 50 00 00 00 d5 3b 8c 47 02 00 00 00
00000010: 02 00 00 00 80 81 00 00 00 00 00 00 9c 00 00 00
00000020: 54 01 00 00 54 01 00 00 54 01 00 00 90 00 00 00
... ...
000007d0: f4 ba df 86 e1 cd 22 77 f9 ff 17 40 a0 36 13 48
000007e0: 7d 04 50 3d 40 80 01 00 08 29 70 e0 85 19 02 e0
000007f0: a6 0a 00 00 78 f7 16 e9 45 00 00 00 c3 03 00 00
We compare the data, find the error as below.
Wrote, 00000090: 69 af 72 (76) 78 5e 4c 56 7d 8c 14 e5 19 7f 66 76
Read, 00000090: 69 af 72 (66) 78 5e 4c 56 7d 8c 14 e5 19 7f 66 76
Wrote error or Reading error ? We trace the problem in u-boot.
First, we use 'nand dump' command to display the data in Flash
and find that there is no error with it (the same with previous Wrote).
If we use 'nand read' command, there is error as previous Read back (0x76 -> 0x66).
Tracing the source code in u-boot-2010.06-psp04.04.00.01, the 'nand dump' command
is ti81xx_nand_read_page_raw_bch() function and the 'nand read' command is
nand_read_page_hwecc() function. If we remove the
chip->ecc.hwctl(mtd, NAND_ECC_READ);
in nand_read_page_hwecc() function, the 'nand read' command is ok and
the read back data is the same with wrote.
I think that the 'chip->ecc.hwctl(mtd, NAND_ECC_READ)' must be used. Why it can cause the problem?
Someone can give some advice to fix the problem ?
Thanks for your advice.