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.

OMAPL137 EVM Root Filesystem

Hi,

I'm using OMAPL137 EVM along with UI Module, both are from Spectrum. The EVM boots from spi flash. The kernel is Montavista linux 2.6.33. In my project, the Nand flash on the UI card is used to store data files. It's preferred to boot from spi flash. I'm looking for a root file system other than NFS, CRAMFS or RAMDISK. Can you recommend one and show me how to make an rootfs image of that?

Thank you!

Ming

  • Hi Ming,

    My assumption is

    U-boot (SPI --> Kenel (SPI) --> Filesystem (NAND)

    If you are using NAND flash for storing the data then you can select JFFS2 or YAFFS2 or UBIFS are preferred.

    You cant use RAMDISK for data storage (its used for repairing purposes only).

    JFFS2

    http://processors.wiki.ti.com/index.php/Put_JFFS2_Image_to_Flash

    YAFFS2

    http://processors.wiki.ti.com/index.php/Create_a_YAFFS_Target_Image

    UBIFS

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

  • Hi Titusrathinaraj,

    Thanks for your quick response!

    My initial plan was 

    U-boot (SPI --> Kenel (SPI) --> Filesystem (SPI) --> mount NAND with jffs2

    I initially booted the EVM with NFS, and then mount Nand flash as a mtd device. The nand flash is for data storage only. It worked well, so I was trying to replace the NFS with a real file system.

    Now I realize my initial plan might be wrong. But the U-boot can only support either spi or nand at a time. How to put kernel and file system seperately?

    Please help me,

    Ming

     

     

  • Hi Ming,

    Do you need two filesystem: one is in SPI and another in NAND?

    U-boot (SPI --> Kenel (SPI) --> Filesystem (NAND : mount NAND with jffs2 (UI card) )

    I assume that you are booted with NFS and write filesystem into NAND data partition(/dev/mtdblock3) as ajffs2 filesystem.

    Step 1) Flash u-boot in SPI flash memory.

    2) Load kernel uImage (c0700000) into RAM through tftp.

    3) Do a SPI write : sf write c0700000 0x80000 0x220000

    4) Change the bootargs for loading kernel from RAM addr  & mounting filesystem in data partition.

    Ex:

    setenv bootargs 'mem=32M console=ttyS2,115200n8 root=/dev/mtdblock3 rootfstype=jffs2 rw rootwait'
    setenv bootcmd' sf probe 0; sf read 0xc0700000 0x80000 0x220000; bootm 0xc0700000'

    Flashing kernel uImage into SPI flash (sf)
    -------------------------------------------

    u-boot# sf probe 0

    u-boot# sf erase 0x80000 0x220000

    u-boot# tftp c0700000 uImage

    u-boot# sf write c0700000 0x80000 0x220000

    u-boot# bootm c0700000


    Reading back & booting
    ----------------------

    u-boot# sf read 0xc0700000 0x80000 0x220000

    u-boot# bootm 0xc0700000

  • Hi Titusrathinaraj,

    Yes, I was needing two filesystems. One(I'm looking for) for spi flash, one(jffs2) for nand flash. And basically like you said, I initially booted with NFS and logged into linux. In linux, I mounted the nand flash and  write jffs2 filesystem into NAND data partition(/dev/mtdblock4).

    But now I'm kind of confused about your solution. It seems you put kernel in spi and jffs2 file system in nand. But, the uboot can be configured to support either spi or nand, not both at a time. If I put kernel in spi and jffs2 in nand, how can uboot find both?

    Thanks,

    Ming

  • Hi Ming,

    But now I'm kind of confused about your solution. It seems you put kernel in spi and jffs2 file system in nand. But, the uboot can be configured to support either spi or nand, not both at a time.

    Yes, You are right.

    If I put kernel in spi and jffs2 in nand, how can uboot find both?

    Solution : Use this args

    setenv bootargs 'mem=32M console=ttyS2,115200n8 root=/dev/mtdblock3 rootfstype=jffs2 rw rootwait'
    setenv bootcmd' sf probe 0; sf read 0xc0700000 0x80000 0x220000; bootm 0xc0700000'

    This args says Load kernel image from SPI flash into RAM addr and mount FS in NAND.

    You can configure the u-boot for SPI flash and load the kernel from network to RAM (C0700000) and write into SPI then boot. (Here, The requirement is not there to access NAND flash)

    So that after linux kernel loaded, the NAND driver get initialized and you can able to mount the jffs2 fs partition which already you written through NFS mode.

  • Hi Titusrathinaraj,

    Thank you! Your solution works well. I'll make your reply as verified answer.

    There is another question maybe I should bring up in a new thread. Assume there are already some data files, like .txt or .bin files, stored in nand flash. How can I transfer them to a host machine(VMplayer linux or windows PC)?

    PS :My project is developing an measuring equipment. It uses OMAPL137 as the controller, collects data from some sensors and stores them at nand flash. When the equipment done the measurement, I need to read these data(hundreds MBytes) out through Ethernet cable.

    Let me know if we can start a new thread.

    Thanks,

    Ming

  • Hi Ming,

    Nice to hear this news.

    There is another question maybe I should bring up in a new thread. Assume there are already some data files, like .txt or .bin files, stored in nand flash. How can I transfer them to a host machine(VMplayer linux or windows PC)?

    Ya, You are right, Please create thread for this question to many many people get intervene and useful to others.