summaryrefslogtreecommitdiff
path: root/common/usb_pd_policy.c
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2020-01-13 11:32:48 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-15 23:54:32 +0000
commit1c796f459f13fd3eb0d512da45ef98116afb6c3e (patch)
tree164beca45ef0fb1bd26353368e53c96ce026209f /common/usb_pd_policy.c
parent69442e5aaa2fb1adc13b40e118831c9c277c82a3 (diff)
downloadchrome-ec-1c796f459f13fd3eb0d512da45ef98116afb6c3e.tar.gz
TBT: Allow limiting the cable speed based on board design
From the TGL PDG, MAX TBT signals routing length can be 205mm prior to connection to re-timer. Orthogonal routing with such length would results in adverse effect to channel margin, as described in Fiberweave White Paper. Hence, added overridable function to override the TBT cable speed based on the board design. BUG=b:147498371 BRANCH=none TEST=Able to detect TBT3 devices on Volteer Change-Id: I4490bc507c2c12b26372ed86e485c0491f1a9f21 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1998544 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common/usb_pd_policy.c')
-rw-r--r--common/usb_pd_policy.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index 0bced8d5e4..112f310bab 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -850,9 +850,16 @@ DECLARE_CONSOLE_COMMAND(pe, command_pe,
"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)
+{
+ return cable[port].cable_mode_resp.tbt_cable_speed;
+}
+
static int process_tbt_compat_discover_modes(int port, uint32_t *payload)
{
int rsize;
+ enum tbt_compat_cable_speed max_tbt_speed;
/*
* For active cables, Enter mode: SOP', SOP'', SOP
@@ -866,6 +873,13 @@ static int process_tbt_compat_discover_modes(int port, uint32_t *payload)
cable[port].cable_mode_resp.tbt_cable_speed =
TBT_SS_U32_GEN1_GEN2;
+ max_tbt_speed = board_get_max_tbt_speed(port);
+ if (cable[port].cable_mode_resp.tbt_cable_speed >
+ max_tbt_speed) {
+ cable[port].cable_mode_resp.tbt_cable_speed =
+ max_tbt_speed;
+ }
+
/*
* Enter Mode SOP' (Cable Enter Mode) is skipped for
* passive cables.