summaryrefslogtreecommitdiff
path: root/include/usb_pd.h
diff options
context:
space:
mode:
authorli feng <li1.feng@intel.com>2020-08-21 15:23:28 -0700
committerCommit Bot <commit-bot@chromium.org>2020-12-21 22:07:31 +0000
commitfe951556a7be3bc68b342dc941be13ff4f82f41b (patch)
tree7af452c46edf37398d1419a7cd5d263a1c70781b /include/usb_pd.h
parent774cfcbb675455973bb4d7856633d065f5c674fb (diff)
downloadchrome-ec-fe951556a7be3bc68b342dc941be13ff4f82f41b.tar.gz
TCPMv2: support TBT Alt mode as UFP
Implemented SVDM responders for TBT Alt mode BUG=b:148528713,b:157163664,b:162986785 BRANCH=none TEST=1. Build ec with CL:2382634; OS CPFE 13447, CB CPFE 13535 2. Boot up Volteer, run "pd trysrc 0" on EC console; 3. Then connect port 1 to TGL Windows RVP TBT port; 4. Thunderbolt connection is established. Volteer port 1 as UFP, Windows RVP TBT port as DFP. From host console, thunderbolt0 is listed as network interface in ifconfig. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: If4c80418677f541e9c1c7c8c84446357000aaecb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2370045 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aashay Shringarpure <aashay@google.com>
Diffstat (limited to 'include/usb_pd.h')
-rw-r--r--include/usb_pd.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 19ae64b45f..8222a93e4d 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -527,15 +527,21 @@ struct partner_active_modes {
#define VDO_INDEX_AMA 4
#define VDO_INDEX_PTYPE_UFP1_VDO 4
#define VDO_INDEX_PTYPE_CABLE1 4
-#define VDO_INDEX_PTYPE_UFP2_VDO 4
+#define VDO_INDEX_PTYPE_UFP2_VDO 5
#define VDO_INDEX_PTYPE_CABLE2 5
#define VDO_INDEX_PTYPE_DFP_VDO 6
#define VDO_I(name) VDO_INDEX_##name
+/* PD Rev 2.0 ID Header VDO */
#define VDO_IDH(usbh, usbd, ptype, is_modal, vid) \
((usbh) << 31 | (usbd) << 30 | ((ptype) & 0x7) << 27 \
| (is_modal) << 26 | ((vid) & 0xffff))
+/* PD Rev 3.0 ID Header VDO */
+#define VDO_IDH_REV30(usbh, usbd, ptype_u, is_modal, ptype_d, ctype, vid) \
+ (VDO_IDH(usbh, usbd, ptype_u, is_modal, vid) \
+ | ((ptype_d) & 0x7) << 23 | ((ctype) & 0x3) << 21)
+
#define PD_IDH_PTYPE(vdo) (((vdo) >> 27) & 0x7)
#define PD_IDH_IS_MODAL(vdo) (((vdo) >> 26) & 0x1)
#define PD_IDH_VID(vdo) ((vdo) & 0xffff)