diff options
author | Simon Glass <sjg@chromium.org> | 2012-07-15 03:03:55 +0100 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-07-22 00:36:39 -0700 |
commit | bff14cac0b17217a6be02924d109e58b3aaa50b1 (patch) | |
tree | 68e9d5b19f7a080a3fe420535124dbd85044840d /include/host_command.h | |
parent | 37a6387fa906e43115417c4a89069be043e2c554 (diff) | |
download | chrome-ec-bff14cac0b17217a6be02924d109e58b3aaa50b1.tar.gz |
i2c: Support command version numbers
Currently, I2C commands look like this:
Input:
cmd8 [params bytes] checksum
Output:
response8 [response_ptr bytes] checksum
Use a prefix byte of (0xDC + cmd_version) to indicate the command
version. This is compatible with the existing protocol, since there
are no host commands in the range 0xDC-0xFB. If the first byte of
the from-host data is 0x00-0xDB, it's a version 0 command.
There is no change to the output format, since the EC needs to hand
back a response which matches the version requested by the host.
New input:
(0xDC+ver8) cmd8 paramlen8 [params bytes] checksum
New output:
response8 responselen8 [response_ptr bytes] checksum
If the host gets a response of EC_RES_INVALID_COMMAND, it knows it's
talking to an old EC, and at most version 0 of the command is supported.
BUG=chrome-os-partner:11317
TEST=manual and a bit ad-hoc:
(note, this testing is not completed yet, so far only snow is tested)
Check that snow and link still process commands correctly over I2C
from U-Boot.
SMDK5250 # mkbp test
Old interface:
New interface:
Test passed
Change-Id: I1c21f2b036091e9122b4f980ca5f5af34f7fc070
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27470
Diffstat (limited to 'include/host_command.h')
-rw-r--r-- | include/host_command.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/host_command.h b/include/host_command.h index a88761a6e2..135f493737 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -22,6 +22,7 @@ struct host_cmd_handler_args { uint8_t command; /* Command (e.g., EC_CMD_FLASH_GET_INFO) */ uint8_t version; /* Version of command (0-31) */ uint8_t params_size; /* Size of input parameters in bytes */ + uint8_t i2c_old_response; /* (for I2C) send an old-style response */ const uint8_t *params; /* Input parameters */ /* * Pointer to output response data buffer. On input to the handler, |