summaryrefslogtreecommitdiffstats
path: root/it87spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-03-25 02:50:40 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-03-25 02:50:40 +0000
commit01f3ef4fd1b46cac6b2601c7ae3f4fa1fc1df462 (patch)
treefbcfb9e21e27d3a33bdb778d3907f05a2af13659 /it87spi.c
parented479d2a8728dc12f1f78170cacfaf542cd0b44e (diff)
downloadast2050-flashrom-01f3ef4fd1b46cac6b2601c7ae3f4fa1fc1df462.zip
ast2050-flashrom-01f3ef4fd1b46cac6b2601c7ae3f4fa1fc1df462.tar.gz
Autodetect ITE IT87* LPC->SPI translation on all boards without the need for a board enable
Move boards which had an IT87* SPI board enable from the board enable list to the OK list. Mark the Gigabyte GA-MA78GPM-DS2H as OK. Change the it87spi forced port parameter to it87spiport=... Fix incorrect indentation in the man page. Tested by Ward Vandewege on both variants of the Gigabyte GA-M57SLI-S4 http://www.flashrom.org/pipermail/flashrom/2010-March/002712.html Tested by 李彥學 (Ian-Xue Li) on the Gigabyte GA-MA78GPM-DS2H http://www.flashrom.org/pipermail/flashrom/2010-March/002723.html Corresponding to flashrom svn r983. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Ward Vandewege <ward@gnu.org>
Diffstat (limited to 'it87spi.c')
-rw-r--r--it87spi.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/it87spi.c b/it87spi.c
index 0402211..11087dd 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -106,6 +106,14 @@ static uint16_t find_ite_spi_flash_port(uint16_t port, uint16_t id)
enter_conf_mode_ite(port);
/* NOLDN, reg 0x24, mask out lowest bit (suspend) */
tmp = sio_read(port, 0x24) & 0xFE;
+ /* If IT87SPI was not explicitly selected, we want to check
+ * quickly if LPC->SPI translation is active.
+ */
+ if ((programmer == PROGRAMMER_INTERNAL) && !(tmp & (0x0E))) {
+ msg_pdbg("No IT87* serial flash segment enabled.\n");
+ exit_conf_mode_ite(port);
+ break;
+ }
msg_pdbg("Serial flash segment 0x%08x-0x%08x %sabled\n",
0xFFFE0000, 0xFFFFFFFF, (tmp & 1 << 1) ? "en" : "dis");
msg_pdbg("Serial flash segment 0x%08x-0x%08x %sabled\n",
@@ -135,12 +143,17 @@ static uint16_t find_ite_spi_flash_port(uint16_t port, uint16_t id)
free(programmer_param);
programmer_param = NULL;
}
- if (programmer_param && (portpos = strstr(programmer_param, "port="))) {
- portpos += 5;
- flashport = strtol(portpos, (char **)NULL, 0);
- msg_pinfo("Forcing serial flash port 0x%04x\n", flashport);
- sio_write(port, 0x64, (flashport >> 8));
- sio_write(port, 0x65, (flashport & 0xff));
+ if (programmer_param) {
+ portpos = extract_param(&programmer_param,
+ "it87spiport=", ",:");
+ if (portpos) {
+ flashport = strtol(portpos, (char **)NULL, 0);
+ msg_pinfo("Forcing serial flash port 0x%04x\n",
+ flashport);
+ sio_write(port, 0x64, (flashport >> 8));
+ sio_write(port, 0x65, (flashport & 0xff));
+ free(portpos);
+ }
}
exit_conf_mode_ite(port);
break;
OpenPOWER on IntegriCloud