From d5b28fae1da48233753a19d3fa007c204786ec8c Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Tue, 24 Nov 2009 18:27:10 +0000 Subject: Add the ability to set Bus Pirate SPI speed via the command line Example usage: flashrom -p buspiratespi:spispeed=2.6MHz,dev=/dev/foo flashrom -p buspiratespi:dev=/dev/foo,spispeed=2.6M Refactor programmer option parsing (this allows cleanups in other programmers as well). Increase SPI read size from 8 to 12 bytes (current single-transaction limit of the Bus Pirate raw SPI protocol). Add Bus Pirate to the list of programmers supporting 4 byte RDID. Add Bus Pirate syntax to the man page. Tested-by: Sean Nelson Corresponding to flashrom svn r776. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Sean Nelson --- flash.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'flash.h') diff --git a/flash.h b/flash.h index b271b8ac..008af284 100644 --- a/flash.h +++ b/flash.h @@ -488,6 +488,10 @@ 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 */ +struct buspirate_spispeeds { + const char *name; + const int speed; +}; 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); @@ -503,6 +507,7 @@ int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len); int erase_flash(struct flashchip *flash); int min(int a, int b); int max(int a, int b); +char *extract_param(char **haystack, char *needle, char *delim); int check_erased_range(struct flashchip *flash, int start, int len); int verify_range(struct flashchip *flash, uint8_t *cmpbuf, int start, int len, char *message); char *strcat_realloc(char *dest, const char *src); -- cgit v1.2.3