Hi,
we are faceing a serious problem for months now and is really urgent. We can't get UBIFS to work and beleive that there might man NAND driver problem.
We are using a kernel based on linux-omap3.git (97101e6c43c0e956dbc2863bd3e50ab70f987a91) for the DM8148 Centaurus. So all patches for subpages should be included. The linux system is based on a standard yocto poky-denzil build.
The NAND flash is a Micron MT29F4G16ABBDAH4-IT:
512 MiB, 128KiB blocks, 2KiB pages (min I/O), 512 B subapges. 16-bit interface
we are not sure if it only supports HW-ECC 4-bit (since it only states minimum 4 bit ECC), but it has a 4-bit internal ECC engine.
We tried both 8-bit and 4-bit BCH ECC for the OMAP NAND controller config in the Kernel, but it fails in both modes.
mkfs.ubifs -F -x lzo -U -v --root=$RFSDIR --min-io-size=2048 --leb-size=129024 --max-leb-cnt=3942 -o rfs.ubifs # Ubinize the ubifs file system ubinize -o rfs_ubifs.img -m 2048 -p 128KiB -s 512 -O 512 ubinize.cfg
The ubinize config just states a single volume (dynamic 485 MiB, autoresize).
Since we had errors, we tried different combinations instead, e.g., leb-size 124KiB and subpages to 2048, ... . We could mount the volume as RFS, but had problems that the number of UBI errors increased after some time and sometimes the UBIFS was not mountable anymore.
All errors (dirty workaround settings, correct settings) look like these (here BCH4 with the actual correct settings):
ubiattach /dev/ubi_ctrl -m 7 -O 512 UBI: attaching mtd7 to ubi0 UBI: physical eraseblock size: 131072 bytes (128 KiB) UBI: logical eraseblock size: 129024 bytes UBI: smallest flash I/O unit: 2048 UBI: sub-page size: 512 UBI: VID header offset: 512 (aligned 512) UBI: data offset: 2048 UBI: max. sequence number: 0 UBI: volume 0 ("rootfs") re-sized from 3942 to 3990 LEBs UBI: attached mtd7 to ubi0 UBI: MTD device name: "n_Filesystem/UBIFS" UBI: MTD device size: 505 MiB UBI: number of good PEBs: 4034 UBI: number of bad PEBs: 8 UBI: number of corrupted PEBs: 0 UBI: max. allowed volumes: 128 UBI: wear-leveling threshold: 4096 UBI: number of internal volumes: 1 UBI: number of user volumes: 1 UBI: available PEBs: 0 UBI: total number of reserved PEBs: 4034 UBI: number of PEBs reserved for bad PEB handling: 40 UBI: max/mean erase counter: 0/0 UBI: image sequence number: 1455614892 UBI: background thread "ubi_bgt0d" started, PID 538 UBI device number 0, total 4034 LEBs (520482816 bytes, 496.4 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB) root@q7centaurus:~# UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4039:512, read 512 bytes UBI: run torture test for PEB 4039 UBI: PEB 4039 passed torture test, do not mark it as bad UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4039:512, read 512 bytes UBI: run torture test for PEB 4039 UBI: PEB 4039 passed torture test, do not mark it as bad UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4039:512, read 512 bytes UBI: run torture test for PEB 4039 UBI: PEB 4039 passed torture test, do not mark it as bad UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4039:512, read 512 bytes UBI: run torture test for PEB 4039 UBI: PEB 4039 passed torture test, do not mark it as bad UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4039:512, read 512 bytes UBI: run torture test for PEB 4039
....
Or e.g.:
root@q7centaurus:~# UBI: PEB 1 passed torture test, do not mark it as bad UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4040:512, read 512 bytes UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1:512, read 512 bytes UBI: run torture test for PEB 1 UBI: PEB 1 passed torture test, do not mark it as bad UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 4040:512, read 512 bytes UBI error: ubi_io_read: error -74 (ECC error) while reading 512 bytes from PEB 1:512, read 512 bytes UBI: run torture test for PEB 1
Although sometimes when erasing the NAND from UBoot/Kernel and reformatting the partition with the ubifs/ubinized image from the Kernel it was able to attach and mount without errors. After detaching and reataching the it again the errors appeared.
If you use the mtd_stresstest and mtd_subpagetest on mtd7 we get errors like these:
root@q7centaurus:~# modprobe mtd_stresstest dev=7 ================================================= mtd_stresstest: MTD device: 7 mtd_stresstest: MTD device size 529793024, eraseblock size 131072, page size 2048, count of eraseblocks 4042, pages per eraseblock 644 mtd_stresstest: scanning for bad eraseblocks mtd_stresstest: block 37 is bad mtd_stresstest: block 120 is bad mtd_stresstest: block 1702 is bad mtd_stresstest: block 1748 is bad mtd_stresstest: block 1804 is bad mtd_stresstest: block 1949 is bad mtd_stresstest: block 3092 is bad mtd_stresstest: block 3260 is bad mtd_stresstest: scanned 4042 eraseblocks, 8 are bad mtd_stresstest: doing operations mtd_stresstest: 0 operations done mtd_stresstest: error: read failed at 0x11b2346e mtd_stresstest: error -74 occurred ================================================= FATAL: Error inserting mtd_stresstest (/lib/modules/2.6.37_Trunk_Build_122-dirty-DM8148+/kernel/drivers/mtd/tests/mtd_stresstest.ko):e root@q7centaurus:~# modprobe mtd_subpagetest dev=7 ================================================= mtd_subpagetest: MTD device: 7 mtd_subpagetest: MTD device size 529793024, eraseblock size 131072, page size 2048, subpage size 512, count of eraseblocks 0, pages p4 mtd_subpagetest: scanning for bad eraseblocks mtd_subpagetest: block 37 is bad mtd_subpagetest: block 120 is bad mtd_subpagetest: block 1702 is bad mtd_subpagetest: block 1748 is bad mtd_subpagetest: block 1804 is bad mtd_subpagetest: block 1949 is bad mtd_subpagetest: block 3092 is bad mtd_subpagetest: block 3260 is bad mtd_subpagetest: scanned 4042 eraseblocks, 8 are bad mtd_subpagetest: erasing whole device mtd_subpagetest: erased 4042 eraseblocks mtd_subpagetest: writing whole device mtd_subpagetest: written up to eraseblock 0 mtd_subpagetest: written up to eraseblock 256 mtd_subpagetest: written up to eraseblock 512 mtd_subpagetest: written up to eraseblock 768 mtd_subpagetest: written up to eraseblock 1024 mtd_subpagetest: written up to eraseblock 1280 mtd_subpagetest: written up to eraseblock 1536 mtd_subpagetest: written up to eraseblock 1792 mtd_subpagetest: written up to eraseblock 2048 mtd_subpagetest: written up to eraseblock 2304 mtd_subpagetest: written up to eraseblock 2560 mtd_subpagetest: written up to eraseblock 2816 mtd_subpagetest: written up to eraseblock 3072 mtd_subpagetest: written up to eraseblock 3328 mtd_subpagetest: written up to eraseblock 3584 mtd_subpagetest: written up to eraseblock 3840 mtd_subpagetest: written 4042 eraseblocks mtd_subpagetest: verifying all eraseblocks mtd_subpagetest: error: read failed at 0x0 mtd_subpagetest: error -74 occurred ================================================= FATAL: Error inserting mtd_subpagetest (/lib/modules/2.6.37_Trunk_Build_122-dirty-DM8148+/kernel/drivers/mtd/tests/mtd_subpagetest.koe
Has somebody any clues? Thanks in advance!
Kind Regards,
Markus Hofstätter