Flash memory devices typically need to be erased before they are
written, and most flash devices can only be erased on large block
boundaries like 64K or 128K. The Flash Translation Layer driver,
ftl_cs ,
implements a sort of virtual sector-addressable block device that
hides the details of erase operations. Using the FTL driver, a flash
memory card can be treated as an ordinary block device.
The
ftl_cs
driver allocates a major device number when it is loaded. Minor
device numbers have a bitwise layout of 'dddrrppp'. 'ddd' is the
device number, with one card counting as one device. 'rr' is the
common-memory region number, generally 0. And 'ppp' selects a logical
partition within the FTL region.
The default configuration script for FTL devices will create a block
device with the name of the form '/dev/ftl{d}c{r}', where '{d}' is the
device number and '{r}' is the region number, that spans the
entire FTL region. It also creates devices '/dev/ftl{d}c{r}p[1-4]'
pointing to partitions 1 through 4 within this FTL region.
An FTL region must be formatted before use. The formatting
utility,
ftl_format ,
needs to write to the corresponding raw memory device rather than the
FTL device interface.