
Implementing a Common Layout for AMD MirrorBit
TM
and Intel StrataFlash
TM
Memory Devices
9
Implementing Flexible Device Drivers with
CFI
For applications requiring a more optimized driver that
will take advantage of device specific functions such as
different sector sizes, sector protection, write buffers,
or precise timing characteristics system designers can
take advantage of a table that stores this data within
each flash device. Command Flash Interface (CFI) is a
standardized data structure and command set that was
specifically created to allow system designers to query
the installed flash device to determine its command
sets and configuration data. Flexible drivers can then
be written to take advantage of manufacturer-specific
command sets or device-specific features.
To use CFI the software must know where to locate
vendor-specific information, in what format the data ap-
pears, and which parameters are of interest. Figure 6
shows an example of a CFI query algorithm that can be
used to gather the required information from both AMD
and Intel CFI compliant devices. This algorithm as-
sumes you have used an algorithm similar to Figure 5
to determine the proper Device ID and Manufacturer
ID.
The first step is to enter CFI mode by sending com-
mand 98h to address 55h. The device must be in read
array mode to accept this command. A list of address
locations can then be read in any order to access any
required information in the CFI Table. The entire table
is structured in two main sections. The first holds stan-
dard device identifiers and command sets common to
all flash devices such as voltage ranges, timing param-
eters and device geometry. The second section con-
tains vendor-specific commands such as page mode,
sector protection schemes, and top/bottom boot flags.
For more detailed information on CFI table structure
refer to CFI publication 100 found at www.amd.com/
http://www.amd.com/products/nvd/overview/cfi.html.
The algorithm below focuses on the first half of the CFI
table by detecting device size, erase sector architec-
ture, and device timeouts. It can easily be extended to
query vendor-specific information.