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.

OMAPL138 EMIFA NAND Flash Performance

Other Parts Discussed in Thread: OMAPL138

Hello,

I have a custom OMAPL138 based board which has a 256MB Micron nand flash (MT29F2G08AAC). I use the same connections as the L138 EVM UI board.

I use the kernel from arago git tree. (http://arago-project.org/git/projects/?p=linux-omapl1.git;a=summary)

I am trying to optimize the nand read/write performance on my custom board.

I have the following timings in my board file.


static struct davinci_aemif_timing atlas_nandflash_timing = {
    .wsetup     = 0,
    .wstrobe    = 30,
    .whold      = 30,
    .rsetup     = 10,
    .rstrobe    = 20,
    .rhold      = 10,
    .ta         = 0,
};

static struct davinci_nand_pdata atlas_nandflash_data = {
    .parts       = atlas_nandflash_partition,
    .nr_parts    = ARRAY_SIZE(atlas_nandflash_partition),
    .ecc_mode    = NAND_ECC_HW,
    .ecc_bits    = 4,
    .options     = NAND_USE_FLASH_BBT,
    .timing      = &atlas_nandflash_timing,
};


CPU is working at  300MHz and EMIFA_CLK is 100MHz.

With these values, i have aproximately 7MB/s read speed from the nand device

I use the following command to check read speed:

# time dd if=/dev/mtd5 of=/dev/zero bs=2048 count=5000
5000+0 records in
5000+0 records out
real    0m 1.45s
user    0m 0.01s
sys     0m 1.42s

But when i check the actual nand timings with a scope i realize an interesting issue.

Here is the screenshot of a typical nand read cycle:

CH1 is the nand chip enable (_CE) signal which is routed from L138's EMA_CSn_3 pin.

CH2 is the nand read enable (_RE) signal which is routed from L138's EMA_OEn pin.

Time scale is 100ns/div

As it is seen from the attached screenshot, there is some delay between each 4 byte read from the nand device.

Between these 4-byte read cycles, chip enable signal goes high.

I think because of this delay davinci nand driver is not working at its full speed.

I searched davinci nand driver source but can not find an explanation to this situation.

The question is:

Where was this delay come from? Is it possible to minimize this delay?

Regards,

Alper

 

 

 

  • Hi

    Your read performance numbers look close to what are presented in the PSP feature and performance guide datasheet

    http://processors.wiki.ti.com/index.php/DaVinci_PSP_03.20.00.12_Device_Driver_Features_and_Performance_Guide#Device_Driver_List

    Alper YILDIRIM said:

    As it is seen from the attached screenshot, there is some delay between each 4 byte read from the nand device.Between these 4-byte read cycles, chip enable signal goes high.

    I think because of this delay davinci nand driver is not working at its full speed.I searched davinci nand driver source but can not find an explanation to this situation.

    The question is:Where was this delay come from? Is it possible to minimize this delay?

    This is expected behavior , as the NAND driver is based on CPU (not EDMA) , so every CPU access is 4 bytes (1 word/32bits) , after which you see the CE go high. The driver is more or less close to full performance speed for the given setup/hold/strobe timings. To increase performance or see more back to back read access (greater then 4 bytes) with CE low, you would need to rely on "bursting" data using the EDMA3 (this is not supported by the driver).

     

    The delay should've been roughly equal to (Rsetup+Rstrobe+Rhold)*EMA_CLK period ( As explained in the OMAPL138 datasheet, Pg 109, Table 6-23, Parameter 3). Although based on the timing information that you have shared, and the division being 100 ns/division , the scope time seems to be lower then what I would've expected.

    Hope this helps.

    Regards

    Mukul

  •  

    Hi Mukul,

    Mukul Bhatnagar said:

    Your read performance numbers look close to what are presented in the PSP feature and performance guide datasheet

    http://processors.wiki.ti.com/index.php/DaVinci_PSP_03.20.00.12_Device_Driver_Features_and_Performance_Guide#Device_Driver_List

    I have already checked the performance wiki page that you have mentioned. On that page, the commands to measure the nand speed is not written. Since JFFS2 filesystem is used during the nand tests, the higher performance values may come from the filesystem decompression operation.

    Mukul Bhatnagar said:
    The delay should've been roughly equal to (Rsetup+Rstrobe+Rhold)*EMA_CLK period ( As explained in the OMAPL138 datasheet, Pg 109, Table 6-23, Parameter 3). Although based on the timing information that you have shared, and the division being 100 ns/division , the scope time seems to be lower then what I would've expected.

    The scope times match with my timings when i zoom in to a single read cycle. It takes totally 40ns to complete a read cycle.

    Mukul Bhatnagar said:
    This is expected behavior , as the NAND driver is based on CPU (not EDMA) , so every CPU access is 4 bytes (1 word/32bits) , after which you see the CE go high. The driver is more or less close to full performance speed for the given setup/hold/strobe timings. To increase performance or see more back to back read access (greater then 4 bytes) with CE low, you would need to rely on "bursting" data using the EDMA3 (this is not supported by the driver).

    Ok i understand the reason for these delays.
    In this case i have another question. I think nand is one of the most imported peripherals in an system like this. In a typical embedded device all the file system resides in nand chips. SPI flash sizes are not suitable to store an entire filesystem image.
    In PIO mode not only the nand performance is somehow limited but also the CPU usage is 100% during nand accesses.

    I wonder why TI does not implement EDMA functionality on the NAND Flash controller. I don't know if it is the right place to request it but i kindly request from TI to add EDMA functionality to the NAND Flash Controller.

    Thanks,

    Alper

  • Hi Alper,

    I am working based-OMAPL137 custom board as well, which has a MICRON of the same family (MT29F) than yours, but its size is different (2GB). I hope it does not care. Right now, I am stuck trying to detect that NANDFLASH memory connected to EMIFA from OMAP. I have configured EMIFA PINMUX registers, but  I can not get nothing relevant. I think one possible solution could be my own memory is not supported by the source code of elemantary bootloaders and maybe I have to add its ID and/or manufacturer codes. Any idea or advise about how you solved this problem?? 

    Thanks in advance!

    Óscar

  • Hi Oscar,

    Please refer to the boot loader application notes for the types of NAND Flash devices that are supported by the OMAPL13x/C674x devices.If it is the NAND flash from the same family as the post described above, I would say that this part should be supported as it would have the same ID and manufacturer code. If you could provide the full part number and details of how you have hooked up the NAND flash, we might be able to give you some more suggestions.

    Have you created a test case independent of boot to test the NAND interface. We provide NAND writers in the Boot and flashing utilities, Starterware that you should be able to modify to validate this interface.

    Regards,

    Rahul