This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: NAND Flash device driver


> > Again, is this compatible with how Linux does it?
> 
> No. There are many reasons why not.
> 
> Linux bad block management algorithm cannot be convenient with current
> eCos flash API. RedBoot and eCos application don't know anything about
> bad blocks and other NAND characteristics.
> 
> The one opportunity to use Linux compatible driver in eCos is using
> JFFS2 (it knows about bad blocks). But JFFS2 cannot use eCos flash API,
> because it must have access to NAND special functions (for example, it
> writes to spare area).

Hi

I think i should give an example.
Let us assume that we have NAND flash with 4096 blocks and block #5 is
manufacturer marked as bad. What is happen if we create flash image in
first ten blocks (RedBoot command "fis create").

Toshiba NAND driver erases first ten blocks (and loses bad block marker
in block #5) and writes data there. So later we will lose information in
block #5.

Linux compatible driver just returns error, because block #5 is bad. It
assumes that application should check block before read/write/erase. So
if we use flash API and FIS we cannot use Linux compatible driver
without rewriting applications.

My NAND driver remaps block #5 to block from repair area (e.g. #4064).
Application doesn't know about remapping and thinks that writes to block
#5. So we can use this driver to work with FIS and eCos application uses
flash API.

Another situation if we use Linux compatible driver together with JFFS2.
Then NAND driver has special NAND API that is used by JFFS2. And
application should use file system API instead flash API.

So my NAND driver is not compatible with Linux, but compatible with FIS
and flash API. On the other hand Linux compatible driver will be not
compatible with FIS. I prefer have both for different tasks, but one is
good too.

Best regards
Alexey Shusharin



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]