Skip to content

Commit dfba217

Browse files
LuBaolugregkh
authored andcommitted
usb: xhci: Add DbC support in xHCI driver
xHCI compatible USB host controllers(i.e. super-speed USB3 controllers) can be implemented with the Debug Capability(DbC). It presents a debug device which is fully compliant with the USB framework and provides the equivalent of a very high performance full-duplex serial link. The debug capability operation model and registers interface are defined in 7.6.8 of the xHCI specification, revision 1.1. The DbC debug device shares a root port with the xHCI host. By default, the debug capability is disabled and the root port is assigned to xHCI. When the DbC is enabled, the root port will be assigned to the DbC debug device, and the xHCI sees nothing on this port. This implementation uses a sysfs node named <dbc> under the xHCI device to manage the enabling and disabling of the debug capability. When the debug capability is enabled, it will present a debug device through the debug port. This debug device is fully compliant with the USB3 framework, and it can be enumerated by a debug host on the other end of the USB link. As soon as the debug device is configured, a TTY serial device named /dev/ttyDBC0 will be created. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 67d2ea9 commit dfba217

File tree

9 files changed

+1829
-0
lines changed

9 files changed

+1829
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
What: /sys/bus/pci/drivers/xhci_hcd/.../dbc
2+
Date: June 2017
3+
Contact: Lu Baolu <baolu.lu@linux.intel.com>
4+
Description:
5+
xHCI compatible USB host controllers (i.e. super-speed
6+
USB3 controllers) are often implemented with the Debug
7+
Capability (DbC). It can present a debug device which
8+
is fully compliant with the USB framework and provides
9+
the equivalent of a very high performance full-duplex
10+
serial link for debug purpose.
11+
12+
The DbC debug device shares a root port with xHCI host.
13+
When the DbC is enabled, the root port will be assigned
14+
to the Debug Capability. Otherwise, it will be assigned
15+
to xHCI.
16+
17+
Writing "enable" to this attribute will enable the DbC
18+
functionality and the shared root port will be assigned
19+
to the DbC device. Writing "disable" to this attribute
20+
will disable the DbC functionality and the shared root
21+
port will roll back to the xHCI.
22+
23+
Reading this attribute gives the state of the DbC. It
24+
can be one of the following states: disabled, enabled,
25+
initialized, connected, configured and stalled.

drivers/usb/host/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ config USB_XHCI_HCD
2727
module will be called xhci-hcd.
2828

2929
if USB_XHCI_HCD
30+
config USB_XHCI_DBGCAP
31+
bool "xHCI support for debug capability"
32+
depends on TTY
33+
---help---
34+
Say 'Y' to enable the support for the xHCI debug capability. Make
35+
sure that your xHCI host supports the extended debug capability and
36+
you want a TTY serial device based on the xHCI debug capability
37+
before enabling this option. If unsure, say 'N'.
3038

3139
config USB_XHCI_PCI
3240
tristate

drivers/usb/host/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ fhci-$(CONFIG_FHCI_DEBUG) += fhci-dbg.o
1414
xhci-hcd-y := xhci.o xhci-mem.o
1515
xhci-hcd-y += xhci-ring.o xhci-hub.o xhci-dbg.o
1616
xhci-hcd-y += xhci-trace.o
17+
18+
ifneq ($(CONFIG_USB_XHCI_DBGCAP), )
19+
xhci-hcd-y += xhci-dbgcap.o xhci-dbgtty.o
20+
endif
21+
1722
ifneq ($(CONFIG_USB_XHCI_MTK), )
1823
xhci-hcd-y += xhci-mtk-sch.o
1924
endif

0 commit comments

Comments
 (0)