mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +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:

committed by
Carl-Daniel Hailfinger

parent
4cb7a96153
commit
05dfbe67d6
7
spi.c
7
spi.c
@ -47,6 +47,8 @@ int spi_command(unsigned int writecnt, unsigned int readcnt,
|
||||
return sb600_spi_command(writecnt, readcnt, writearr, readarr);
|
||||
case SPI_CONTROLLER_WBSIO:
|
||||
return wbsio_spi_command(writecnt, readcnt, writearr, readarr);
|
||||
case SPI_CONTROLLER_FT2232:
|
||||
return ft2232_spi_command(writecnt, readcnt, writearr, readarr);
|
||||
case SPI_CONTROLLER_DUMMY:
|
||||
return dummy_spi_command(writecnt, readcnt, writearr, readarr);
|
||||
default:
|
||||
@ -212,6 +214,7 @@ int probe_spi_rdid4(struct flashchip *flash)
|
||||
case SPI_CONTROLLER_VIA:
|
||||
case SPI_CONTROLLER_SB600:
|
||||
case SPI_CONTROLLER_WBSIO:
|
||||
case SPI_CONTROLLER_FT2232:
|
||||
case SPI_CONTROLLER_DUMMY:
|
||||
return probe_spi_rdid_generic(flash, 4);
|
||||
default:
|
||||
@ -726,6 +729,8 @@ int spi_chip_read(struct flashchip *flash, uint8_t *buf, int start, int len)
|
||||
return ich_spi_read(flash, buf, start, len);
|
||||
case SPI_CONTROLLER_WBSIO:
|
||||
return wbsio_spi_read(flash, buf, start, len);
|
||||
case SPI_CONTROLLER_FT2232:
|
||||
return ft2232_spi_read(flash, buf, start, len);
|
||||
default:
|
||||
printf_debug
|
||||
("%s called, but no SPI chipset/strapping detected\n",
|
||||
@ -774,6 +779,8 @@ int spi_chip_write_256(struct flashchip *flash, uint8_t *buf)
|
||||
return ich_spi_write_256(flash, buf);
|
||||
case SPI_CONTROLLER_WBSIO:
|
||||
return wbsio_spi_write_1(flash, buf);
|
||||
case SPI_CONTROLLER_FT2232:
|
||||
return ft2232_spi_write_256(flash, buf);
|
||||
default:
|
||||
printf_debug
|
||||
("%s called, but no SPI chipset/strapping detected\n",
|
||||
|
Reference in New Issue
Block a user