summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Broch <tbroch@chromium.org>2015-01-26 13:54:29 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-28 11:14:27 +0000
commit70afa3898ca1f28dc7e254b63f2d5fb12ad6b273 (patch)
tree4fd9ed1fdafcc5505b25d8583ad535549c52a01c
parent54aa5e16d0957e6b444cc10331a76c8167b852dd (diff)
downloadchrome-ec-70afa3898ca1f28dc7e254b63f2d5fb12ad6b273.tar.gz
ectool: parse accessory logs for dingdong & hoho
Signed-off-by: Todd Broch <tbroch@chromium.org> BUG=chrome-os-partner:35935 TEST=manual # With dingdong in C0 & hoho in C1 # Enter GFU mode for dingdong & hoho ectool --name cros_pd pdsetmode 0 0x18d1 1 1 ectool --name cros_pd pdsetmode 1 0x18d1 1 1 # read logs ectool --name cros_pd pdlog 2015-01-26 14:36:54.787 P0 SRC 2015-01-26 14:36:54.780 P1 SRC 2015-01-26 14:36:53.680 P0 DP mode enabled 2015-01-26 14:36:53.375 P1 HDMI Codec: family:000e chipid:0001 irom:1.0.0 fw:0.0.0 2015-01-26 14:36:53.771 P1 DP mode enabled # remove hoho & plug in zinger instead ectool --name cros_pd pdlog 2015-01-26 14:44:36.991 P1 SNK Charger Type-C 5153mV max 5000mV / 3000mA 2015-01-26 14:44:37.011 P1 SNK Charger PD 5021mV max 20000mV / 3000mA 2015-01-26 14:44:37.116 P1 SNK Charger PD 20211mV max 20000mV / 3000mA Change-Id: I0289cfd1d43ef1a22123b437bc8df86920fbf1a7 Reviewed-on: https://chromium-review.googlesource.com/243375 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org>
-rw-r--r--driver/mcdp28x0.h2
-rw-r--r--util/ectool.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/driver/mcdp28x0.h b/driver/mcdp28x0.h
index c753816495..3a6ead9bfb 100644
--- a/driver/mcdp28x0.h
+++ b/driver/mcdp28x0.h
@@ -8,8 +8,6 @@
#ifndef MCDP28X0_H
#define MCDP28X0_H
-#include <util.h>
-
#define MCDP_OUTBUF_MAX 16
#define MCDP_INBUF_MAX 16
diff --git a/util/ectool.c b/util/ectool.c
index cb7e7e904e..1e46e2de8f 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -17,6 +17,7 @@
#include "battery.h"
#include "comm-host.h"
#include "compile_time_macros.h"
+#include "driver/mcdp28x0.h"
#include "ec_flash.h"
#include "ectool.h"
#include "lightbar.h"
@@ -5424,6 +5425,7 @@ int cmd_pd_log(int argc, char *argv[])
struct ec_response_pd_log r;
uint32_t words[8]; /* space for the payload */
} u;
+ struct mcdp_info minfo;
struct ec_response_usb_pd_power_info pinfo;
int rv;
unsigned long long milliseconds;
@@ -5477,6 +5479,19 @@ int cmd_pd_log(int argc, char *argv[])
const char *fault = u.r.data < ARRAY_SIZE(fault_names) ?
fault_names[u.r.data] : "???";
printf("Power supply fault: %s\n", fault);
+ } else if (u.r.type == PD_EVENT_VIDEO_DP_MODE) {
+ printf("DP mode %sabled\n", (u.r.data == 1) ?
+ "en" : "dis");
+ } else if (u.r.type == PD_EVENT_VIDEO_CODEC) {
+ memcpy(&minfo, u.r.payload,
+ sizeof(struct mcdp_info));
+ printf("HDMI info: family:%04x chipid:%04x "
+ "irom:%d.%d.%d fw:%d.%d.%d\n",
+ MCDP_FAMILY(minfo.family),
+ MCDP_CHIPID(minfo.chipid),
+ minfo.irom.major, minfo.irom.minor,
+ minfo.irom.build, minfo.fw.major,
+ minfo.fw.minor, minfo.fw.build);
} else { /* Unknown type */
int i;
printf("Event %02x (%04x) [", u.r.type, u.r.data);