diff options
author | Diana Z <dzigterman@chromium.org> | 2020-03-29 22:07:22 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-16 08:32:20 +0000 |
commit | 0a0a2d43567935b8638f2149f3df93647bbdacc2 (patch) | |
tree | d3cc3b59797c9ca177faccfb23ee4f3ddbf91113 /common/usb_pd_console_cmd.c | |
parent | 6328b97450d66240066ddddeb55fd8f6185b36ef (diff) | |
download | chrome-ec-0a0a2d43567935b8638f2149f3df93647bbdacc2.tar.gz |
PD: Use new structure for storing SOP identity responses
Use the newly created identity_data structure to store the SOP discover
identity response. For older boards which are almost out of static
space, only allocate space for the SOP response.
BRANCH=None
BUG=b:152417977
TEST=on kindred with TCPMv2, confirm discovery can complete and correct
data is given from the pe console command
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: If63d9770bdfcc268734f7b45ce08a0a7abb396e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130476
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/usb_pd_console_cmd.c')
-rw-r--r-- | common/usb_pd_console_cmd.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/common/usb_pd_console_cmd.c b/common/usb_pd_console_cmd.c index 4e66414584..d0ec5b3055 100644 --- a/common/usb_pd_console_cmd.c +++ b/common/usb_pd_console_cmd.c @@ -17,27 +17,30 @@ static void dump_pe(int port) struct svdm_amode_data *modep; uint32_t mode_caps; struct pd_discovery *disc = pd_get_am_discovery(port); + const union disc_ident_ack *resp = pd_get_identity_response(port, + TCPC_TX_SOP); + const char * const idh_ptype_names[] = { "UNDEF", "Hub", "Periph", "PCable", "ACable", "AMA", "RSV6", "RSV7"}; - if (disc->identity[0] == 0) { + if (pd_get_identity_discovery(port, TCPC_TX_SOP) != PD_DISC_COMPLETE) { ccprintf("No identity discovered yet.\n"); return; } - idh_ptype = PD_IDH_PTYPE(disc->identity[0]); + idh_ptype = pd_get_product_type(port); ccprintf("IDENT:\n"); ccprintf("\t[ID Header] %08x :: %s, VID:%04x\n", - disc->identity[0], + resp->raw_value[0], idh_ptype_names[idh_ptype], pd_get_identity_vid(port)); - ccprintf("\t[Cert Stat] %08x\n", disc->identity[1]); - for (i = 2; i < ARRAY_SIZE(disc->identity); i++) { + ccprintf("\t[Cert Stat] %08x\n", resp->cert.xid); + for (i = 2; i < ARRAY_SIZE(resp->raw_value); i++) { ccprintf("\t"); - if (disc->identity[i]) - ccprintf("[%d] %08x ", i, disc->identity[i]); + if (resp->raw_value[i]) + ccprintf("[%d] %08x ", i, resp->raw_value[i]); } ccprintf("\n"); |