Rewrite substantial parts of the ICH SPI support
This megapatch rewrites substantial parts of ICH SPI to actually do
what the SPI layer wants instead of its own weird idea about commands
(running unrequested commands, running modified commands). Besides that,
there is a fair share of cleanups as well.
- Add JEDEC_EWSR (Enable Write Status Register) to default commands. -
Mark a no longer used opcode/preopcode table as unused. - Declare all
commands as non-atomic/standalone by default. The ICH SPI driver has
no business executing commands (preopcodes) automatically if they were
not requested. - Automatically adjust preopcode/opcode pairings (like
WREN+ERASE) based on what the SPI layer requested. The ICH SPI driver
has no business executing altered opcode pairs as it sees fit. - Fix
incomplete initialization in the case of a locked down chipset. Leaving
the first 4 opcodes with uninitialized pairings had unpredictable
results. - switch() exists for a reason. Nested if() checking on the
same variable is an interesting style. - Actually check if the requested
readcnt/writecnt for a command is supported by the hardware instead
of delivering corrupt/incomplete commands and data. - If a command
has unsupported readlen/writelen, complain loudly to the user. - Use
find_opcode instead of open-coding the same stuff in a dozen variations.
- Introduce infrastructure for updating the command set of unlocked
chipsets on the fly.
Corresponding to flashrom svn r894.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: David Hendricks <dhendrix@google.com>
1 file changed