summaryrefslogtreecommitdiff
path: root/spi.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-11-24 00:20:03 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-11-24 00:20:03 +0000
commit1e010a4aead9b61e4ea3ae776f5ef1c59a8c5adb (patch)
tree1978ce52ae758b879635c7a8a9c2651f739844f8 /spi.c
parentc46274b04a255a059596a02cc45b583a0453d9e1 (diff)
downloadflashrom-1e010a4aead9b61e4ea3ae776f5ef1c59a8c5adb.tar.gz
Add Bus Pirate SPI support to flashrom.
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. 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> Tested-by: Sean Nelson <audiohacked@gmail.com> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@772 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/spi.c b/spi.c
index 29c202c..f117c8f 100644
--- a/spi.c
+++ b/spi.c
@@ -100,6 +100,15 @@ const struct spi_programmer spi_programmer[] = {
},
#endif
+#if BUSPIRATE_SPI_SUPPORT == 1
+ { /* SPI_CONTROLLER_BUSPIRATE */
+ .command = buspirate_spi_send_command,
+ .multicommand = default_spi_send_multicommand,
+ .read = buspirate_spi_read,
+ .write_256 = spi_chip_write_1,
+ },
+#endif
+
{}, /* This entry corresponds to SPI_CONTROLLER_INVALID. */
};