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.

Accessing to NAND Flash from embedded Linux on a based-OMAPL137 custom board

Other Parts Discussed in Thread: OMAP-L137

Hi guys!

My R+D group has designed and built a more complete based-OMAPL137 custom board, taking as reference the OMAPL137 EVM of Spectrum Digital. One of the new elements is a NAND FLASH memory of micron's manufacturer (MT29 family, 4GB). The main goal of this chip is to store Linux file-system instead of storing that on a sd card or by means NFS protocol. However, I am trying to find out how I can enable the access to this device from primary bootloaders (mainly u-boot) and Linux kernel..

For instance, if a small Liux file-system is contained on the SPIFLASH memory, I can access to SPI FLASH partitions through the MTD driver of Kernel Linux. Once booting Linux, I can move up and down between all folders of file-system without problems. How can I do this for NAND FLASH memory?? I did some modifications enabling some characteristics of Linux kernel (e.g.Support for NAND chips) or writing some new instruction at u-boot (#define CONFIG_USE_NAND) but I can not see any messages during booting Linux regarding to that. I think that OMAPL137 and LInux kernel (v2.33) used are totally compatible with MT29 NAND FLASH , but now I start having uncertain..

How can I access to the NAND FLASH and store Linux filesystem in NAND FLASH?

Any advance or suggestion would be appreciated!! Thanks in advance

Regards

Óscar

  • Hi Oscar,

    Thanks for the post.

    1. u-boot Source & Binaries: Please download the latest Linux SDK from below link, that has pre-built NAND ARM UBL, DSP UBL, u-boot binaries and u-boot source.

    http://www.ti.com/tool/linuxsdk-omapl137

    2. Linux 3.3.0 Source: Please download the latest Linux PSP from below wiki link.

    http://processors.wiki.ti.com/index.php/DaVinci_(ARM9)_PSP_Releases#DA850.28Spectrum_Digital_EVM.29.2C_DA830.28Spectrum_Digital_EVM_and_Spectrum_Digital_WiFi_EVM.29_and_OMAP-L138.28_Logic_PD_EVM_and_LCDK.29

    3. Building kernel with NAND support: How to enable the NAND flash support in Linux, shall be found in below wiki link.

    http://processors.wiki.ti.com/index.php/UBIFS_Support#Configuration

    4. Using NAND: Please refer the below wiki link to read/write/erase the NAND Flash from u-boot. The link also provides the steps to boot from NAND flash, bootargs & bootcmds.

    http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot#NAND_Flash_.28ramdisk_as_rootfs.29

    5. Devices successfully used with OMAP-L137/DA830.

    http://processors.wiki.ti.com/index.php/Devices_successfully_used_with_OMAP-L137/DA830

    6. Booting from NAND flash.

    http://processors.wiki.ti.com/index.php/Restoring/Flashing_OMAP-L137_Bootloaders#Booting_from_NAND_Flash

    Please let us know if you need any support.

  • Thanks for your complete answer, but right now I am stopped at the first point..:(

    I am using a nand writer from OMAP-L137_FlashAndBootUtils_2_40 package, which contains source code for flashing nand memory with primary bootloaders. (dsp-nand.bin, ubl-nand, ...). Besides, I did changes at the SYSCFG registers to adjust my own EMIFA configuration to my custom design. (see below)

    Nand Flash memory (Micron MT29F16G08CBACAWP, 2GBytes) is connected to emifA following the next configuration:

    PINMUX13 = 0x11888888 (D1,D0,..)
    PINMUX14 = 0x00111111 (D9,D8,..D2)
    PINMUX15 = 0x11888888 (A1,A0,D15..D10)
    PINMUX16 = 0x88888888 (A9..A2)
    PINMUX17 = 0x88888888 (As)
    PINMUX18 = 0x88111818 (...OE CS..)
    PINMUX19 = 0x00000001 (...WAIT)

    These changes on the SYSCFG registers have been checked at the OMAPL137 TRM. On the other hand, I think this memory is not supported at the source code by default, I mean, their manufacturer & device ID are not listed there (device_nand.c file inside project). Could a possibility be add both things manufacturer & dev ID at the right place? Also, I am debugging nandwriter project by means CCS5 and I can see the SYSCFG registers configured properly. Finally, a compatibility memory problem could be happen but I do not think so, because I am using one which is of the same family that one used at the User Interface Board for DA830EVM.

    Is it necessary any more extra configuration? What can I do to recognize my nand flash memory? Thanks in advance!

    Regards

    Óscar

  • Hi Oscar,

    For correct PINMUX settings, please refer the Figure 20-14. EMIFA to NAND Flash Interface in TRM of OMAP-L137 (SPRUH92).

    The value of PINMUX16 should be 0x88888881.

    Please refer the section 20.3.2.3 Interfacing to NAND Flash for Software Configuration.

    Thanks for the post.

  • Hi Oscar,

    Any update? Could you able solve your issue?

  • Hi Rajasekaran K,

    Sorry for the delay, I took a couple of weeks of disconnection.:) I am back.

    I have made two tasks suggested for your staff (TI) and both did not work so far... First, I degugged the NAND_writer.pjt located in /home/gtsc/Descargas/DaVinci-PSP-SDK-03.20.00.14/src/utils/nand-writer-03.20.00.14, loading and flashing the three pre-built images (dsp-nand-ais.bin, ubl-nand.bin and u-boot) in my NAND Flash. Besides, according to the README file located in the same package, I did not change the EMIFA region because I want to work at the CS2 region and lastly, I had not to add a new chip in DEVICE_NAND_CHIP_infoTable[] because the chosen NAND Flash is recognized automatically in that project.

    Procedure's result: it does not work... Something curious happened: when program detected the memory's parameters (num_blocks, pages_per_block, bytes_per_page), everything was correct except to the pages_per_block parameter. It was 0 instead of 256!! It might not be a big problem, but this program does a while loop (see below) where this parameter is the key and its value causes an infinite loop.

    while ( (numBlks * hNandInfo->pagesPerBlock)  < (nandBoot->numPage + 1) )

      {
        numBlks++;
      }

    I tried to change this parameter when I was debugging that program by means the variable window of CCS and it seemed that works because the three images were flashed correctly (see attached document), but, after that, when I configured the boot switch (NAND8), and ran the minicom app, I did not get any message..

    Also, note that I configured PINMUX registers properly in order to use the EMIFA and its CS2 region.

    That was the first test. Second test was performed with the OMAP-L137_FlashAndBootUtils_2_40.tar.gz utility. I did a SCRIPT file with the following content:

    sudo mono ./sfh_OMAP-L137.exe -flash_dsp -v -flashType NAND /home/gtsc/Descargas/DaVinci-PSP-SDK-03.20.00.14/images/boot-strap/omapl1x7/dsp-nand-ais.bin /home/gtsc/Descargas/DaVinci-PSP-SDK-03.20.00.14/images/boot-strap/omapl1x7/ubl-nand.bin /home/gtsc/Descargas/DaVinci-PSP-SDK-03.20.00.14/src/u-boot/uboot-03.20.00.14/u-boot.bin

    The result is bad too..:(

    Flashing DSPUBL /home/gtsc/Descargas/DaVinci-PSP-SDK-03.20.00.14/images/boot-strap/omapl1x7/dsp-nand-ais.bin (10884 bytes) at 0x00000000

        Target:        ERROR: NAND Memory Initialization failed.
        Target:       FAIL

    That fail, at the first bootloader, makes me think that there is a very initial memory recognition problem, but how could I solve it? I have not the source code of the first bootloader, only the pre-built image.

    Any suggestion?? I am really stuck here! I hope you understand the issue.  Thanks in advance

    Regards

    Óscar