Smartmedia/xd card support - request for comments
Hi,
Quoted 17 lines · Alex Dubov
First off, can you please use a mail client which does line breaks at around 78 chars ?
Quoted 12 lines
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 thexd_card_blk.cthat it can operate both completely dumb controllers, while taking protocol shortcuts (usinghost->caps) to accommodate smarter readers (the only feature currently not there is adapter-side page copy - it can be easily added underFBD_COPYclause inxd_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.
Quoted 3 lines
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.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
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
Quoted 8 lines · matthieu castet
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.
The obvious solution is to have seperate io scheduling from io completion. Requires an asynchronous interface to read/write and some sort of request queue.
Not quite as obvious is the question of whether to add all this to mtd or to replace mtd with block devices, which already have it.
Jörn
Signature · 3 lines
Never argue with idiots - first they drag you down to their level, then they beat you with experience. -- unknown
Quoted 9 lines
Quoted 8 lines
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.
Quoted 7 lines
The obvious solution is to have seperate io scheduling from io completion. Requires an asynchronous interface to read/write and some sort of request queue.
Not quite as obvious is the question of whether to add all this to mtd or to replace mtd with block devices, which already have it.
I was thinking about it myself and it appears to be the only solution outright.
The interesting, but apparently hard way to do so is to define a couple of REQ_TYPE_SPECIAL mtd-specific commands and use the existing block device queue to manipulate them. This can even open the possibility of "static" request
translation: mtd_blkdev can pop the block device request, put it through media specific translator and then push a necessary set of mtd operations back into the same queue, delegating the processing to raw mtd device.
The simpler approach I'm following with my xd_card_blk is to define a simplistic, block device like api. First, the translator is initialized with the request range (offset + length) and backend is notified to start processing. The backend then pulls flash requests (READ, WRITE, COPY, ERASE) from the translator, possibly putting them through additional, protocol/host specific translation layer.
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ