Map driver usage

David Woodhouse dwmw2 at
Tue Dec 18 11:05:45 EST 2001

rob at said:
>  I have a question regarding the usage od the access primitives (e.g.
> xx_read8(), xx_read16(), xx_copy_from() and so on). In writing a map
> driver, can one assume that the MTD layer never calls these functions
> to cross a flash device's block boundary ?

No. JFFS may do large reads which cross eraseblock boundaries, and the 
flash driver will translate that directly into a large ->copy_from call.

> The reason I'm asking is that I am writing a new map driver for a
> board that has a somwhat strange logical flash layout and I would like
> to hide that by "shuffling" some of the blocks so that they appear at
> different offsets. Transforming the offset parameter in the above
> mentioned functions would be an easy way to do this, but it requires
> that these functions are never asked to cross an erase block boundary.

I wouldn't do it in the map driver. Do it in the partitioning layer - 
that's already mucking around with the offsets anyway.


More information about the linux-mtd mailing list