AM625: jff2 crc error

Part Number: AM625

Tool/software:

Hi:

My SDK version is 10.01.10.04.

We use jffs2 to mount some mtd, but when it mount ,it always show crc error.

The test cmd is:

      mtd_debug erase /dev/mtd1 0x0 0x300000

      mount -t jffs2 /dev/mtd1 /mnt

      echo "1234" > /mnt/test.txt

      umount /mnt

      mount -t jffs2 /dev/mtd1 /mnt

when I dmesg, it show me crc error: Node header CRC failed at 0x360080(ffff,ffff,fff,ffff)

The code is in readinode.c jffs2_get_inode_nodes , it do u.hdr_crc check.

Then I add some debug log in jffs2 crc check and cqspi dma

I found when it read some place, the data after finishing dma is 0xFF.

I Also use logic analyzer to capture the data . The data nor flash send is right which is not 0xFF. And I dump the data on flash at the same offset it also not 0xFF

So the data on flash and send to soc is right, but sometimes after dma transfer , the data in buf will be 0xFF.

 

If I add read again , the buf which dma transfer will get the right data.

The log I upload is I add shows the log that I add read twice when do  u.hdr_crc check.

But you can see when it read 0x330080 fisrt time, the data in jffs2 buffer is 0xFF. I also dump the data in buffer finish dma transfer is 0xFF.

But when read again ,it get the right data.

The configs for jffs2 in kernel is as follows:
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
#CONFIG_JFFS2_FS_WRITEBUFFER is not set

#CONFIG_JFFS2_FS_WBUF_VERIFY is not set

#CONFIG_JFFS2_SUMMARY is not set

CONFIG_JFFS2_FS_XATTR=y

CONFIG_JFFS2_COMPRESSION_OPTIONS=y

CONFIG_JFFS2_ZLIB=y

CONFIG_JFFS2_RTIME=y

Could you please help us check if these configs cause the issue?

Also, in dts, I found a value in the node of flash@0

cdns,read-delay = <2>;

Does this value cause the issue?

Or is there any other settings need to set in some registers?

Thanks.

jffs2_error.zip