diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-07-10 21:08:55 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-07-10 21:08:55 +0000 |
commit | d0478299b1d714a7001f19fb2cafeb257698a2c0 (patch) | |
tree | 4cd9e2881c6f02f26270149770210e6d1aa742cd /wbsio_spi.c | |
parent | 8ef7dce29aead4f17000e2c14b39f0723adc3953 (diff) | |
download | flashrom-d0478299b1d714a7001f19fb2cafeb257698a2c0.tar.gz flashrom-d0478299b1d714a7001f19fb2cafeb257698a2c0.tar.bz2 flashrom-d0478299b1d714a7001f19fb2cafeb257698a2c0.zip |
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 'wbsio_spi.c')
-rw-r--r-- | wbsio_spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wbsio_spi.c b/wbsio_spi.c index 9ac15d19..cbdddd2e 100644 --- a/wbsio_spi.c +++ b/wbsio_spi.c @@ -90,7 +90,7 @@ int wbsio_check_for_spi(const char *name) * Would one more byte of RAM in the chip (to get all 24 bits) really make * such a big difference? */ -int wbsio_spi_command(unsigned int writecnt, unsigned int readcnt, +int wbsio_spi_send_command(unsigned int writecnt, unsigned int readcnt, const unsigned char *writearr, unsigned char *readarr) { int i; |