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.

How to configure nand flash support into kernel

Other Parts Discussed in Thread: AM3359

          I'm trying to get Nand flash support compiled into the kernel for a custom board with an AM3359 processor.  But,after booting this kernel, I don't see a /dev/mtdX or /dev/mtdblockX device. And when I ‘cat /proc/mtd’,it prints like follows(not any more):

           dev:    size   erasesize  name

        To follow what steps can I use the nand flash in linux?

  • Have you specified the Flash parameters (device type, size, addresses) either a) in the board support setup file [for compiled-in partitions] or b) in the kernel boot command line [for boot cmd partitions] ?

  • Hi Wen,

    As  Mike suggested have add code for NAND flash support  inn your board file,

    Once you have added, Also you have to enable NAND in MTD devices by using menuconfig

    and selecting appropriate option depending on your nand type.

    Thx,

    --Prabhakar Lad

  • Hi,

           I do enable NAND in MTD devices by using menuconfig,and select appropriate option according to the manual,but itdoesn't work. During the linux booting process,it prints ‘omap2-nand driver initializing’ , but no infomation about the partitions. The board is costumed , do i need to modify the driver?

     

  • Hi,

    Please follow the link for enabling NAND, http://processors.wiki.ti.com/index.php/AM335x_NAND_Driver%27s_Guide#Driver_Configuration

    once linux boots up, do ls /dev/mtd*

    Thx,

    --Prabhakar Lad

  • Mike:

          How can i specify the partitions environment varible ?I tried:

           setenv bootargs '…… mtdparts=omap2.0:128k(spl),128k(spl.backup1),128k(sp l.backup2),128k(spl.backup3),1920k(uboot),128k(bootenv),5m(kernel),480m(rootfs),-(rest)'

          but it does not work.

  •      I tried,but it does not work. I think i should modify the driver source code for my customed board.

         Thank you anyway.

  • In the kernel build settings you must ensure that the flash device type is correctly selected.

    Also to enable MTD partitioning support, and for this test case, use command line partitioning.

    As long as the driver gets loaded this should always produce some MTD partitions, even if they turn out not to be usable !

    A further help might be to enable MTD debug in the kernel, so you can see what is going on - decide on the debug level required which is another setting.

    You need to correctly set the driver type for the flash device in use. In addition you may have to modify some of the code or settings in case your board does not use exactly the same control signals as the 'vanilla' board design.

    Does U-boot allow you to write to your flash - this at least shows that the U-boot flash driver is working, which gives hope for the kernel driver.

  • You must also create the /dev/mtdX either in the root filesystem that you install on your system, or via some program such as mdev or udev.

    They will not just spring into life from the driver.

    If you do not have mdev or udev, just create your device nodes in your /dev root filesystem 'by hand' before boot, then if the driver is working OK you should be able to see the partitions in mtdinfo etc.