This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sporadic problems with NAND access on DM365EVM



I get sporadic problems during NAND access on two different DM365EMV boards. Upon investigation I found:

- the UBL from DVSDK 3.10 beta release (http://arago-project.org/files/releases/davinci-psp_3.x.0.0/sources/flash-utils-davinci.tar.gz) sets the A1CR register of the AEMIF unconditionally to 0x40400204. At least Bit 30 (EW) should NOT be set according to the AEMIF User's Guide (sprufi1b) in NAND mode. So I'm not too confident with the other bits either.

- running nandtest from the mtd-utils package (http://www.linux-mtd.infradead.org/index.html) reveals sporadic problems during NAND read. It seems like the read missed exactly one byte:

root@dm365evm:~# nandtest /dev/mtd3
ECC corrections: 0
ECC failures   : 5
Bad blocks     : 58
BBT blocks     : 0

...

compare failed. seed 1458165140
Byte 0x1e518 is cd should be 41
Byte 0x1e519 is 07 should be cd
Byte 0x1e51a is f5 should be 07
Byte 0x1e51b is ae should be f5

...

 

This problem does NOT occur always at the same location. The frequency of failures seems to change when I change values in the mentioned A1CR register, but I did not find a setting yet that makes the problem disappear.

Did somebody else experience such problems with NAND flash?

Regards, Andreas.

 

  • Andreas,

     

    I also observed the same issue on DM365 with the kernel downloaded from http://www.arago-project.org/git/people/?p=sneha/linux-davinci-staging.git;a=summary. But this is issue not seen in the community kernel maintained by Kevin Hilman at http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=summary. Currently I am not sure what has fixed this issue in the latest kernel. I'll let you know as soon as I find this out.

     

    Regards,

    Sudhakar

  • Andreas,

    I tested this further and found out that the problem had nothing to do with the Kernel version. If I disable MMC/SD from menuconfig then I am not seeing the issue. I am not sure how EMIF and MMC are related but can you confirm whether this is the behavior on your setup also?

    Sudhakar

     

  • Hello Sudhakar,

    thanks for the information. Yes, disabling MMC/SD fixes the problem in my setup.

    How to proceed? Do you think this is a hardware issue or a problem in the Linux drivers?

    Regards,

     Andreas.

     

     

  • Andreas,

    Right now I am also not sure what is the cause for this behavior. I'll check this further and will let you know.

    Regards,

    Sudhakar

  • Andreas,

    I debugged this further and this is my observation:

    On DM365 CPLD is being used to detect whether MMC/SD card is present in the slot or not. CPLD has been interfaced using EMIF (like NAND). The MMC/SD card detect function gets called at every timer interrupt interval. Because of this frequent call, nandtest fails. I increased the frequency at which the card detect function gets called, then the problem disappeared.

    As of now, to get around this problem, you can disable the card detect function in arch/arm/mach-davinci/biard-dm365-evm.c file. Refer to the davinci_mmc_config structure. In this structure do not initialize the get_cd member. This will not affect the MMC/SD functionality on the EVM, as there is card detect function in the MMC framework which detects whether the card is present or not.

    I am not sure whether this is a hardware issue or not. I'll debug this further and will let you know whether this can be worked around in software in any other way.

    Regards, Sudhakar