diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2011-10-12 12:22:55 -0700 |
---|---|---|
committer | Vadim Bendebury <vbendeb@chromium.org> | 2011-10-12 13:46:50 -0700 |
commit | 028d37a7af3c90054af759a7413b3ecc15fee0ca (patch) | |
tree | 9198207136797541cb393fb86cca9e66b2cbfe14 /drivers | |
parent | cfb04c97ca4d3e6fb7e365dc784a044c813cac1a (diff) |
Enable SPI flash write access when using ICH9.
It turns out that the ICH9 SPI controller comes out of reset with the
BIOS memory area write access disabled, the ability to write into the
BIOS space needs to be enabled explicitly.
BUG=chrome-os-partner:6166
TEST=manual
. build the new firmware image
. program it on Stumpy
. bring up ChromeOS
. try using flashrom to change the firmware image
flashrom was failing before this change and is succeeding now.
Change-Id: I9c5dbbe25171529ff1a227113fe07067b6e15aea
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/9956
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/ich.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c index 95c594d539..fa05a9a6ea 100644 --- a/drivers/spi/ich.c +++ b/drivers/spi/ich.c @@ -370,6 +370,15 @@ void spi_init(void) /* Disable the BIOS write protect so write commands are allowed. */ pci_read_config_byte(dev, 0xdc, &bios_cntl); + switch (ich_version) { + case 9: + /* Deassert SMM BIOS Write Protect Disable. */ + bios_cntl &= ~(1 << 5); + break; + + default: + break; + } pci_write_config_byte(dev, 0xdc, bios_cntl | 0x1); } @@ -599,7 +608,7 @@ int spi_xfer(struct spi_slave *slave, const void *dout, return -1; if (status & SPIS_FCERR) { - puts("ICH SPI: Transaction error\n"); + puts("ICH SPI: Command transaction error\n"); return -1; } @@ -656,7 +665,7 @@ int spi_xfer(struct spi_slave *slave, const void *dout, return -1; if (status & SPIS_FCERR) { - puts("ICH SPI: Transaction error\n"); + puts("ICH SPI: Data transaction error\n"); return -1; } |