Hi,
I encountered a NAND issue on an AM335x custom hardware. This issue came up after about 1000 units were successfully tested without any issues.
U-Boot reports lots of "omap-elm: uncorrectable ECC errors" when reading from NAND. Issue came up with U-Boot 2014.10. But I went through all GPMC/NAND related changes in mainline U-Boot and cherry-picked those changes. This did not help. Also Linux is very unhappy with the NAND. Linux kernel is TI's 3.12.15 from the ti Linux repository.
The NAND chip is from Micron: MT29F2G08ABAEA.
U-Boot is configured like this:
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
CONFIG_SYS_NAND_PAGE_SIZE)
#define CONFIG_SYS_NAND_PAGE_SIZE 2048
#define CONFIG_SYS_NAND_OOBSIZE 64
#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
/* NAND: driver related configs */
#define CONFIG_NAND_OMAP_GPMC
#define CONFIG_NAND_OMAP_ELM
#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
10, 11, 12, 13, 14, 15, 16, 17, \
18, 19, 20, 21, 22, 23, 24, 25, \
26, 27, 28, 29, 30, 31, 32, 33, \
34, 35, 36, 37, 38, 39, 40, 41, \
42, 43, 44, 45, 46, 47, 48, 49, \
50, 51, 52, 53, 54, 55, 56, 57, }
#define CONFIG_SYS_NAND_ECCSIZE 512
#define CONFIG_SYS_NAND_ECCBYTES 14
#define CONFIG_SYS_NAND_ONFI_DETECTION
This is the simple test from U-Boot:
U-Boot# nand erase.chip
NAND erase.chip: device 0 whole chip
Erasing at 0xffe0000 -- 100% complete.
OK
U-Boot# fatload mmc 0 82000000 MLO
reading MLO
76436 bytes read in 9 ms (8.1 MiB/s)
U-Boot# nand write 82000000 0 ${filesize}
NAND write: device 0 offset 0x0, size 0x12a94
76436 bytes written: OK
U-Boot# nand read 82000000 0 ${filesize}
NAND read: device 0 offset 0x0, size 0x12a94
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
...
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
76436 bytes read: OK
U-Boot#
Then I did some hacking and found out a strange behavior. Perhaps that might lead to an idea.
I wrote some pattern 0x12345678 to NAND and then did some read tests:
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
2048 bytes read: OK
U-Boot# nand read 82100000 0 100
NAND read: device 0 offset 0x0, size 0x100 (so reading 0x100 fails)
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
256 bytes read: OK
U-Boot# nand read 82100000 0 1
NAND read: device 0 offset 0x0, size 0x1
1 bytes read: OK
U-Boot# nand read 82100000 0 100
NAND read: device 0 offset 0x0, size 0x100 (now reading 0x100 is fine)
256 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
2048 bytes read: OK
U-Boot# nand read 82100000 0 1000
NAND read: device 0 offset 0x0, size 0x1000
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
4096 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
2048 bytes read: OK
U-Boot# nand read 82100000 0 1000
NAND read: device 0 offset 0x0, size 0x1000
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
4096 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
2048 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
2048 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
2048 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
2048 bytes read: OK
U-Boot# nand read 82100000 0 801
NAND read: device 0 offset 0x0, size 0x801
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
2049 bytes read: OK
U-Boot# nand read 82100000 0 800
NAND read: device 0 offset 0x0, size 0x800
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
omap-elm: uncorrectable ECC errors
2048 bytes read: OK
U-Boot#
Any idea? I went through lots of NAND related postings but did not catch a clue. Maybe a hardware issue, but the NAND
is directly attached to the Sitara CPU with only pullups on CE, WP# and WAIT#. And lots of boards are fine!
Best regards,
Matthias