From 05dfbe67d661d9637a0aa9091a0cb9581b39284a Mon Sep 17 00:00:00 2001 From: Paul Fox Date: Tue, 16 Jun 2009 21:08:06 +0000 Subject: This patch adds support for a new SPI programmer, based on the FT2232H/4232H chip from FTDI FTDI support is autodetected during compilation. Paul writes: There are certainly possible improvements: The code has hard-coded values for which interface of the ftdi chip to use (interface B was chosen because libftdi seems to have trouble with A right now), what clock rate use for the SPI interface (I've been running at 30Mhz, but the patch sets it to 10Mhz), and possibly others. I think this means that per-programmer options might be a good idea at some point. Carl-Daniel writes: There is one additional FIXME comment in the code, but AFAICS that problem is not solvable with current libftdi. Corresponding to flashrom svn r598. Signed-off-by: Paul Fox Signed-off-by: Carl-Daniel Hailfinger Acked-by: Uwe Hermann --- flash.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'flash.h') diff --git a/flash.h b/flash.h index be95bf9..b1ee6d3 100644 --- a/flash.h +++ b/flash.h @@ -86,6 +86,7 @@ extern int programmer; #define PROGRAMMER_NIC3COM 0x02 #define PROGRAMMER_SATASII 0x03 #define PROGRAMMER_IT87SPI 0x04 +#define PROGRAMMER_FT2232SPI 0x05 struct programmer_entry { const char *vendor; @@ -358,6 +359,13 @@ void satasii_chip_writeb(uint8_t val, chipaddr addr); uint8_t satasii_chip_readb(const chipaddr addr); extern struct pcidev_status satas_sii[]; +/* ft2232_spi.c */ +int ft2232_spi_init(void); +int ft2232_spi_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr); +int ft2232_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len); +int ft2232_spi_write1(struct flashchip *flash, uint8_t *buf); +int ft2232_spi_write_256(struct flashchip *flash, uint8_t *buf); + /* flashrom.c */ extern int verbose; #define printf_debug(x...) { if (verbose) printf(x); } @@ -388,6 +396,7 @@ enum spi_controller { SPI_CONTROLLER_SB600, SPI_CONTROLLER_VIA, SPI_CONTROLLER_WBSIO, + SPI_CONTROLLER_FT2232, SPI_CONTROLLER_DUMMY, }; extern enum spi_controller spi_controller; -- cgit v1.1