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.

DM8168 Support Open NAND Flash Interface (ONFI) 2.3-compliant

Hi All,

I am using onfi2.3, 256 Gb nand flash memory having 4 LUN, with custom DM8168 processor, in the kernel detected and nand is initializing and getting partitioned but not able to do read wrote and erase through flash_eraseall command.

This is the error while running flash_eraseall /dev/mtd0

flash_erase: error!: /dev/mtd4: MTD Erase failure
             error 5 (Input/output error)
flash_erase: Skipping bad block at dd420000
Erasing 64 Kibyte @ dd430000 -- 44 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 56643 (mtd4)
        error 5 (Input/output error)
flash_erase: error!: /dev/mtd4: MTD Erase failure
             error 5 (Input/output error)
flash_erase: Skipping bad block at dd440000
Erasing 64 Kibyte @ dd450000 -- 44 % complete libmtd: error!: MEMERASE64 ioctl failed for eraseblock 56645 (mtd4)
        error 5 (Input/output error)

I am using custom board with TI DM8168 processor and  ezsdk_dm816x-evm_5_05_02_00_setuplinux.

Please let me know where is the issue and how could resolve it, if any patch is available please let me know.

Thanks,

Vidya

  • Hi Vidya,

    Vidya Sagar said:
    This is the error while running flash_eraseall /dev/mtd0

    Make sure mtd0 is NAND. By default SPI driver is enabled and registered before NAND driver.

    m25p80 spi1.0: w25x32 (4096 Kbytes)
    Creating 5 MTD partitions on "spi_flash":
    0x000000000000-0x000000020000 : "U-Boot-min"
    0x000000020000-0x000000060000 : "U-Boot"
    0x000000060000-0x000000062000 : "U-Boot Env"
    0x000000062000-0x0000002e2000 : "Kernel"
    0x0000002e2000-0x000000400000 : "File System"
    omap2-nand driver initializing
    ONFI param page 0 valid
    ONFI flash detected
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca (Micron NAND 256MiB 3,3V 16-bit)
    omap2-nand: detected x16 NAND flash
    Creating 6 MTD partitions on "omap2-nand.0":
    0x000000000000-0x000000020000 : "U-Boot-min"
    0x000000020000-0x000000260000 : "U-Boot"
    0x000000260000-0x000000280000 : "U-Boot Env"
    0x000000280000-0x0000006c0000 : "Kernel"
    0x0000006c0000-0x00000cee0000 : "File System"
    0x00000cee0000-0x000010000000 : "Reserved"

    SPI takes from mtd0 to mtd4, NAND takes from mtd5 to mtd10, mtd9 is for NAND file system. If there is no SPI driver registered in the linux kernel, your NAND takes from mtd0 to mtd5, mtd4 is for NAND filesystem.

    Vidya Sagar said:
    if any patch is available please let me know.

    Please review and apply all the NAND/GPMC/UBIFS/MTD related patches from the below branch and apply these which does not exist in your code base.

    BR
    Pavel

  • Hi Pavel,

    Thanks for reply.

    I disabled the SPI driver in the menuconfig so only ONFI nand detects as mtd0 in the kernel and again getting same issue on flash_eraseall /dev/mttd0.

    omap2-nand driver initializing
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0x64 (Micron )
    Creating 5 MTD partitions on "omap2-nand.0":
    0x000000000000-0x000000260000 : "U-Boot"
    0x000000260000-0x000000280000 : "U-Boot Env"
    0x000000280000-0x0000006c0000 : "Kernel"
    0x0000006c0000-0x00000cee0000 : "File System"
    0x00000cee0000-0x000200000000 : "Reserved"
    is getting the in the kernel log but not getting the two lines
    ONFI param page 0 valid
    ONFI flash detected

    My onfi nand device MT29F256G08CMCBB , x8, getting correct NAND device: Manufacturer ID: 0x2c, Chip ID: 0x64 (Micron )

    My ONFI NAND Organization is given below:
    Page size x8: 8936 bytes (8192 + 744 bytes)
    Block size: 256 pages (2048K + 186K bytes)
    Plane size: 2 planes x 2048 blocks per plane
    Device size: 256Gb: 16,384 blocks

    I am using 2.6.37 kernel, but nand_ids.c table does not have my device id, so i modified then detects.
    {"NAND 256MiB 1,8V 8-bit", 0x64, 0, 8192, 0, LP_OPTIONS16},
    I am not getting any onfi nand patch which support 2.6.37kernel or U-boot , if it is available please send the link.

    Thanks,
    Vidya

  • Vidya,

    Is your NAND detected in u-boot? Can you erase/read/write this NAND from u-boot (# nand  erase)? Please provide me full u-boot boot log.

    Can you also try with other mtd partitions:

    flash_eraseall /dev/mtd0
    flash_eraseall /dev/mtd1
    flash_eraseall /dev/mtd2
    flash_eraseall /dev/mtd3

    BR
    Pavel

  • Dear Pavel,

    No, working on linux kernel, please let me know what could be the issue.

    I am using 32 Gbytes nand flash with 8K page size and device id 0x64.

    According to the TRM (TMS320DM816x DaVinci Digital Video Processors, SPRUGX8B March 2013) Table 25-12. our NAND device does not support.

    Any method to detect NAND full memory on the kernel level and read/write can happen.

    Thanks,

    Vidya

     


     

  • Vidya,

    Table 25-12 provides NAND requirements if you are planning to boot from this NAND flash. If you just need to use this NAND flash for data storage (not boot) you can use 32Gbyte part, as NAND flash is not memory mapped so the size of NAND supported really does not depend on the Async region size. The Async bank chip select is used to select the NAND flash and two addresses within the Async region are used to latch command and addresss into the NAND flash. The read and write to NAND flash works on this command and address interface.

    The problem here is the 8K page size, as OMAP NAND driver supports up to 4K page size:

    processors.wiki.ti.com/.../Linux_Core_NAND_User's_Guide
    processors.wiki.ti.com/.../TI81XX_PSP_04.04.00.01_Feature_Performance_Guide

    8k page is supported by the GPMC/NAND controller, except for the hardware ECC part which is limited to 4k. That would mean software ECC should be used, except if the NAND includes an internal ECC mechanism.

    BR
    Pavel
  • Dear Pavel,

    Thanks for reply.
    This link:
    processors.wiki.ti.com/.../Linux_Core_NAND_User
    show there is no text.

    If 8K page size memory will work as storage device, what need to modified in the kernel level.
    If any patch is available for 8K page size, please send me.

    Thanks,
    Vidya
  • Vidya,

    Vidya Sagar said:
    This link:
    processors.wiki.ti.com/.../Linux_Core_NAND_User
    show there is no text.

    Vidya Sagar said:
    If 8K page size memory will work as storage device, what need to modified in the kernel level.

    Try with software ECC.

    processors.wiki.ti.com/index.php/TI81XX_PSP_NAND_Driver_User_Guide

    Vidya Sagar said:
    If any patch is available for 8K page size, please send me.

    No such patch. All the patches are available in the below branch, you can explore NAND/BCH/ECC related patches

    BR
    Pavel

  • Dear Pavel,

    No, those patches do not work for 32 GB ( 8k page size ) NAND memory.

    Please suggest me how 8K page size nand memory will initialize the memory.

    Thanks,
    Vidya
  • Vidya,

    Have you tried with software ECC?

    BR
    Pavel
  • Nand_flash_256Gb_latest.pdfDear Pavel,

    Yes i tried software ECC, but does not initilize flash memory.

    Can you look into NAND part number MT29F256G08CMCBB in the attachment and please suggest me what and where need to integrate the linux kernel code.

    Thanks,

    Vidya

  • Vidya,

    Vidya Sagar said:
    Yes i tried software ECC, but does not initilize flash memory.

    What do you mean by state "does not initilize flash memory"? Can you provide more details about that.

    BR
    Pavel