aboutsummaryrefslogtreecommitdiffstats
path: root/serprog-protocol.txt
diff options
context:
space:
mode:
authorUrja Rannikko <urjaman@gmail.com>2011-09-15 23:38:14 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2011-09-15 23:38:14 +0000
commitc93f5f123239121fdeba03c02f9e448ed97c52a4 (patch)
tree977910ff6ca9a2f736a5fc5103cab30663912582 /serprog-protocol.txt
parentf74a7b9c4f43445c8116533b1593ecef4459b114 (diff)
downloadflashrom-c93f5f123239121fdeba03c02f9e448ed97c52a4.tar.gz
flashrom-c93f5f123239121fdeba03c02f9e448ed97c52a4.tar.bz2
flashrom-c93f5f123239121fdeba03c02f9e448ed97c52a4.zip
serprog: add SPI support
Adds a new opcode (0x13) that just relays SPI bytes and wires it up to be usable within serprog.c. Checks for mandatory opcodes are moved around and changed a bit, but non-SPI programmers should not be harmed by this patch. Corresponding to flashrom svn r1442. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'serprog-protocol.txt')
-rw-r--r--serprog-protocol.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/serprog-protocol.txt b/serprog-protocol.txt
index 52f901a6..168a28e7 100644
--- a/serprog-protocol.txt
+++ b/serprog-protocol.txt
@@ -31,6 +31,8 @@ COMMAND Description Parameters Return Value
0x10 Sync NOP none NAK + ACK (for synchronization)
0x11 Query maximum read-n length none ACK + 24-bit length (0==2^24) / NAK
0x12 Set used bustype 8-bit flags (as with 0x05) ACK / NAK
+0x13 Perform SPI operation 24-bit slen + 24-bit rlen ACK + rlen bytes of data / NAK
+ + slen bytes of data
0x?? unimplemented command - invalid.
@@ -50,7 +52,7 @@ Additional information of the above commands:
it should return a big bogus value - eg 0xFFFF.
0x05 (Q_BUSTYPE):
The bit's are defined as follows:
- bit 0: PARALLEL, bit 1: LPC, bit 2: FWH, bit 3: SPI (if ever supported).
+ bit 0: PARALLEL, bit 1: LPC, bit 2: FWH, bit 3: SPI.
0x06 (Q_CHIPSIZE):
Only applicable to parallel programmers.
An LPC/FWH/SPI-programmer can report this as not supported in the command bitmap.
@@ -66,6 +68,11 @@ Additional information of the above commands:
Set's the used bustype if the programmer can support more than one flash protocol.
Sending a byte with more than 1 bit set will make the programmer decide among them
on it's own. Bit values as with Q_BUSTYPE.
+ 0x13 (O_SPIOP):
+ Send and receive bytes via SPI.
+ Maximum slen is Q_WRNMAXLEN in case Q_BUSTYPE returns SPI only or S_BUSTYPE was used
+ to set SPI exclusively before. Same for rlen and Q_RDNMAXLEN.
+ This operation is immediate, meaning it doesnt use the operation buffer.
About mandatory commands:
The only truly mandatory commands for any device are 0x00, 0x01, 0x02 and 0x10,
but one can't really do anything with these commands.
@@ -99,3 +106,4 @@ This define listing should help C coders - (it's here to be the single source fo
#define S_CMD_SYNCNOP 0x10 /* Special no-operation that returns NAK+ACK */
#define S_CMD_Q_RDNMAXLEN 0x11 /* Query read-n maximum length */
#define S_CMD_S_BUSTYPE 0x12 /* Set used bustype(s). */
+#define S_CMD_O_SPIOP 0x13 /* Perform SPI operation. */