summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-11-24 00:20:03 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-11-24 00:20:03 +0000
commit5cca01f3943d888f9ee5f1efcf9faa0269bf8533 (patch)
tree1978ce52ae758b879635c7a8a9c2651f739844f8 /flashrom.c
parente51ea10a8889544b942d3490bb721f160fe09517 (diff)
downloadflashrom-5cca01f3943d888f9ee5f1efcf9faa0269bf8533.tar.gz
flashrom-5cca01f3943d888f9ee5f1efcf9faa0269bf8533.tar.bz2
flashrom-5cca01f3943d888f9ee5f1efcf9faa0269bf8533.zip
Cleanly validate ICH SPI preopcodes
The code should work on Linux/*BSD/MacOSX and relies on the serial code implementation in serial.c. Support for additional platforms (Windows) will have to be added to serial.c for this to work. For tests without a Bus Pirate (or with non-functional serial code) it is possible to #define FAKE_COMMUNICATION in buspirate_spi.c. Thanks to Sean Nelson for the SPI mode settings code. I tweaked it a bit to make configuration from a commandline easier should anybody want that feature. Tested-by: Sean Nelson <audiohacked@gmail.com> Corresponding to flashrom svn r772. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Sean Nelson <audiohacked@gmail.com>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/flashrom.c b/flashrom.c
index c4cfeef6e..7e681ccd1 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -204,6 +204,25 @@ const struct programmer_entry programmer_table[] = {
},
#endif
+#if BUSPIRATE_SPI_SUPPORT == 1
+ {
+ .name = "buspiratespi",
+ .init = buspirate_spi_init,
+ .shutdown = buspirate_spi_shutdown,
+ .map_flash_region = fallback_map,
+ .unmap_flash_region = fallback_unmap,
+ .chip_readb = noop_chip_readb,
+ .chip_readw = fallback_chip_readw,
+ .chip_readl = fallback_chip_readl,
+ .chip_readn = fallback_chip_readn,
+ .chip_writeb = noop_chip_writeb,
+ .chip_writew = fallback_chip_writew,
+ .chip_writel = fallback_chip_writel,
+ .chip_writen = fallback_chip_writen,
+ .delay = internal_delay,
+ },
+#endif
+
{}, /* This entry corresponds to PROGRAMMER_INVALID. */
};