coreboot-kgpe-d16/src/drivers
Martin Roth 3316cf2ff8 Claim the SPI bus before writes if the IMC ROM is present
The SB800 and Hudson now support adding the IMC ROM which runs from the same
chip as coreboot.  When the IMC is running, write or erase commands sent to
the spi bus will fail, and the IMC will die.  To fix this, we send a request
to the IMC to stop fetching from the SPI rom while we write to it. This
process (in one form or another) is required for writes to the SPI bus while
the IMC is running.

Because the IMC can take up to 500ms to respond every time we claim the
bus, this patch tries to keep the number of times we need to do that to a
minimum.  We only need to claim the bus on writes, and using a counter for
the semaphore allows us to call in once to claim the bus at the beginning
of a number of transactions and it will stay claimed until we release it
at the end of the transactions.

Claim() - takes up to 500ms hit
    claim() - no delay
        erase()
    release()
    claim() - no delay
        write()
    release()
Release()

Change-Id: I4e003c5122a2ed47abce57ab8b92dee6aa4713ed
Signed-off-by: Martin Roth <martin@se-eng.com>
Reviewed-on: http://review.coreboot.org/1976
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
2012-12-12 22:34:16 +01:00
..
ati Get rid of drivers class 2012-11-27 22:00:49 +01:00
dec Get rid of drivers class 2012-11-27 22:00:49 +01:00
elog ELOG: Support for non-memory mapped flash 2012-11-12 17:09:39 +01:00
emulation Get rid of drivers class 2012-11-27 22:00:49 +01:00
generic Get rid of drivers class 2012-11-27 22:00:49 +01:00
i2c Get rid of drivers class 2012-11-27 22:00:49 +01:00
ics Get rid of drivers class 2012-11-27 22:00:49 +01:00
ipmi Get rid of drivers class 2012-11-27 22:00:49 +01:00
maxim Fix maxim max77686 driver 2012-12-12 06:03:26 +01:00
oxford Get rid of drivers class 2012-11-27 22:00:49 +01:00
pc80 build system: Treat cmos.default as text file 2012-11-30 21:24:57 +01:00
realtek Get rid of drivers class 2012-11-27 22:00:49 +01:00
sil Get rid of drivers class 2012-11-27 22:00:49 +01:00
spi Claim the SPI bus before writes if the IMC ROM is present 2012-12-12 22:34:16 +01:00
trident Get rid of drivers class 2012-11-27 22:00:49 +01:00
Kconfig Fix up Maxim MAX77686 driver 2012-12-12 00:27:04 +01:00
Makefile.inc Fix up Maxim MAX77686 driver 2012-12-12 00:27:04 +01:00