P1011 NAND_ECC_SOFT_BCH Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

P1011 NAND_ECC_SOFT_BCH Error

Jump to solution
2,626 Views
hyoungkikim
Contributor IV

hi experts  

 I am afraid I can't express what I think in English well. But I hope you can understand it

 i used U-boot and kernel from QorIQ-SDK-V1.8

when i used  P1011-FCM with HW_ECC_MODE  +   UBI filesystem

there is no error 

 recently in some of our products  there is a ecc error in U-boot ( when i nanddump the region which reported ecc erros, there are 1 or 2 bits errors)

 so  i tried to set  FCM to disable ECC   and  try to use NAND_ECC_SOFT_BCH

 in kernel and U-boot  i changed ecc.mode  ( below is what is chaged)

 in dirver/mtd/nand/fsl_elbc_nand.c 

 

static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)

 

-                    chip->ecc.mode = NAND_ECC_SOFT

+       chip->ecc.mode = NAND_ECC_SOFT_BCH

 

in U-boot there is no error

 

but in Kernel   when i access nand space , i got erros about ECC

 

 

root@p1020rdb-pd:~# flash_erase /dev/mtd3 0 0

Erasing 128 Kibyte @ 13e0000 -- 100 % complete

root@p1020rdb-pd:~# ubiformat /dev/mtd3

ubiformat: mtd3 (nand), size 20971520 bytes (20.0 MiB), 160 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes

libscan: scanning eraseblock 159 -- 100 % complete 

ubiformat: 160 eraseblocks are supposedly empty

ubiformat: formatting eraseblock 159 -- 100 % complete 

root@p1020rdb-pd:~# ubiattach -m 3     

[  511.034744] UBI: attaching mtd3 to ubi0

[  511.041059] ecc unrecoverable error

[  511.044593] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry

[  511.056915] ecc unrecoverable error

[  511.060452] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry

[  511.072135] ecc unrecoverable error

[  511.075728] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read only 64 bytes, retry

[  511.088458] ecc unrecoverable error

[  511.091997] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 2:0, read 64 bytes

[  511.101833] CPU: 0 PID: 1908 Comm: ubiattach Not tainted 3.12.37-rt51-QorIQ-SDK-V1.8+gf488de6 #50

[  511.110710] Call Trace:

[  511.113173] [df061ce0] [c0006c7c] show_stack+0x44/0x16c (unreliab

 

any tips and ideas are appreciated 

 

thanks in advance

0 Kudos
Reply
1 Solution
2,611 Views
yipingwang
NXP TechSupport
NXP TechSupport

In file include/configs/p1_p2_rdb_pc.h in u-boot, please modify the source code as the following.

#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
| (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
| BR_PS_8 /* Port Size = 8 bit */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid

=>

#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
| BR_DECC_OFF /* no error corr */ \
| BR_PS_8 /* Port Size = 8 bit */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid

 

In Linux Kernel, please enable MTD_NAND_ECC_BCH.

Symbol: MTD_NAND_ECC_BCH [=n] 
Type : boolean 
Prompt: Support software BCH ECC
     Location:

         -> Device Drivers
             -> Memory Technology Device (MTD) support (MTD [=y]) 
                 -> NAND Device Support (MTD_NAND [=y])

View solution in original post

0 Kudos
Reply
3 Replies
2,608 Views
hyoungkikim
Contributor IV

i did it in u-boot  ..so   i can read   kenrel and rootfilesystem without error from nand 

in kernel ,  JFFS2 filesystem works without error

i think   ubi or jffs2 file system   use mtd layer , and mtd layer use  nand read and write function 

if nand read and write  funciton has problems  jffs2 access shoudn't work 

am i wrong ?

 

0 Kudos
Reply
2,612 Views
yipingwang
NXP TechSupport
NXP TechSupport

In file include/configs/p1_p2_rdb_pc.h in u-boot, please modify the source code as the following.

#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
| (2<<BR_DECC_SHIFT) /* Use HW ECC */ \
| BR_PS_8 /* Port Size = 8 bit */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid

=>

#define CONFIG_SYS_NAND_BR_PRELIM (BR_PHYS_ADDR(CONFIG_SYS_NAND_BASE_PHYS) \
| BR_DECC_OFF /* no error corr */ \
| BR_PS_8 /* Port Size = 8 bit */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid

 

In Linux Kernel, please enable MTD_NAND_ECC_BCH.

Symbol: MTD_NAND_ECC_BCH [=n] 
Type : boolean 
Prompt: Support software BCH ECC
     Location:

         -> Device Drivers
             -> Memory Technology Device (MTD) support (MTD [=y]) 
                 -> NAND Device Support (MTD_NAND [=y])

0 Kudos
Reply
2,503 Views
hyoungkikim
Contributor IV

thanks 

0 Kudos
Reply