diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-11-24 00:20:03 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-11-24 00:20:03 +0000 |
commit | 31336dc36e1d176a8e041285ca69a329840bf5ce (patch) | |
tree | 1978ce52ae758b879635c7a8a9c2651f739844f8 /flash.h | |
parent | 30c2766204434b4680f939222d968674ed4633d1 (diff) | |
download | flashrom-31336dc36e1d176a8e041285ca69a329840bf5ce.zip flashrom-31336dc36e1d176a8e041285ca69a329840bf5ce.tar.gz |
Add Bus Pirate SPI support
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 'flash.h')
-rw-r--r-- | flash.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -104,6 +104,9 @@ enum programmer { #if SERPROG_SUPPORT == 1 PROGRAMMER_SERPROG, #endif +#if BUSPIRATE_SPI_SUPPORT == 1 + PROGRAMMER_BUSPIRATESPI, +#endif PROGRAMMER_INVALID /* This must always be the last entry. */ }; @@ -484,6 +487,12 @@ int bitbang_spi_send_command(unsigned int writecnt, unsigned int readcnt, const int bitbang_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len); int bitbang_spi_write_256(struct flashchip *flash, uint8_t *buf); +/* buspirate_spi.c */ +int buspirate_spi_init(void); +int buspirate_spi_shutdown(void); +int buspirate_spi_send_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); +int buspirate_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len); + /* flashrom.c */ extern char *programmer_param; extern int verbose; @@ -527,6 +536,9 @@ enum spi_controller { #if DUMMY_SUPPORT == 1 SPI_CONTROLLER_DUMMY, #endif +#if BUSPIRATE_SPI_SUPPORT == 1 + SPI_CONTROLLER_BUSPIRATE, +#endif SPI_CONTROLLER_INVALID /* This must always be the last entry. */ }; extern const int spi_programmer_count; |