summaryrefslogtreecommitdiff
path: root/common/usb_pd_policy.c
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2020-01-30 20:46:54 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-04 21:39:01 +0000
commitfadd6d704cd460ef6e9af2aae7eba08b527c5bf4 (patch)
treed4962a717714e68fcb65959d965469f7da7920de /common/usb_pd_policy.c
parentfd7576f02df537972b11098a687232a0e7a71f01 (diff)
downloadchrome-ec-fadd6d704cd460ef6e9af2aae7eba08b527c5bf4.tar.gz
TCPMv1/v2: Move "pe" console command to common file
BUG=b:148528713 BRANCH=none TEST=make buildall -j Change-Id: I71c8d491014a69ec938fa1172eee7b5322572654 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2032726 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r--common/usb_pd_policy.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index c97fb697a9..74809057d7 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -750,74 +750,6 @@ static int enter_tbt_compat_mode(int port, uint32_t *payload)
return 2;
}
-#ifdef CONFIG_CMD_USB_PD_PE
-static void dump_pe(int port)
-{
- const char * const idh_ptype_names[] = {
- "UNDEF", "Hub", "Periph", "PCable", "ACable", "AMA",
- "RSV6", "RSV7"};
-
- int i, j, idh_ptype;
- struct svdm_amode_data *modep;
- uint32_t mode_caps;
-
- if (pe[port].identity[0] == 0) {
- ccprintf("No identity discovered yet.\n");
- return;
- }
- idh_ptype = PD_IDH_PTYPE(pe[port].identity[0]);
- ccprintf("IDENT:\n");
- ccprintf("\t[ID Header] %08x :: %s, VID:%04x\n", pe[port].identity[0],
- idh_ptype_names[idh_ptype], pd_get_identity_vid(port));
- ccprintf("\t[Cert Stat] %08x\n", pe[port].identity[1]);
- for (i = 2; i < ARRAY_SIZE(pe[port].identity); i++) {
- ccprintf("\t");
- if (pe[port].identity[i])
- ccprintf("[%d] %08x ", i, pe[port].identity[i]);
- }
- ccprintf("\n");
-
- if (pe[port].svid_cnt < 1) {
- ccprintf("No SVIDS discovered yet.\n");
- return;
- }
-
- for (i = 0; i < pe[port].svid_cnt; i++) {
- ccprintf("SVID[%d]: %04x MODES:", i, pe[port].svids[i].svid);
- for (j = 0; j < pe[port].svids[j].mode_cnt; j++)
- ccprintf(" [%d] %08x", j + 1,
- pe[port].svids[i].mode_vdo[j]);
- ccprintf("\n");
- modep = pd_get_amode_data(port, pe[port].svids[i].svid);
- if (modep) {
- mode_caps = modep->data->mode_vdo[modep->opos - 1];
- ccprintf("MODE[%d]: svid:%04x caps:%08x\n", modep->opos,
- modep->fx->svid, mode_caps);
- }
- }
-}
-
-static int command_pe(int argc, char **argv)
-{
- int port;
- char *e;
- if (argc < 3)
- return EC_ERROR_PARAM_COUNT;
- /* command: pe <port> <subcmd> <args> */
- port = strtoi(argv[1], &e, 10);
- if (*e || port >= board_get_usb_pd_port_count())
- return EC_ERROR_PARAM2;
- if (!strncasecmp(argv[2], "dump", 4))
- dump_pe(port);
-
- return EC_SUCCESS;
-}
-
-DECLARE_CONSOLE_COMMAND(pe, command_pe,
- "<port> dump",
- "USB PE");
-#endif /* CONFIG_CMD_USB_PD_PE */
-
/* Return the current cable speed received from Cable Discover Mode command */
__overridable enum tbt_compat_cable_speed board_get_max_tbt_speed(int port)
{