From 5cca01f3943d888f9ee5f1efcf9faa0269bf8533 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Tue, 24 Nov 2009 00:20:03 +0000 Subject: 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 Corresponding to flashrom svn r772. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Reinauer Acked-by: Sean Nelson --- spi.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spi.c') 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. */ }; -- cgit v1.1