All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lu Baolu <baolu.lu@linux.intel.com>
Subject: [PATCH v3 3/3] usb: doc: Update document for USB3 debug port usage
Date: Tue,  5 Sep 2017 09:59:00 +0800	[thread overview]
Message-ID: <1504576740-11689-4-git-send-email-baolu.lu@linux.intel.com> (raw)
In-Reply-To: <1504576740-11689-1-git-send-email-baolu.lu@linux.intel.com>

Update Documentation/driver-api/usb/usb3-debug-port.rst. This update
includes the guide for using xHCI debug capability based TTY serial
link.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
---
 Documentation/driver-api/usb/usb3-debug-port.rst | 68 ++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/Documentation/driver-api/usb/usb3-debug-port.rst b/Documentation/driver-api/usb/usb3-debug-port.rst
index feb1a36..4ad4787 100644
--- a/Documentation/driver-api/usb/usb3-debug-port.rst
+++ b/Documentation/driver-api/usb/usb3-debug-port.rst
@@ -98,3 +98,71 @@ you to check the sanity of the setup.
 	cat /dev/ttyUSB0
 	done
 	===== end of bash scripts ===============
+
+Serial TTY
+==========
+
+DbC has also been designed for a serial TTY device at runtime.
+One use of this is running a login service on the debug target.
+Hence it can be remote accessed by the debug host. Another use
+can probably be found in servers. It provides a peer-to-peer USB
+link between two host-only machines. This provides a reasonable
+out-of-band communication method between two servers.
+
+In order to use this, you need to make sure your kernel has been
+configured to support USB_XHCI_DBGCAP. A sysfs attribute under
+the xHCI device node is used to enable or disable DbC. By default,
+DbC is disabled::
+
+	root@target:/sys/bus/pci/devices/0000:00:14.0# cat dbc
+	disabled
+
+Enable DbC with the following command::
+
+	root@target:/sys/bus/pci/devices/0000:00:14.0# echo enable > dbc
+
+You can check the DbC state at anytime::
+
+	root@target:/sys/bus/pci/devices/0000:00:14.0# cat dbc
+	enabled
+
+Connect the debug target to the debug host with a USB 3.0 super-
+speed A-to-A debugging cable. You can see the /dev/ttyDBC0 created
+on the debug target. You will see below kernel message lines::
+
+	root@target: tail -f /var/log/kern.log
+	[  182.730103] xhci_hcd 0000:00:14.0: DbC connected
+	[  191.169420] xhci_hcd 0000:00:14.0: DbC configured
+	[  191.169597] xhci_hcd 0000:00:14.0: DbC now attached to /dev/ttyDBC0
+
+Accordingly, the DbC state has been brought up to::
+
+	root@host:/sys/bus/pci/devices/0000:00:14.0# cat dbc
+	configured
+
+On the debug host, you will see the debug device has been enumerated.
+You will see below kernel message lines::
+
+	root@host: tail -f /var/log/kern.log
+	[   79.454780] usb 2-2.1: new SuperSpeed USB device number 3 using xhci_hcd
+	[   79.475003] usb 2-2.1: LPM exit latency is zeroed, disabling LPM.
+	[   79.475389] usb 2-2.1: New USB device found, idVendor=1d6b, idProduct=0004
+	[   79.475390] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
+	[   79.475391] usb 2-2.1: Product: Remote GDB
+	[   79.475392] usb 2-2.1: Manufacturer: Linux
+	[   79.475393] usb 2-2.1: SerialNumber: 0001
+	[   79.660368] usb_debug 2-2.1:1.0: xhci_dbc converter detected
+	[   79.660439] usb 2-2.1: xhci_dbc converter now attached to ttyUSB0
+
+You can simply verify whether it works by::
+
+	# On target side
+	root@target: echo "Hello world" > /dev/ttyDBC0
+
+	# On host side
+	root@host: cat /dev/ttyUSB0
+	Hello world
+
+	# vice versa
+
+You have a workable serial link over USB now.
-- 
2.7.4

      parent reply	other threads:[~2017-09-05  2:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05  1:58 [PATCH v3 0/3] usb: xhci: Add debug capability support in xhci Lu Baolu
2017-09-05  1:58 ` [PATCH v3 1/3] usb: xhci: Make some static functions global Lu Baolu
2017-09-05  1:58 ` [PATCH v3 2/3] usb: xhci: Add DbC support in xHCI driver Lu Baolu
2017-10-24 17:03   ` Mathias Nyman
2017-10-25  2:15     ` Lu Baolu
2017-11-02  1:36   ` Lu Baolu
2017-11-02  8:17     ` Greg Kroah-Hartman
2017-11-02  9:15       ` Felipe Balbi
2017-11-02  9:32         ` Greg Kroah-Hartman
2017-11-02 10:38           ` Felipe Balbi
2017-11-02 16:51             ` Greg Kroah-Hartman
2017-11-03  0:45               ` Lu Baolu
2017-11-03  6:27                 ` Greg Kroah-Hartman
2017-11-03 10:52                   ` Felipe Balbi
2017-11-06  0:35                   ` Lu Baolu
2017-11-06  8:00                     ` Greg Kroah-Hartman
2017-11-07  2:32                       ` Lu Baolu
2017-11-13 15:26   ` Mathias Nyman
2017-11-14  7:28     ` Felipe Balbi
2017-11-15  7:25       ` Lu Baolu
2017-09-05  1:59 ` Lu Baolu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1504576740-11689-4-git-send-email-baolu.lu@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.