NAND ECC errors after flashing from 4.9.11 kernel

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

NAND ECC errors after flashing from 4.9.11 kernel

2,284 Views
mihaitaivascu
Contributor III

Hello,

    I have the following issues when booting the barebox after I have flashed a new image on nand from Linux using UBI FS tools: ubiformat, ubiattach, etc

Board: Phytec phyCORE-i.MX6 Ultra Lite SOM
detected i.MX6 UltraLite revision 1.1
mdio_bus: miibus0: probed
eth0: got preset MAC address: 50:2d:f4:10:d2:69
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron MT29F4G08ABADAH4), 512MiB, page size: 2048, OOB size: 64
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
nand_bbt: ECC error in BBT at 0x00001ffe0005
nand_bbt: ECC error in BBT at 0x00001ffc0005
Scanning device for bad blocks
Bad block table written to 0x00001ffe0000, version 0x01
Bad block table written to 0x00001ffc0000, version 0x01
imx-usb 2184200.usb: USB EHCI 1.00
imx-esdhc 2190000.usdhc: registered as 2190000.usdhc
netconsole: registered as netconsole-1
phySOM-i.MX6: Using environment in NAND flash
malloc space: 0x8fe7d300 -> 0x9fcfa5ff (size 254.5 MiB)
running /env/bin/init...

nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 797:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 798:0
nand0.fit1: error -74 (ECC error) while reading 64 bytes from PEB 799:0
ubi0: scanning is finished
nand0.fit1: error -74 (ECC error) while reading 22528 bytes from PEB 232:4096
nand0.fit1: error -74 (ECC error) while reading 22528 bytes from PEB 233:4096
ubi0 error: vtbl_check: bad CRC at record 0: 0xa38af6d6, not 0x4d272fba
Volume table record 0 dump:
reserved_pebs 579
alignment 1
data_pad 0
vol_type 2
upd_marker 0
name_len 3
name fit
crc 0x4d272fba
ubi0 error: vtbl_check: bad CRC at record 0: 0xa38af6d6, not 0x4d272fba
Volume table record 0 dump:
reserved_pebs 579
alignment 1
data_pad 0
vol_type 2
upd_marker 0
name_len 3
name fit
crc 0x4d272fba
ubi0 error: process_lvol: both volume tables are corrupted
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd0, error -22
failed to attach: Invalid argument

Both barebox and linux use flash based BBT, I have enabled Software BCH ECC in both barebox and linux.

This happens only after I update the nand partiotions from linux.

 If I do it from barebox, evrtything is ok.

 The device tree in abrebox and linux is the same in regard to nand partition table.

I use barebox 2018.04 and 4.9.11 NXP kernel on an imx6ul platform

Does anybody know what possible reasons could be other than a hw or sw driver bug?

Thanks,

      Mihaita

Labels (1)
3 Replies

1,851 Views
b36401
NXP Employee
NXP Employee

It seems MT29F4G08ABADAH4 NAND chip driver in new kernel is differ than in old one in point of ECC calculation.
So you need to re-format NAND structure with kobs-ng.

Alternativelly you can try to compile the driver from old kernel in new one.

1,851 Views
mihaitaivascu
Contributor III

Hello,

     Thanks for your reply. It seems that downporting the gpmi driver to 4.8 was the solution.

0 Kudos

1,850 Views
steveschefterti
Contributor III

I am using u-boot rather than barebox, but I expect the issue is the same.  You can force the gpmi-nand driver in Linux to use a backward compatible ECC by adding the following to gpmi-nand in the device tree:

         fsl,legacy-bch-geometry;

Note the cautions in the Linux kernel code about this being a less safe ECC.