SFDP (Serial Flash Discoverable Parameters) is a JEDEC standard for querying the capabilities of serial flash chips. This allows software like flashrom to support chips without having all properties hard-coded beforehand. SFDP is structured in tables which are laid out in their own linear address space (independent from the “normal” range used to access the stored data). Starting at address 0x0 a mandatory header begins with a signature 0x50444653 (or ‘S’, ‘F’, ‘D’, ‘P’ in ASCII) followed by versioning data and the number of parameter headers. These headers are 64b long and have fields for versioning data, identification, length and offset where the real stuff i.e. the parameter table resides. There is one mandatory table and up to 255 can be added optionally. In the current version of the standard (2011-04) only the mandatory table is defined, but vendors are free (and quite encouraged by the standard) to add their customized tables and from the few data sheets i have seen mentioning SFDP the vendors do that (see below).
I spare you from the nasty details, but keep in mind that the mandatory table allows to retrieve the following properties:
- the total size of the device
- 4 (unified) block erasers (size of erase blocks and associated opcode)
- address mode (24b, 32b or both)
- status register write enable (none, WREN or EWSR)
- lots of fast read-related stuff (like modes supported and number of wait states/dummy cycles needed in each)
The good news is: this would be enough to allow flashrom to work with unknown (yet unreleased) chips without recompilation!
The even better news is: i have a patch for that 😉
The bad news: i am not sure if there exists any hardware that supports it yet. Continue reading GSoC 2011: flashrom part 2 – SFDP