Embedded Storage 97
of these pages contains an additional 8- or 16-byte spare area called out-
of-band data, which stores the ECC, bad block information, and any file
system–dependent data. These functions are used to access the out-of-
band data.
4.4 Sample MTD Driver for NOR Flash
We now go into the details of a NOR flash driver for Linux. The file mtd.c
contains the code for a simple NOR flash based on the following assumptions.
The flash device has a single erase region so that all sectors have the same
size. (An erase region is defined as an area of a chip that contains the
sectors of the same size.)
The flash chip is accessed using a 4-byte bus width.
There are no locking, unlocking, suspend, and resume functionalities.
For simplicity’s sake we assume ...