diff options
author | Andrew McRae <amcrae@google.com> | 2020-05-21 17:17:12 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-27 03:36:33 +0000 |
commit | 85d87528a69a65f2c4b50ccd3e8357db14453020 (patch) | |
tree | e6cb6ca0ee6bf79c7bb8c5c463fed07a11618213 /include | |
parent | 8f409a3716c4bdb8e288e54a559da75ff30f375b (diff) | |
download | chrome-ec-85d87528a69a65f2c4b50ccd3e8357db14453020.tar.gz |
Extend the tcpci register dump.
Extend the tcpci register dump command to allow chip specific
register dumps to be displayed.
BUG=b:157206143
TEST=Display ANX3447 registers on Puff.
BRANCH=none
Change-Id: Ib2bf1adcbe3bce75ff54c36c4306b17356eae96f
Signed-off-by: Andrew McRae <amcrae@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2208344
Tested-by: Andrew McRae <amcrae@chromium.org>
Auto-Submit: Andrew McRae <amcrae@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Andrew McRae <amcrae@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h | 2 | ||||
-rw-r--r-- | include/usb_pd_tcpm.h | 35 |
2 files changed, 36 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h index 2370e3d77e..bdd3bcd251 100644 --- a/include/config.h +++ b/include/config.h @@ -1280,7 +1280,7 @@ #define CONFIG_CMD_SYSLOCK #undef CONFIG_CMD_TASK_RESET #undef CONFIG_CMD_TASKREADY -#undef CONFIG_CMD_TCPCI_DUMP +#undef CONFIG_CMD_TCPC_DUMP #define CONFIG_CMD_TEMP_SENSOR #define CONFIG_CMD_TIMERINFO #define CONFIG_CMD_TYPEC diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index 60a50f0f2e..0e686d35d4 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -424,6 +424,15 @@ struct tcpm_drv { * @return EC_SUCCESS or error */ int (*handle_fault)(int port, int fault); + +#ifdef CONFIG_CMD_TCPC_DUMP + /** + * Dump TCPC registers + * + * @param port Type-C port number + */ + void (*dump_registers)(int port); +#endif /* defined(CONFIG_CMD_TCPC_DUMP) */ }; /* @@ -529,4 +538,30 @@ void board_pd_vconn_ctrl(int port, enum usbpd_cc_pin cc_pin, int enabled); */ int tcpc_get_vbus_voltage(int port); +#ifdef CONFIG_CMD_TCPC_DUMP +struct tcpc_reg_dump_map { + uint8_t addr; + uint8_t size; + const char *name; +}; + +/** + * Dump the standard TCPC registers. + * + * @param port Type-C port number + * + */ +void tcpc_dump_std_registers(int port); + +/** + * Dump chip specific TCPC registers. + * + * @param port Type-C port number + * @param pointer to table of registers and names + * @param count of registers to dump + * + */ +void tcpc_dump_registers(int port, const struct tcpc_reg_dump_map *reg, + int count); +#endif #endif /* __CROS_EC_USB_PD_TCPM_H */ |