Hello,
We are investigating the usage of NAND and NOR flash in DM814x and DM816x boards for prototyping our custom board. Right now, we are focusing on the NAND flash. We are using EZSDK 5.04.00.11 and have built u-boot (minimum and 2nd stage for DM814x), linux kernel, and filesystem (using UBI/UBIFS). We have successfully programmed all the images into the NAND flash of the DM814x with the flash memory map provided in
http://processors.wiki.ti.com/index.php/TI81XX_PSP_U-Boot#NAND_Layout
When trying to boot from NAND, we made sure that the SPI flash is disabled. The bootargs and bootcmd arguments that we provide for u-boot are the following:
setenv bootargs 'console=ttyO0,115200n8 noinitrd ip=off mem=256M rootwait=1 rw ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs init=/init notifyk.vpssm3_sva=0xBF900000 earlyprintk'
setenv bootcmd 'nand read 0x81000000 0x00280000 0x300000;bootm 0x81000000'
On the first boot-up of the DM814x board after programming all the images into the NAND flash, the linux kernel already complained about the NAND flash having ECC errors as seen below.
UBIFS: start fixing up free space
UBIFS: free space fixup complete
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 199225344 bytes (194556 KiB, 189 MiB, 1569 LEBs)
UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:14.
devtmpfs: error mounting -2
Freeing init memory: 208K
Failed to execute /init. Attempting defaults...
INIT: version 2.84 booting
UBI: run torture test for PEB 1600
UBI error: ubi_io_read: error -74 (ECC error) while reading 131072 bytes from PEB 1600:0, read 131072 bytes
UBI error: torture_peb: read problems on freshly erased PEB 1600, must be bad
UBI error: erase_worker: failed to erase PEB 1600, error -5
UBI: mark PEB 1600 as bad
UBI: 10 PEBs left in the reserve
UBI: run torture test for PEB 985
UBI error: ubi_io_read: error -74 (ECC error) while reading 131072 bytes from PEB 985:0, read 131072 bytes
UBI error: torture_peb: read problems on freshly erased PEB 985, must be bad
UBI error: erase_worker: failed to erase PEB 985, error -5
UBI: mark PEB 985 as bad
UBI: 9 PEBs left in the reserve
After a reboot, the ECC error gets worse as seen below:
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 278:4096, read 126976 bytes
UBI warning: ubi_eba_copy_leb: error -74 while reading data from PEB 278
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 534:4096, read 126976 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 1001:4096, read 126976 bytes
UBI warning: ubi_eba_copy_leb: error -74 while reading data from PEB 1001
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 535:4096, read 126976 bytes
UBIFS: recovery needed
UBI error: ubi_io_read: error -74 (ECC error) while reading 2048 bytes from PEB 566:49152, read 2048 bytes
UBIFS error (pid 1): ubifs_leb_read: reading 2048 bytes from LEB 274:45056 failed, error -74
UBI error: ubi_io_read: error -74 (ECC error) while reading 2048 bytes from PEB 536:8192, read 2048 bytes
UBIFS error (pid 1): ubifs_leb_read: reading 2048 bytes from LEB 8:4096 failed, error -74
UBI error: ubi_io_read: error -74 (ECC error) while reading 126976 bytes from PEB 1:4096, read 126976 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 92160 bytes from PEB 565:38912, read 92160 bytes
UBI error: ubi_io_read: error -74 (ECC error) while reading 118784 bytes from PEB 0:12288, read 118784 bytes
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size: 199225344 bytes (194556 KiB, 189 MiB, 1569 LEBs)
UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format: w4/r0 (latest is w4/r0)
UBIFS: default compressor: zlib
UBIFS: reserved for root: 0 bytes (0 KiB)
VFS: Mounted root (ubifs filesystem) on device 0:14.
devtmpfs: mounted
Freeing init memory: 208K
Failed to execute /init. Attempting defaults...
INIT: version 2.84 booting
UBI: run torture test for PEB 279
UBI error: ubi_io_read: error -74 (ECC error) while reading 131072 bytes from PEB 279:0, read 131072 bytes
UBI error: torture_peb: read problems on freshly erased PEB 279, must be bad
UBI error: erase_worker: failed to erase PEB 279, error -5
UBI: mark PEB 279 as bad
UBI: 8 PEBs left in the reserve
Can this issue be fixed in the latest EZSDK 5.04.00.11? Is the computation in the linux kernel for BCH8 correct in this release? Is there a way to configure the kernel and u-boot to use Hamming instead of BCH8 if BCH8 have some issues?
The same issue happens in our DM816x board as well. I'm assuming that this is not a hardware issue but more likely a software bug in the kernel.
Any help is appreciated to determine if NAND flash is a viable option for us.
Regards,
Maynard