IMX7D GPMI NAND in kernel 5.x.x

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

IMX7D GPMI NAND in kernel 5.x.x

994 Views
VoVan
Contributor III

https://community.nxp.com/t5/i-MX-Processors/IMX7D-NAND-ECC-error/m-p/1556173
I have the same problem as in this ticket.
In linux 5.x.x NAND GPMI read doesn't work correctly.
In linux 4.x.x NAND GPMI read work good.
Restoring gpmi_copy_bits and call to it don't fixing problems!!!
I test two NANDs:
1) MT29F2G08ABAGAWP
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
nand: Micron MT29F2G08ABAGAWP
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
BCH Geometry :
GF length : 13
ECC Strength : 8
Page Size in Bytes : 2110
Metadata Size in Bytes : 10
ECC Chunk0 Size in Bytes: 512
ECC Chunkn Size in Bytes: 512
ECC Chunk Count : 4
Payload Size in Bytes : 2048
Auxiliary Size in Bytes: 16
Auxiliary Status Offset: 12
Block Mark Byte Offset : 1999
Block Mark Bit Offset : 0
Ecc for Meta data : 0

2) Micron MT29F1G08ABAEAWP
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xf1
nand: Micron MT29F1G08ABAEAWP
nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
BCH Geometry :
GF length : 13
ECC Strength : 4
Page Size in Bytes : 2084
Metadata Size in Bytes : 10
ECC Chunk0 Size in Bytes: 512
ECC Chunkn Size in Bytes: 512
ECC Chunk Count : 4
Payload Size in Bytes : 2048
Auxiliary Size in Bytes: 16
Auxiliary Status Offset: 12
Block Mark Byte Offset : 2018
Block Mark Bit Offset : 4
Ecc for Meta data : 0

I'm recording both NAND's in 5.15.32 u-boot(u-boot, dtb, kernel). Board load sucess, but when i read data from linux 5.x.x - get invalid data.
Both NAND's reading 0xFF in begin page on linux 5.x.x(5.15.32). In u-boot 5.15.32 and kernel 4.x.x i read data correctly.
When i set GPMI IO clock to 1Mhz gpmi_nfc_compute_timings!!!:
#if 0
/* ONFI EDO mode 5 */
hw->clk_rate = 100000000;
wrn_dly_sel = BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY;
#else
hw->clk_rate = 1000000;
wrn_dly_sel = BV_GPMI_CTRL1_WRN_DLY_SEL_4_TO_8NS;
#endif
Both NAND's read data correctly. When set dma_apbh IMX7D_NAND_USDHC_BUS_RAWNAND_CLK to 10 Mhz and gpmi IMX7D_NAND_ROOT_SRC to 10 Mhz - read data correctly too...


We soldered both this NAND's to imx6ULL. Both NAND's read correct data in linux 5.15.32 without anything changes.
What is the difference in NAND operation on the platform IMX7D and IMX6ULL?
IMX7D use 2 share clock's:
gpmi_io: IMX7D_NAND_ROOT_SRC
share gpmi_bch_apb/dma_apbh: IMX7D_NAND_USDHC_BUS_RAWNAND_CLK

IMX6ULL use 6 independent clock's:
gpmi: IMX6UL_CLK_GPMI_IO,IMX6UL_CLK_GPMI_APB,IMX6UL_CLK_GPMI_BCH,IMX6UL_CLK_GPMI_BCH_APB,IMX6UL_CLK_PER_BCH
dma_apbh: IMX6UL_CLK_APBHDMA

Maybe problem in share clock's on IMX7D platform???
Why reading in 4.x.x kernel work is good, but reading im 5.x.x kernel don't work? I also tested reading in kernel 5.4.70 - read don't work correctly.
I tried to see the difference between GPMI driver in kernel 4.14.98(work good) and 5.4.70(don't work) - she's huge.
How to solve this problem? In fact, none of NAND's works on new Linux(5.x.x and higher) on IMX7D platform.....

0 Kudos
Reply
1 Reply

944 Views
VoVan
Contributor III

I tested binary kernel and dtb from this link: https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux-for...

I load this kernel and dtb from uboot 5.15.32 by tftp.

Latest working kernel version with normal NAND reading on IMX7D - 4.19.35

 All kernel versions higher than 4.19.35 - don't read normal data from NAND

I attach the logs and results of reading the same piece from nand.

dtb0_4.19.35.txt - my dtb in NAND, this data is correct

dtb0_5.4.3.txt - data incorrect.

I cannot attach more than 5 files; according to testing results, reading from Nand does not work correctly in new kernel's(5.x.x and 6.x.x)

6.1.55 doesn't even detect ONFI on NAND....

0 Kudos
Reply