summaryrefslogtreecommitdiffstats
path: root/it87spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-05-16 00:19:52 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2008-05-16 00:19:52 +0000
commit337df1d618327e9e440d21725dd9486f3c179898 (patch)
tree18ba00652c0b471ee9e4d93c2ef132f35ca869cc /it87spi.c
parentf43e6428dbde77e6610ca891724c8f39ad8ba181 (diff)
downloadast2050-flashrom-337df1d618327e9e440d21725dd9486f3c179898.zip
ast2050-flashrom-337df1d618327e9e440d21725dd9486f3c179898.tar.gz
IT8716F: Enable writes if decoding of any SPI addresses is enabled
Corresponding to flashrom svn r238 and coreboot v2 svn r3324. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'it87spi.c')
-rw-r--r--it87spi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/it87spi.c b/it87spi.c
index 1fd3309..75010df 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -93,6 +93,12 @@ static uint16_t find_ite_spi_flash_port(uint16_t port)
0xFFF80000, 0xFFFEFFFF, (tmp & 1 << 3) ? "en" : "dis");
printf("LPC write to serial flash %sabled\n",
(tmp & 1 << 4) ? "en" : "dis");
+ /* If any serial flash segment is enabled, enable writing. */
+ if ((tmp & 0xe) && (!(tmp & 1 << 4))) {
+ printf("Enabling LPC write to serial flash\n");
+ tmp |= 1 << 4;
+ regwrite(port, 0x24, tmp);
+ }
printf("serial flash pin %i\n", (tmp & 1 << 5) ? 87 : 29);
/* LDN 0x7, reg 0x64/0x65 */
regwrite(port, 0x07, 0x7);
OpenPOWER on IntegriCloud