linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Smartmedia/xd card support - request for comments
@ 2008-04-19  8:31 matthieu castet
  2008-04-20 16:01 ` Jörn Engel
  0 siblings, 1 reply; 23+ messages in thread
From: matthieu castet @ 2008-04-19  8:31 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: Thomas Gleixner, Alex Dubov

Hi,

> On Fri, 18 Apr 2008, Alex Dubov wrote:
> 
> First off, can you please use a mail client which does line breaks at
> around 78 chars ?
>  
>> As you understand, both smartmedia media and hosts follow certain
>> spec (publicly available here:
>> http://www.ssfdc.or.jp/spec/index_e.htm, basic registration
>> required). xd card spec is almost identical, adding some cosmetic
>> features and restrictions (such as prohibition of single page
>> programming). This means, that smartmedia access protocol can be
>> abstracted out in the reader-independent way. You can seen in the
>> xd_card_blk.c that it can operate both completely dumb controllers,
>> while taking protocol shortcuts (using host->caps) to accommodate
>> smarter readers (the only feature currently not there is
>> adapter-side page copy - it can be easily added under FBD_COPY
>> clause in xd_card_trans_req). The backend itself (jmb38x_xd.c)
BTW some bare nand flash have support to page copy (there is some issue 
because of no ecc checking during the copy). So the support of this 
could be usefull in mtd.


> Having a separate driver infrastructure for clever controllers, which
> provide only semi raw access to the FLASH chip is fine simply because
> such controllers do not fit into the MTD layer.
I wonder if mtd shouldn't modified to handler more clever controller :
I saw some raw nand controller where you can program a batch of 
command/read/write/ecc checking (that work on a internal RAM of the 
controller (and may be use DMA)) and all you have to do is to wait the 
controller do the job.
These controllers are very hard to integrate in current nand layer 
because it is very low level controller oriented.

>> > Correct.  Erase() is the only callback-based function and every single
>> > driver implements it synchronous anyway.  Improving this situation is
>> > needed for mtd's own sake anyway.  Either that or replacing mtd with
>> > something else, likely the block device code.
>>
Current mtd have other limitations (4GB limit fix, dma buffer, ...),
but in the end it should be fixed.


Matthieu

PS : by using mtd layer you :
- will make improvement that will be useful for everybody
- will use a stack that have been and will be well tested
- will have some controller drivers for free
- will have nand fs for free (for people that don't trust FTL).
- may be provide interesting FTL for raw nand controller

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Smartmedia/xd card support - request for comments
@ 2008-04-17  8:50 Alex Dubov
  2008-04-17  9:01 ` Ben Dooks
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Alex Dubov @ 2008-04-17  8:50 UTC (permalink / raw)
  To: Linux kernel mailing list

I've implemented, with generous help from JMicron, a native support for Smartmedia/xD picture card
media. Currently, only JMicron backend is available, but TI expressed some interest in this too,
so TI Flashmedia backend may soon follow.

Smartmedia cards are quite akin to the dumb flash chips, but they have their quirks that put them
aside as a separate media type.

I thought of the following merge structure:

include/linux/
    flash_bd.h
    xd_card.h

drivers/xd_card/
    xd_card_blk.c - protocol implementation
    xd_card_ecc.c - software version of Smartmedia ecc algorithm
    jmb38x_xd.c   - JMicron backend

lib/
    flash_bd.c    - generic FTL implementation

A few more words about flash_bd component. Legacy MemoryStick and SmartMedia cards require direct
management of flash memory. I studied the mtd layer, but found it to be not very helpful, so I
wrote my own FTL module.

Its requirements were:
1. Subsystem independent. For a given byte range it will produce a sequence of generic opcodes
needed to read or write such a range to/off the flash memory, assuming page grained access. This
is used not only for block device operations, but also for metadata retrieval.
2. No FTL related metadata is stored to the flash (as nothing can be assumed about other
readers/writers in interchange media formats).

My FTL implements random block replacement policy, as there's no spec-mandated way to maintain
wear counts on Smartmedia or Memorystick. It also supports block allocation zoning, as required by
these formats.

Current version will always issue whole block writes (no individual page programming). I,in fact,
implemented a version which tracks partially filled blocks, but experiments with some Olympus xd
cards triggered a lot of funny hardware problems with this, and then, it appeared that latest
version of xd card spec specifically disallows partial block writes.

MemoryStick spec does allow individual page writes, but so did an older version of xd card spec.
Given this, I decided to start with simpler version of FTL for now and replace it with a more
complex one if need arises.



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-04-21  1:33 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-19  8:31 Smartmedia/xd card support - request for comments matthieu castet
2008-04-20 16:01 ` Jörn Engel
2008-04-21  1:33   ` Alex Dubov
  -- strict thread matches above, loose matches on Subject: below --
2008-04-17  8:50 Alex Dubov
2008-04-17  9:01 ` Ben Dooks
2008-04-17  9:11   ` Alex Dubov
2008-04-17 13:10     ` Andy Lutomirski
2008-04-17 13:36       ` Arnd Bergmann
2008-04-17 13:38     ` Thomas Gleixner
2008-04-17 14:07       ` Jörn Engel
2008-04-17 19:11         ` Thomas Gleixner
2008-04-17 21:21           ` Jörn Engel
2008-04-18  8:47             ` Alex Dubov
2008-04-18  9:35               ` Thomas Gleixner
2008-04-19  2:49                 ` Alex Dubov
2008-04-19  5:56                   ` Thomas Gleixner
2008-04-18 14:00               ` Jörn Engel
2008-04-19  3:05                 ` Alex Dubov
2008-04-19  6:37                   ` Thomas Gleixner
2008-04-19 16:35                     ` Jörn Engel
2008-04-20  2:25                     ` Alex Dubov
2008-04-17 13:35 ` Thomas Gleixner
2008-04-17 14:19 ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).