[flashrom] [PATCH 2/2] sbxxx: hack to disable fast reads and force lowest possible SPI clock

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Thu Apr 18 18:02:39 CEST 2013


Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
 sb600spi.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sb600spi.c b/sb600spi.c
index 42a0ece..95e5ad1 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -246,6 +246,16 @@ int sb600_probe_spi(struct pci_dev *dev)
 	msg_pdbg("PrefetchEnSPIFromHost=%i, SpiOpEnInLpcMode=%i\n",
 		     tmp & 0x1, (tmp & 0x20) >> 5);
 	tmp = mmio_readl(sb600_spibar);
+	if (((tmp >> 18) & 0x3) != 0) {
+		msg_pdbg("Disabling fast reads and setting SPI clock to 16.5 MHz...");
+		tmp &= ~(0x3 << 18);
+		mmio_writel(tmp, sb600_spibar);
+		mmio_writeb(mmio_readb(sb600_spibar + 0xd) | (0x3 << 4), sb600_spibar + 0xd);
+
+		tmp = mmio_readl(sb600_spibar);
+		msg_pdbg(" done\n");
+	}
+
 	/* FIXME: If SpiAccessMacRomEn or SpiHostAccessRomEn are zero on
 	 * SB700 or later, reads and writes will be corrupted. Abort in this
 	 * case. Make sure to avoid this check on SB600.
-- 
Kind regards, Stefan Tauner





More information about the flashrom mailing list