summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-14 14:12:23 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-16 03:18:24 +0000
commit0b5e0506fec0cbb4b1493edd0007cd1ad93c1c98 (patch)
tree6ee78d60f2f93574b1cf28f229328aeb6d9506e3 /zephyr
parentc119910eee4efaaaa395a76cbf0ef653d16bd760 (diff)
downloadchrome-ec-0b5e0506fec0cbb4b1493edd0007cd1ad93c1c98.tar.gz
zephyr: Allow enabling 'pe' and 'pdcable' commands
These are useful when debugging USB-C PD operation. Allow enabling them, but not by default. BUG=b:175434113 BRANCH=none TEST=make BOARD=volteer -j30 With a zephyr-chrome CL, build volteer on zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I31a2a0704ac0f81600e21a024532a24be2b3f427 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631095 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/Kconfig.usbc38
-rw-r--r--zephyr/shim/include/config_chip.h10
2 files changed, 48 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index fae6b0f92b..939fa96d09 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -411,6 +411,44 @@ config PLATFORM_EC_HOSTCMD_PD_CONTROL
This host command can be manually executed using the
"ectool pdcontrol" command from the Chromium OS shell.
+config PLATFORM_EC_CMD_USB_PD_PE
+ bool "Console command: pe"
+ help
+ This command dumps information about the USB PD alternate mode options
+ discovered from the partner device. It can be useful for debugging.
+
+ Example: pe 1 dump
+ IDENT SOP:
+
+ [ID Header] 2c000bda :: AMA, VID:0bda
+ [Cert Stat] 00000000
+ [2] 00000209 [3] 11000f09
+ IDENT SOP':
+ [ID Header] 1c000489 :: PCable, VID:0489
+ [Cert Stat] 000001c6
+ [2] f6810000 [3] 11082051
+ SVID[0]: ff01 MODES: [1] 000c0045
+ MODE[1]: svid:ff01 caps:000c0045
+
+config PLATFORM_EC_CMD_USB_PD_CABLE
+ bool "Console command: pdcable"
+ help
+ This commands shows the USB cable charactistics as detected from the
+ device. It can be useful for debugging problems with cables and the
+ device's response to them.
+
+ Example: pdcable 1
+ Cable Type: Passive
+ Cable Rev: 1.0
+ Connector Type: 2
+ Cable Current: 5A
+ USB Superspeed Signaling support: 1
+ Rounded support: No
+ Optical cable: No
+ Retimer support: No
+ Link training: Bi-directional
+ Thunderbolt cable type: Passive
+
choice "USB-C device type"
prompt "Select the USB-C device type"
default PLATFORM_EC_USB_DRP_ACC_TRYSRC
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 9770fc7f6e..d357d315ab 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -564,4 +564,14 @@ enum battery_type {
#define CONFIG_HOSTCMD_PD_CONTROL
#endif
+#undef CONFIG_CMD_USB_PD_PE
+#ifdef CONFIG_PLATFORM_EC_CMD_USB_PD_PE
+#define CONFIG_CMD_USB_PD_PE
+#endif
+
+#undef CONFIG_CMD_USB_PD_CABLE
+#ifdef CONFIG_PLATFORM_EC_CMD_USB_PD_CABLE
+#define CONFIG_CMD_USB_PD_CABLE
+#endif
+
#endif /* __CROS_EC_CONFIG_CHIP_H */