Smartmedia/xd card support - request for comments

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux kernel mailing list <linux-kernel@...>
Date: Thursday, April 17, 2008 - 4:50 am

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Smartmedia/xd card support - request for comments, Alex Dubov, (Thu Apr 17, 4:50 am)
Re: Smartmedia/xd card support - request for comments, Thomas Gleixner, (Thu Apr 17, 9:35 am)
Re: Smartmedia/xd card support - request for comments, Thomas Gleixner, (Thu Apr 17, 9:38 am)
Re: Smartmedia/xd card support - request for comments, Thomas Gleixner, (Thu Apr 17, 3:11 pm)
Re: Smartmedia/xd card support - request for comments, Alex Dubov, (Fri Apr 18, 11:05 pm)
Re: Smartmedia/xd card support - request for comments, Thomas Gleixner, (Sat Apr 19, 2:37 am)
Re: Smartmedia/xd card support - request for comments, Alex Dubov, (Sat Apr 19, 10:25 pm)
Re: Smartmedia/xd card support - request for comments, Thomas Gleixner, (Fri Apr 18, 5:35 am)
Re: Smartmedia/xd card support - request for comments, Alex Dubov, (Fri Apr 18, 10:49 pm)
Re: Smartmedia/xd card support - request for comments, Thomas Gleixner, (Sat Apr 19, 1:56 am)
Re: Smartmedia/xd card support - request for comments, Andy Lutomirski, (Thu Apr 17, 9:10 am)
Re: Smartmedia/xd card support - request for comments, Arnd Bergmann, (Thu Apr 17, 9:36 am)