summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-03-05 11:02:08 -0800
committerRandall Spangler <rspangler@chromium.org>2012-03-05 11:05:15 -0800
commite85cb937152147a149d9e58fc6e9522c300843ad (patch)
treeca0f927bc65f8e9b7e3f57fc4384089bb1272bd4 /util
parent0106129061e2437f6b460091ce41a32f63a2a85d (diff)
downloadchrome-ec-e85cb937152147a149d9e58fc6e9522c300843ad.tar.gz
Add LPC command to get EC build info
Useful when debugging to determine if a user has an official build or not, particularly early in the devel process where we're handing builds to everyone. Particularly useful for proto1, since not all those systems will be case-open servo-attached. Also move get-version LPC command into system.c, where it's closer to the system functions it calls (matches what we do for other host commands). Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=none Change-Id: Idb0f6edf31ca00e32f083be0b0d3f23ab79c5fba
Diffstat (limited to 'util')
-rw-r--r--util/ectool.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/ectool.c b/util/ectool.c
index 4f2f6d1d83..a9f80c482d 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -263,16 +263,22 @@ int cmd_version(int argc, char *argv[])
{
static const char * const fw_copies[] = {"unknown", "RO", "A", "B"};
struct lpc_response_get_version r;
+ struct lpc_response_get_build_info r2;
int rv;
rv = ec_command(EC_LPC_COMMAND_GET_VERSION, NULL, 0, &r, sizeof(r));
if (rv)
return rv;
+ rv = ec_command(EC_LPC_COMMAND_GET_BUILD_INFO,
+ NULL, 0, &r2, sizeof(r2));
+ if (rv)
+ return rv;
/* Ensure versions are null-terminated before we print them */
r.version_string_ro[sizeof(r.version_string_ro) - 1] = '\0';
r.version_string_rw_a[sizeof(r.version_string_rw_a) - 1] = '\0';
r.version_string_rw_b[sizeof(r.version_string_rw_b) - 1] = '\0';
+ r2.build_string[sizeof(r2.build_string) - 1] = '\0';
/* Print versions */
printf("RO version: %s\n", r.version_string_ro);
@@ -281,6 +287,8 @@ int cmd_version(int argc, char *argv[])
printf("Firmware copy: %s\n",
(r.current_image < ARRAY_SIZE(fw_copies) ?
fw_copies[r.current_image] : "?"));
+ printf("Build info: %s\n", r2.build_string);
+
return 0;
}