diff options
author | Paul Fox <pgf@laptop.org> | 2009-06-16 21:08:06 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-06-16 21:08:06 +0000 |
commit | 05dfbe67d661d9637a0aa9091a0cb9581b39284a (patch) | |
tree | 643f8aa5fe48c5f7881b87fee7f5802070df2589 /flash.h | |
parent | 4cb7a96153c471c8f35a4803198c2059227a4263 (diff) | |
download | ast2050-flashrom-05dfbe67d661d9637a0aa9091a0cb9581b39284a.zip ast2050-flashrom-05dfbe67d661d9637a0aa9091a0cb9581b39284a.tar.gz |
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 <pgf@laptop.org>
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'flash.h')
-rw-r--r-- | flash.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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; |