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 /flashrom.c | |
parent | 4cb7a96153c471c8f35a4803198c2059227a4263 (diff) | |
download | flashrom-05dfbe67d661d9637a0aa9091a0cb9581b39284a.tar.gz flashrom-05dfbe67d661d9637a0aa9091a0cb9581b39284a.tar.bz2 flashrom-05dfbe67d661d9637a0aa9091a0cb9581b39284a.zip |
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 'flashrom.c')
-rw-r--r-- | flashrom.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/flashrom.c b/flashrom.c index 5821371d9..da7267fb0 100644 --- a/flashrom.c +++ b/flashrom.c @@ -116,6 +116,22 @@ const struct programmer_entry programmer_table[] = { .delay = internal_delay, }, + { + .init = ft2232_spi_init, + .shutdown = dummy_shutdown, + .map_flash_region = dummy_map, + .unmap_flash_region = dummy_unmap, + .chip_readb = dummy_chip_readb, + .chip_readw = fallback_chip_readw, + .chip_readl = fallback_chip_readl, + .chip_readn = fallback_chip_readn, + .chip_writeb = dummy_chip_writeb, + .chip_writew = fallback_chip_writew, + .chip_writel = fallback_chip_writel, + .chip_writen = fallback_chip_writen, + .delay = internal_delay, + }, + {}, }; @@ -589,7 +605,7 @@ void usage(const char *name) " -i | --image <name>: only flash image name from flash layout\n" " -L | --list-supported: print supported devices\n" " -p | --programmer <name>: specify the programmer device\n" - " (internal, dummy, nic3com, satasii, it87spi)\n" + " (internal, dummy, nic3com, satasii, it87spi, ft2232spi)\n" " -h | --help: print this help text\n" " -R | --version: print the version (release)\n" "\nYou can specify one of -E, -r, -w, -v or no operation.\n" @@ -747,6 +763,8 @@ int main(int argc, char *argv[]) pcidev_bdf = strdup(optarg + 8); } else if (strncmp(optarg, "it87spi", 7) == 0) { programmer = PROGRAMMER_IT87SPI; + } else if (strncmp(optarg, "ft2232spi", 9) == 0) { + programmer = PROGRAMMER_FT2232SPI; } else { printf("Error: Unknown programmer.\n"); exit(1); |