summaryrefslogtreecommitdiff
path: root/sb600spi.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-07-10 21:08:55 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-07-10 21:08:55 +0000
commit66a81cd3ae8bb965d22107638db51a4f6c58d04b (patch)
tree4cd9e2881c6f02f26270149770210e6d1aa742cd /sb600spi.c
parentfeaefaa150da84aca4fcaaf1d2023af4052e323f (diff)
downloadflashrom-66a81cd3ae8bb965d22107638db51a4f6c58d04b.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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Jakob Bornecrantz <wallbraker@gmail.com> Tested-by: Jakob Bornecrantz <wallbraker@gmail.com> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@645 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'sb600spi.c')
-rw-r--r--sb600spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sb600spi.c b/sb600spi.c
index 4ca905b..faafd82 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -52,7 +52,7 @@ uint8_t sb600_read_status_register(void)
unsigned char readarr[JEDEC_RDSR_INSIZE];
/* Read Status Register */
- spi_command(sizeof(cmd), sizeof(readarr), cmd, readarr);
+ spi_send_command(sizeof(cmd), sizeof(readarr), cmd, readarr);
return readarr[0];
}
@@ -103,7 +103,7 @@ static void execute_command(void)
;
}
-int sb600_spi_command(unsigned int writecnt, unsigned int readcnt,
+int sb600_spi_send_command(unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr, unsigned char *readarr)
{
int count;