Flash devices, including NOR flash devices such as CFI flash chips and NAND flash
devices such as the DOC, are not like disk storage devices. They cannot be written to
and read from arbitrarily. To understand how to operate flash chips properly, we must
first look at how they operate internally. Flash devices are generally divided into erase
blocks. Initially, an empty block will have all its bits set to 1. Writing to this block
amounts to clearing bits to 0. Once all the bits in a block are cleared (set to 0), the only
possible way to erase this block is to set all of its bits to 1 simultaneously. With NOR
flash devices, bits can be set to 0 individually in an erase block until the entire block is
full of 0s. NAND flash devices, on the other hand, have their erase blocks divided further
into pages, of 512 bytes typically, which can only be written to a certain number of times
—typically less than 10 times—before their content becomes undefined. Pages can then
only be reused once the blocks they are part of are erased in their entirety
Hi,
having worked on CFI and NAND flash drivers on Linux, I feel what you have posted is highly elementary and basic. for ex you fail to mention basic difference between NOR/NAND flash chips, XIP property and lot other differences.