summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-ext-caps.h
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2024-08-30 18:26:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-03 09:54:39 +0200
commit948ce83fbb7df85bc930a5c0d6b133481be05c0b (patch)
tree11da3ebcb050f24d9acd7f110e30d69b5d86aa17 /drivers/usb/host/xhci-ext-caps.h
parent9299f12c20d4dc51d3b548392e1725da37cada48 (diff)
downloadlwn-948ce83fbb7df85bc930a5c0d6b133481be05c0b.tar.gz
lwn-948ce83fbb7df85bc930a5c0d6b133481be05c0b.zip
xhci: Add USB4 tunnel detection for USB3 devices on Intel hosts
Knowledge about tunneled devices is useful in order to correctly describe the relationship between tunneled USB3 device and USB4 Host Interface, ensuring proper suspend and resume order, and to be able to power down Thunderbolt if there is no need for tunneling. Intel hosts share if a USB3 connection is native or tunneled via vendor specific "SPR eSS PORT" registers. These vendor registers are available if host supports a vendor specific SPR shadow extended capability with ID 206. Registers are per USB3 port and 0x20 apart. Knowing the tunneling status of the device connected to roothub is enough as all its children will have the same status. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20240830152630.3943215-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-ext-caps.h')
-rw-r--r--drivers/usb/host/xhci-ext-caps.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
index 96eb36a58738..67ecf7320c62 100644
--- a/drivers/usb/host/xhci-ext-caps.h
+++ b/drivers/usb/host/xhci-ext-caps.h
@@ -42,6 +42,7 @@
#define XHCI_EXT_CAPS_DEBUG 10
/* Vendor caps */
#define XHCI_EXT_CAPS_VENDOR_INTEL 192
+#define XHCI_EXT_CAPS_INTEL_SPR_SHADOW 206
/* USB Legacy Support Capability - section 7.1.1 */
#define XHCI_HC_BIOS_OWNED (1 << 16)
#define XHCI_HC_OS_OWNED (1 << 24)
@@ -64,6 +65,10 @@
#define XHCI_HLC (1 << 19)
#define XHCI_BLC (1 << 20)
+/* Intel SPR shadow capability */
+#define XHCI_INTEL_SPR_ESS_PORT_OFFSET 0x8ac4 /* SuperSpeed port control */
+#define XHCI_INTEL_SPR_TUNEN BIT(4) /* Tunnel mode enabled */
+
/* command register values to disable interrupts and halt the HC */
/* start/stop HC execution - do not write unless HC is halted*/
#define XHCI_CMD_RUN (1 << 0)