summaryrefslogtreecommitdiffstats
path: root/Documentation/serprog-protocol.txt
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-08-13 16:33:04 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-08-13 16:33:04 +0000
commitb98f6eb3aca7a1fc00e52160bdfe40ff04b23dfd (patch)
tree157aebff0e3bd702eddb8b5b79bd428b02b46a0c /Documentation/serprog-protocol.txt
parenta1a14ec5d2a087937ce6e16a4462fcfeb838fa12 (diff)
downloadast2050-flashrom-b98f6eb3aca7a1fc00e52160bdfe40ff04b23dfd.zip
ast2050-flashrom-b98f6eb3aca7a1fc00e52160bdfe40ff04b23dfd.tar.gz
serprog: Add support for setting the SPI frequency
Introduce a new opcode (0x14) that sends the requested frequency as a 32b long value in Hertz to the programmer and receives the frequency eventually chosen by the programmer. The user can specify this with the programmer parameter "spispeed" (named after the similar parameter for the buspirate) including an optional suffix of 'M' or 'k' for specifying megahertz or kilohertz respectively (lowercase suffixes are also accepted). Thanks to Idwer and Uwe (and maybe others) for their feedback especially regarding the unit of frequency to use. Corresponding to flashrom svn r1571. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'Documentation/serprog-protocol.txt')
-rw-r--r--Documentation/serprog-protocol.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/serprog-protocol.txt b/Documentation/serprog-protocol.txt
index a3a4863..d8733cc 100644
--- a/Documentation/serprog-protocol.txt
+++ b/Documentation/serprog-protocol.txt
@@ -33,6 +33,7 @@ COMMAND Description Parameters Return Value
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
+0x14 Set SPI clock frequency in Hz 32-bit requested frequency ACK + 32-bit set frequency / NAK
0x?? unimplemented command - invalid.
@@ -73,6 +74,14 @@ Additional information of the above commands:
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.
+ 0x14 (S_SPI_FREQ):
+ Set the SPI clock frequency. The 32-bit value indicates the
+ requested frequency in Hertz. Value 0 is reserved and should
+ be NAKed by the programmer. The requested frequency should be
+ mapped by the programmer software to a supported frequency
+ lower than the one requested. If there is no lower frequency
+ available the lowest possible should be used. The value
+ chosen is sent back in the reply with an ACK.
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.
@@ -107,3 +116,4 @@ This define listing should help C coders - (it's here to be the single source fo
#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. */
+#define S_CMD_S_SPI_FREQ 0x14 /* Set SPI clock frequency */
OpenPOWER on IntegriCloud