diff options
author | Ayushee <ayushee.shah@intel.com> | 2019-09-11 15:44:51 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-17 21:06:39 +0000 |
commit | 340804c765a2e6e6cb9e3f296f2f68c47ad8521e (patch) | |
tree | e7226bd95bd1ff428b2c7bebca02473363c3f777 /include | |
parent | 9aaaaf67d3a9420999978023e627ad416e228dcd (diff) | |
download | chrome-ec-340804c765a2e6e6cb9e3f296f2f68c47ad8521e.tar.gz |
usb_pd: Sending Thunderbolts-compatible host notification
Sending the following information to the host in cros_ec_usb_pd_control
command to configure thunderbolt compat mode:
1. TBT flag - Contains information about:
a. Retimer (Present/Absent)
b. Thunderbolt-compatible adapter (Type-C/ Legacy TBT adapter)
c. Thunderbolt-compatible type (Optical/Non-optical)
d. Active link training (Uni/bi-directional communication)
2. Cable speed (USB3.1 Gen1 Cable / 10 Gbps / 10 Gbps and 20 Gbps)
3. Cable rounded support (3rd Gen Non-Rounded TBT/
3rd & 4th Gen Rounded and Non-Rounded TBT)
BUG=b:140644242
BRANCH=None
TEST=Verfied on the tglrvp-u CPU console using "ectool usbpd" command,
able to get the information
Change-Id: I38cf0b488945d78564c96eedab50a6e2900dfb80
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1926381
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 16 | ||||
-rw-r--r-- | include/usb_pd.h | 18 |
2 files changed, 34 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 331223b7df..5244533610 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -5178,6 +5178,19 @@ enum pd_cc_states { #define USBC_CABLE_TYPE_PASSIVE 3 /* Passive cable attached */ #define USBC_CABLE_TYPE_ACTIVE 4 /* Active cable attached */ +/* Active/Passive Cable */ +#define USB_PD_MUX_TBT_ACTIVE_CABLE BIT(0) +/* Optical/Non-optical cable */ +#define USB_PD_MUX_TBT_CABLE_TYPE BIT(1) +/* 3rd Gen TBT device (or AMA)/2nd gen tbt Adapter */ +#define USB_PD_MUX_TBT_ADAPTER BIT(2) +/* Active Link enabled/disabled */ +#define USB_PD_MUX_TBT_LINK BIT(3) + +/* + * Underdevelopement : + * Please remove this tag if using _v2 outside platform/ec + */ struct ec_response_usb_pd_control_v2 { uint8_t enabled; uint8_t role; @@ -5186,6 +5199,9 @@ struct ec_response_usb_pd_control_v2 { uint8_t cc_state; /* enum pd_cc_states representing cc state */ uint8_t dp_mode; /* Current DP pin mode (MODE_DP_PIN_[A-E]) */ uint8_t cable_type; /* USBC_CABLE_TYPE_*cable_type */ + uint8_t control_flags; /* USB_PD_MUX_*flags */ + uint8_t cable_speed; + uint8_t cable_gen; /* rounded_support */ } __ec_align1; #define EC_CMD_USB_PD_PORTS 0x0102 diff --git a/include/usb_pd.h b/include/usb_pd.h index 2597aac43e..c2d843863a 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1958,6 +1958,24 @@ struct tbt_mode_resp_device get_dev_tbt_vdo(int port); * Update Mux on entering Thunderbolt-compatible mode * * @param port USB-C port number + * @return cable speed + */ +enum tbt_compat_cable_speed get_tbt_cable_speed(int port); + +/** + * Return Thunderbolt rounded support + * Rounded support indicates if the cable can support rounding the + * frequency depending upon the cable generation. + * + * @param port USB-C port number + * @return tbt_rounded_support + */ +enum tbt_compat_rounded_support get_tbt_rounded_support(int port); + +/** + * Update Mux on entering Thunderbolt mode + * + * @param port USB-C port number */ void set_tbt_compat_mode_ready(int port); |