Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

How to add second flash to MTD

I am using a board with 2 16 MB CFI flashes.

Flash 1 at 0x0 and Flash at 0x02000000.

uClinux detects flash 1 and does not detect flash 2. I am using microtronix map where i see, It sends data for mapping first flash only.

How do I make uClinux detect and add my second flash?

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    1. You may try concat the two chips into a virtual one. (But I didn't try any of them)

    Drivers--> Memory Technology Devices (MTD) -->

    [*] MTD concatenating support

    search "concat" in dir linux-2.6.x/drivers/mtd/maps, and you can find more examples, cevia.c.

    http://www.sysgo.com/fileadmin/user_upload.../mtd-concat.pdf (http://www.sysgo.com/fileadmin/user_upload/appnotes/mtd-concat.pdf)

    2. Or use them seperately.

    You will may use the second flash chip's address and size, ie, na_cfi_flash_1, to declare the second map_info.

    And define the second mtd_partition.

    Then add them after the first.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you Hippo. My idea is to have uClinux and FS in Flash1 which will be protected from any write with a jumper and JFFS2 on Flash 2 which will be writable. The system what I am working on runs 24X7 and should be crash free / Auto recoverable. To avoid corruption of the kernel or FS I am trying to do the above.

    How can I do this? I checked out the CFI driver in Microtronix dist. It is completely hardcoded for flash at 0x0. How can I solve my problem. I dont know if concat will help me do what i am planning.

    Please suggest.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I thnik its better to use them separately]. Just specify the address of second chip in the map file.

    mtd cat is used if you want to have single file system spread on two chips, which is not what you want.

    [i have not used it yet]

    Should work.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I looked into the MTD driver thoroughly. Its actually dumb. It does no use the CFI table to get the actual size and boundary of the flash. It blindly uses the macros defined. So i changed the memory map and placed all the flashes in sequence. Changed the flash size from 16 to 32 MB and it just works.

    Simple work around.

    Thanks for your support.