summaryrefslogtreecommitdiffstats
path: root/it87spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-06-28 10:57:58 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-06-28 10:57:58 +0000
commit98d9f01fe157367d9bc00607320c01bee575d2bf (patch)
tree953fc3ab094716868fe397d7a0ae0bb4052782cb /it87spi.c
parentbc378ae50b42cf88d0f819ae98af5001bdc61e7b (diff)
downloadflashrom-98d9f01fe157367d9bc00607320c01bee575d2bf.zip
flashrom-98d9f01fe157367d9bc00607320c01bee575d2bf.tar.gz
Handle programmer init errors and abort
If the programmer didn't initialize correctly, it is pointless to continue. Fix standalone IT87* SPI init to set flashbus to NONE if no IT87* SPI communication is possible. Print the I/O port detected by the IT87* SPI code. Corresponding to flashrom svn r633. 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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/it87spi.c b/it87spi.c
index 5183bae..67dfd2b 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -83,11 +83,12 @@ static uint16_t find_ite_spi_flash_port(uint16_t port)
tmp |= 1 << 4;
sio_write(port, 0x24, tmp);
}
- printf("serial flash pin %i\n", (tmp & 1 << 5) ? 87 : 29);
+ printf("Serial flash pin %i\n", (tmp & 1 << 5) ? 87 : 29);
/* LDN 0x7, reg 0x64/0x65 */
sio_write(port, 0x07, 0x7);
flashport = sio_read(port, 0x64) << 8;
flashport |= sio_read(port, 0x65);
+ printf("Serial flash port 0x%04x\n", flashport);
}
exit_conf_mode_ite(port);
return flashport;
@@ -113,8 +114,11 @@ int it87spi_init(void)
get_io_perms();
ret = it87spi_common_init();
- if (!ret)
+ if (!ret) {
buses_supported = CHIP_BUSTYPE_SPI;
+ } else {
+ buses_supported = CHIP_BUSTYPE_NONE;
+ }
return ret;
}
OpenPOWER on IntegriCloud