summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-02-10 14:11:54 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-14 17:28:15 -0800
commitc9ea4bddbc45ef9b0104d5afc8a1d2a811cad372 (patch)
tree8f24d9994f27484f7f7932f1d8a0201851e44983 /util
parentdf2f085c16167f3afa2dbc4c34ef3c638b4f4f45 (diff)
downloadchrome-ec-c9ea4bddbc45ef9b0104d5afc8a1d2a811cad372.tar.gz
pdchipinfo: Increase compatibility of fw_version
The firmware version formats may vary chip to chip. fw_version field is changed to a union of a 8 byte string and an 64-bit integer. BUG=chrome-os-partner:62383 BRANCH=none TEST=ectool pdchipinfo 0/1 on Electro Change-Id: Id51e66c44338a09ed897ee61f54cd6a394400e63 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/441270
Diffstat (limited to 'util')
-rw-r--r--util/ectool.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c
index 5b14c78203..2c9bda2f8e 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -14,6 +14,7 @@
#include <time.h>
#include <unistd.h>
+#include "anx74xx.h"
#include "battery.h"
#include "comm-host.h"
#include "compile_time_macros.h"
@@ -24,6 +25,7 @@
#include "lock/gec_lock.h"
#include "misc_util.h"
#include "panic.h"
+#include "ps8751.h"
#include "usb_pd.h"
/* Command line options */
@@ -6888,7 +6890,15 @@ int cmd_pd_chip_info(int argc, char *argv[])
printf("vendor_id: 0x%x\n", r.vendor_id);
printf("product_id: 0x%x\n", r.product_id);
printf("device_id: 0x%x\n", r.device_id);
- printf("fw_version: 0x%x\n", r.fw_version);
+
+ switch (r.vendor_id) {
+ case ANX74XX_VENDOR_ID:
+ case PS8751_VENDOR_ID:
+ printf("fw_version: 0x%" PRIx64 "\n", r.fw_version_number);
+ break;
+ default:
+ printf("fw_version: UNSUPPORTED\n");
+ }
return 0;
}