DataFlash & writesize
Artem B. Bityutskiy
dedekind at yandex.ru
Tue Jun 27 03:05:55 EDT 2006
David,
David Brownell wrote:
> What are the intended semantics for "writesize" by the way?
Design-wise, it an attempt to generalize MTD. Different flashes have
different minimal I/O unit size, like 1 byte in case of NOR, 16 bytes in
case of ECCed NOR, 512/2K in case of NAND, etc. There were no such a
field before and we had to do ugly things like
switch (mtd->type) {
case MTD_NORFLASH:
blah();
break;
case MTD_NANDFLASH:
blah1();
etc.
Here is a comment from include/linux/mtd.h:
/* Minimal writable flash unit size. In case of NOR flash it is 1 (even
* though individual bits can be cleared), in case of NAND flash it is
* one NAND page (or half, or one-fourths of it), in case of ECC-ed NOR
* it is of ECC block size, etc. It is illegal to have writesize = 0.
* Any driver registering a struct mtd_info must ensure a writesize of
* 1 or larger.
*/
> I noticed I was getting that first BUG_ON in mtdcore:add_mtd_device
> since, with NOR CFI cmdset 1 flash, with current GIT. Seems like
> writesie should have been set up already.
We fixed all drivers and now it should be fine - see commit
17ffc7ba6d7ea68b8d5f55a5ca1b87163e69720d
--
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.
More information about the linux-mtd
mailing list