AnsweredAssumed Answered

ECC Error when using H27UBG8T2BTR/CTR with Linux/iMX28

Question asked by Gao Cui on May 19, 2014
Latest reply on May 25, 2014 by igorpadykov

Has anybody tried H27UBG8T2BTR/CTR on linux for iMX28?

 

 

I'm trying to add some new NAND flash support to the kernel for iMX28 from L2.6.35_10.12.01_SDK. But it seems not to work. I'm using UBIFS as the filesystem.

 

For the NAND H27UBG8T2CTR, here is the information printed by kernel while booting. I added some items in the array in nand_device_info.c, and modified code to support the page geometry of 8192+640.

 

-----------------------------                                                 

NAND Flash Device Information                                                 

-----------------------------                                                 

Manufacturer      : Hynix (0xad)                                              

Device Code       : 0xd7                                                      

Cell Technology   : MLC                                                       

Chip Size         : 4 GiB                                                     

Pages per Block   : 256                                                       

Page Geometry     : 8192+640                                                  

ECC Strength      : 20 bits                                                   

ECC Size          : 1024 B                                                    

Data Setup Time   : 15 ns                                                     

Data Hold Time    : 10 ns                                                     

Address Setup Time: 20 ns                                                     

GPMI Sample Delay : 6 ns                                                      

tREA              : 20 ns                                                     

tRLOH             : 5 ns                                                      

tRHOH             : 15 ns                                                     

Description       : H27UBG8T2BTR (4GB, 1CE); H27UBG8T2CTR (4GB, 1CE)          

-----------------                                                             

Physical Geometry                                                             

-----------------                                                             

Chip Count             : 1                                                    

Page Data Size in Bytes: 8192 (0x2000)                                        

Page OOB Size in Bytes : 640                                                  

Block Size in Bytes    : 2097152 (0x200000)                                   

Block Size in Pages    : 256 (0x100)                                          

Chip Size in Bytes     : 4294967296 (0x100000000)                             

Chip Size in Pages     : 524288 (0x80000)                                     

Chip Size in Blocks    : 2048 (0x800)                                         

Medium Size in Bytes   : 4294967296 (0x100000000)                             

------------                                                                  

NFC Geometry                                                                  

------------                                                                  

ECC Algorithm          : BCH                                                  

ECC Strength           : 20                                                   

Page Size in Bytes     : 8832                                                 

Metadata Size in Bytes : 10                                                   

ECC Chunk Size in Bytes: 512                                                  

ECC Chunk Count        : 16                                                   

Payload Size in Bytes  : 8192                                                 

Auxiliary Size in Bytes: 28                                                   

Auxiliary Status Offset: 12                                                   

Block Mark Byte Offset : 7694                                                 

Block Mark Bit Offset  : 4                                                    

 

 

 

 

When I created a new ubi volume on /dev/mtd1 and mounted it at the first time, evrything is ok. And after I umounted it and then mount it again, I got some io error. The error -74 is EBADMSG which means ECC failed. See the following logs:

 

 

$ ubiformat /dev/mtd1                                          

ubiformat: mtd1 (nand), size 2013265920 bytes (1.9 GiB), 960 eraseblocks of 2097

152 bytes (2.0 MiB), min. I/O size 8192 bytes                                 

libscan: scanning eraseblock 959 -- 100 % complete                            

ubiformat: 959 eraseblocks are supposedly empty                               

ubiformat: 1 bad eraseblocks found, numbers: 517                              

ubiformat: formatting eraseblock 959 -- 100 % complete                        

$                                                              

$ ubiattach /dev/ubi_ctrl -m 1                                 

UBI: attaching mtd1 to ubi0                                                   

UBI: physical eraseblock size:   2097152 bytes (2048 KiB)                     

UBI: logical eraseblock size:    2080768 bytes                                

UBI: smallest flash I/O unit:    8192                                         

UBI: VID header offset:          8192 (aligned 8192)                          

UBI: data offset:                16384                                        

UBI: attached mtd1 to ubi0                                                    

UBI: MTD device name:            "gpmi-nfc-general-use"                       

UBI: MTD device size:            1920 MiB                                     

UBI: number of good PEBs:        959                                          

UBI: number of bad PEBs:         1                                            

UBI: max. allowed volumes:       128                                          

UBI: wear-leveling threshold:    4096                                         

UBI: number of internal volumes: 1                                            

UBI: number of user volumes:     0                                            

UBI: available PEBs:             946                                          

UBI: total number of reserved PEBs: 13                                        

UBI: number of PEBs reserved for bad PEB handling: 9                          

UBI: max/mean erase counter: 0/0                                              

UBI: image sequence number: 440121938                                         

UBI: background thread "ubi_bgt0d" started, PID 2832                          

UBI device number 0, total 959 LEBs (1995456512 bytes, 1.9 GiB), available 946 L

EBs (1968406528 bytes, 1.8 GiB), LEB size 2080768 bytes (2.0 MiB)             

$                                                              

$ ubimkvol /dev/ubi0 -N rootfs -s 1024MiB                      

ubiblka: unknown partition table                                             

Volume ID 0, size 517 LEBs (1075757056 bytes, 1.0 GiB), LEB size 2080768 bytes (

2.0 MiB), dynamic, name "rootfs", alignment 1                                 

$                                                              

$ mount -t ubifs ubi0:rootfs /mnt/pp/                          

UBIFS: default file-system created                                            

UBIFS: mounted UBI device 0, volume 0, name "rootfs"                          

UBIFS: file system size:   1057030144 bytes (1032256 KiB, 1008 MiB, 508 LEBs) 

UBIFS: journal size:       33292288 bytes (32512 KiB, 31 MiB, 16 LEBs)        

UBIFS: media format:       w4/r0 (latest is w4/r0)                            

UBIFS: default compressor: lzo                                                

UBIFS: reserved for root:  4952683 bytes (4836 KiB)                           

$                                                              

$ umount /mnt/pp/                                              

UBIFS: un-mount UBI device 0, volume 0                                        

$                                                              

$ mount -t ubifs ubi0:rootfs /mnt/pp/                          

UBI error: ubi_io_read: error -74 while reading 2080768 bytes from PEB 513:16384

, read 2080768 bytes                                                          

UBI error: ubi_io_read: error -74 while reading 2080768 bytes from PEB 513:16384

, read 2080768 bytes                                                          

UBI error: ubi_io_read: error -74 while reading 2080768 bytes from PEB 514:16384

, read 2080768 bytes                                                          

UBIFS: recovered master node from LEB 1                                       

UBIFS: mounted UBI device 0, volume 0, name "rootfs"                          

UBIFS: file system size:   1057030144 bytes (1032256 KiB, 1008 MiB, 508 LEBs) 

UBIFS: journal size:       33292288 bytes (32512 KiB, 31 MiB, 16 LEBs)        

UBIFS: media format:       w4/r0 (latest is w4/r0)                            

UBIFS: default compressor: lzo                                                

UBIFS: reserved for root:  4952683 bytes (4836 KiB)                           

$                                                              

$ umount /mnt/pp/                                              

UBIFS: un-mount UBI device 0, volume 0                                        

 

 

But if I run nandtest with /dev/mtd1, it could pass it without errors. I tried ext3 filesystem on /dev/mtdblock1, it also failed with some I/O error when I was writing a lot of files on it.

 

And I tried another NAND H27UBG8T2BTR. When I was trying to mount the UBI partition the second time, it told me some PEB is scrubbed and run torture test for it.

 

So could iMX28 support such kind of NAND? Or is anything I did wrong? Thanks!

 

The datasheet could be found in the attachment.

Outcomes