summaryrefslogtreecommitdiff
path: root/util/comm-lpc.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-07-02 11:25:22 -0700
committerChromeBot <chrome-bot@google.com>2013-07-03 18:23:09 -0700
commit5f30f40cb5a83bc900ce3400d6a5f3327bc96fdc (patch)
treee16e8104d83f9f3cc61e9212bd544aa85d5308a3 /util/comm-lpc.c
parent1b9a0ade1604b5ed9c6677eaef835014e2b55e3e (diff)
downloadchrome-ec-5f30f40cb5a83bc900ce3400d6a5f3327bc96fdc.tar.gz
Move protocol v2 constants to ec_commands.h
These constants are scattered around the various interface implementations and should be in one place. This will also clean up the u-boot side when ec_commands.h is copied there. BUG=chrome-os-partner:20257 BRANCH=none TEST=build link, spring, pit; test 'ectool hello' Change-Id: Ib1425db00ec8220538d8c5c65107ac9548009516 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/60810 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'util/comm-lpc.c')
-rw-r--r--util/comm-lpc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/comm-lpc.c b/util/comm-lpc.c
index f2c635770e..adbbb89f10 100644
--- a/util/comm-lpc.c
+++ b/util/comm-lpc.c
@@ -266,13 +266,13 @@ int comm_init_lpc(void)
*/
byte &= inb(EC_LPC_ADDR_HOST_CMD);
byte &= inb(EC_LPC_ADDR_HOST_DATA);
- for (i = 0; i < EC_HOST_PARAM_SIZE && byte == 0xff; ++i)
+ for (i = 0; i < EC_PROTO2_MAX_PARAM_SIZE && byte == 0xff; ++i)
byte &= inb(EC_LPC_ADDR_HOST_PARAM + i);
if (byte == 0xff) {
fprintf(stderr, "Port 0x%x,0x%x,0x%x-0x%x are all 0xFF.\n",
EC_LPC_ADDR_HOST_CMD, EC_LPC_ADDR_HOST_DATA,
EC_LPC_ADDR_HOST_PARAM,
- EC_LPC_ADDR_HOST_PARAM + EC_HOST_PARAM_SIZE - 1);
+ EC_LPC_ADDR_HOST_PARAM + EC_PROTO2_MAX_PARAM_SIZE - 1);
fprintf(stderr,
"Very likely this board doesn't have a Chromium EC.\n");
return -4;
@@ -296,6 +296,7 @@ int comm_init_lpc(void)
i = inb(EC_LPC_ADDR_MEMMAP + EC_MEMMAP_HOST_CMD_FLAGS);
if (i & EC_HOST_CMD_FLAG_VERSION_3) {
+ /* Protocol version 3 */
ec_command = ec_command_lpc_3;
ec_max_outsize = EC_LPC_HOST_PACKET_SIZE -
sizeof(struct ec_host_request);
@@ -303,8 +304,9 @@ int comm_init_lpc(void)
sizeof(struct ec_host_response);
} else if (i & EC_HOST_CMD_FLAG_LPC_ARGS_SUPPORTED) {
+ /* Protocol version 2*/
ec_command = ec_command_lpc;
- ec_max_outsize = ec_max_insize = EC_HOST_PARAM_SIZE;
+ ec_max_outsize = ec_max_insize = EC_PROTO2_MAX_PARAM_SIZE;
} else {
fprintf(stderr, "EC doesn't support protocols we need.\n");