summaryrefslogtreecommitdiffstats
path: root/nicintel_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'nicintel_spi.c')
-rw-r--r--nicintel_spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/nicintel_spi.c b/nicintel_spi.c
index 3882e81..28d332e 100644
--- a/nicintel_spi.c
+++ b/nicintel_spi.c
@@ -148,6 +148,11 @@ int nicintel_spi_init(void)
nicintel_spibar = physmap("Intel Gigabit NIC w/ SPI flash",
io_base_addr, 4096);
+ /* Automatic restore of EECD on shutdown is not possible because EECD
+ * does not only contain FLASH_WRITES_DISABLED|FLASH_WRITES_ENABLED,
+ * but other bits with side effects as well. Those other bits must be
+ * left untouched.
+ */
tmp = pci_mmio_readl(nicintel_spibar + EECD);
tmp &= ~FLASH_WRITES_DISABLED;
tmp |= FLASH_WRITES_ENABLED;
@@ -167,6 +172,9 @@ int nicintel_spi_shutdown(void)
{
uint32_t tmp;
+ /* Disable writes manually. See the comment about EECD in
+ * nicintel_spi_init() for details.
+ */
tmp = pci_mmio_readl(nicintel_spibar + EECD);
tmp &= ~FLASH_WRITES_ENABLED;
tmp |= FLASH_WRITES_DISABLED;
OpenPOWER on IntegriCloud