How to read/write in flash memories (MTD)?

Fillod Stephane stephane.fillod at
Tue Apr 5 00:05:36 EST 2005

Bonjour Jérémie,

Your mail is a bit off-topic on the linuxppc-dev list. A better list would
be linux-mtd. Check out:

>Your reply confirmed my feeling. So I've decided to use the MTD but with my >own driver as I found in a tutorial. So I made the file (module) >/drivers/mtd/maps/myBoardFlash.c in order to support my 2 flash memories. >You can see the code below, but once again (sorry...) I have some questions >and doubts on it. 
>1- Is that driver correct for my case? 
>2- Are those R/W routines are usable?
>3- In our application we want to download source code and achievable code >using Ethernet (so R/W operations). Do I need a filesystem for that as JFFS2 ? 

yes, or any other kind of filesystem on top of "MTD block", but this can be 
unreliable. One solution can be also to use raw partitions to store data.

>4- Giving this driver, what is the process to use my R/W routines (if they >are correct...) from the user space?

To use your R/W routines, you can use "MTD char" support. 
See fcp.c (from MTD CVS or ftp site) for an example.


More information about the Linuxppc-dev mailing list