Linux explorations: flash memory (2)
Continuing yesterday's work on learning about flash memories and
how they work in Linux.
1. More wikipedia
2. MTD documentation
== 1. More wikipedia
https://en.wikipedia.org/wiki/Flash_memory
Lots of informtation, of which I'm summing up what I found most
significative:
* EEPROM:
The whole device needs to be erased before rerites
* NOR:
Random access reads, random access writes on erased words,
block erase.
Erase block size: 64/128/256 KiB.
Suitable for configuration data and firmware.
Suitable for XIP - Execute In Place, firmware directly executed
from flash.
More reliable than NAND (less likely to have bit flips).
Mnemonic: NOeRror :)
* NAND:
Block devices.
Blocks are composed of Pages.
The typical page size is 512/2048/4096 B.
Reads and writes are per-page, erasures are per block.
Less expensive than NOR.
More likely to have errors (each page has its ECC - Error
Correcting Codes).
Faster erase.
Best suited for large size -> common for storage, e.g. USB
drives, [e]MMC...
* Common:
Reset of a block turns every bit into 1.
Programming turns selected bits into 0.
It is feasible (not necessarily implemented) to update words as
long as done by turning further 1 bits into 0.
* Serial Flash (e.g. via SPI bus):
Common as it makes the PCB design simpler.
A RAM buffer might be placed between the SPI bus and the flash,
to increase the speed of data modifications.
A RAM buffer might be placed between the SPI bus and the CPU,
to improve speed (code shadowing).
== 2. MTD documentation
http://www.linux-mtd.infradead.org/doc/general.html
I found this one interesting:
http://www.linux-mtd.infradead.org/doc/nand.html