MTD driver for Atmel serial flash
Hi
I am developing an MTD driver for an Atmel serial flash.
The device has 264 byte pages and they can be erased and written individually.
I'm not sure what values to put in the mtd_info structure. I intend this to be used with JFFS2.
Currently I have
mtd->name = "atmel";
mtd->type = MTD_OTHER;
mtd->flags = MTD_WRITEB_WRITEABLE | MTD_ERASEABLE | MTD_CLEAR_BITS |MTD_SET_BITS;
mtd->size = 256 * 2048;
mtd->read = serial_read;
mtd->write = serial_write;
mtd->sync = serial_sync;
mtd->erase = serial_erase;
mtd->erasesize = 256;
As you can see, I am hiding the extra 8 bytes per page from the MTD system, this makes the read/writes simpler.
An advice/pointers on the right way to do this would be much appreciated.
Cheers
Derek
Quoted 5 lines · [email protected] said:
As you can see, I am hiding the extra 8 bytes per page from the MTD
system, this makes the read/writes simpler.An advice/pointers on the right way to do this would be much appreciated.
Hmmm. Very little code is prepared to deal with erase blocks with a size that isn't a power of two. The best way forward is probably to pretend to be normal NOR flash with a larger erase size.
--
dwmw2