summaryrefslogtreecommitdiffstats
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-10 21:08:55 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-10 21:08:55 +0000
commit6679f03b9e1bd28b0a61a39bf11863ac6e31f7b7 (patch)
tree4cd9e2881c6f02f26270149770210e6d1aa742cd /ft2232_spi.c
parent979edaa7d128fdce7053afc75f9cde8d7146ee3c (diff)
downloadflashrom-6679f03b9e1bd28b0a61a39bf11863ac6e31f7b7.zip
flashrom-6679f03b9e1bd28b0a61a39bf11863ac6e31f7b7.tar.gz
Add SPI multicommand infrastructure
Some SPI opcodes need to be sent in direct succession after each other without any chip deselect happening in between. A prominent example is WREN (Write Enable) directly before PP (Page Program). Intel calls the first opcode in such a row "preopcode". Right now, we ignore the direct succession requirement completely and it works pretty well because most onboard SPI masters have a timing or heuristics which make the problem disappear. The FT2232 SPI flasher is different. Since it is an external flasher, timing is very different to what we can expect from onboard flashers and this leads to failure at slow speeds. This patch allows any function to submit multiple SPI commands in a stream to any flasher. Support in the individual flashers isn't implemented yet, so there is one generic function which passes the each command in the stream one-by-one to the command functions of the selected SPI flash driver. Tested-by: Jakob Bornecrantz <wallbraker@gmail.com> Corresponding to flashrom svn r645. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r--ft2232_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ft2232_spi.c b/ft2232_spi.c
index d8ca743..ea7a810 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -193,7 +193,7 @@ int ft2232_spi_init(void)
return 0;
}
-int ft2232_spi_command(unsigned int writecnt, unsigned int readcnt,
+int ft2232_spi_send_command(unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr, unsigned char *readarr)
{
struct ftdi_context *ftdic = &ftdic_context;
@@ -298,7 +298,7 @@ int ft2232_spi_init(void)
exit(1);
}
-int ft2232_spi_command(unsigned int writecnt, unsigned int readcnt,
+int ft2232_spi_send_command(unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr, unsigned char *readarr)
{
fprintf(stderr, "FT2232 SPI support was not compiled in\n");
OpenPOWER on IntegriCloud