1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

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>
This commit is contained in:
Paul Fox
2009-06-16 21:08:06 +00:00
committed by Carl-Daniel Hailfinger
parent 4cb7a96153
commit 05dfbe67d6
6 changed files with 349 additions and 9 deletions

View File

@ -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;