[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v5 1/9] drivers/char: separate dbgp=xhci to dbc=xhci option



This allows configuring EHCI and XHCI consoles separately,
simultaneously.

Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
---
new in v5
---
 docs/misc/xen-command-line.pandoc | 18 ++++++++++++------
 xen/drivers/char/serial.c         |  6 ++++++
 xen/drivers/char/xhci-dbc.c       | 20 ++++++++++----------
 xen/include/xen/serial.h          |  1 +
 4 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc 
b/docs/misc/xen-command-line.pandoc
index 9a79385a3712..0d07f0c75990 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -409,7 +409,7 @@ The following are examples of correct specifications:
 Specify the size of the console ring buffer.
 
 ### console
-> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | none ]`
+> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | dbc | none ]`
 
 > Default: `console=com1,vga`
 
@@ -428,7 +428,9 @@ cleared.  This allows a single port to be shared by two 
subsystems
 `pv` indicates that Xen should use Xen's PV console. This option is
 only available when used together with `pv-in-pvh`.
 
-`dbgp` indicates that Xen should use a USB debug port.
+`dbgp` indicates that Xen should use a USB2 debug port.
+
+`dbc` indicates that Xen should use a USB3 debug port.
 
 `none` indicates that Xen should not use a console.  This option only
 makes sense on its own.
@@ -721,14 +723,18 @@ Available alternatives, with their meaning, are:
 
 ### dbgp
 > `= ehci[ <integer> | @pci<bus>:<slot>.<func> ]`
+
+Specify the USB controller to use, either by instance number (when going
+over the PCI busses sequentially) or by PCI device (must be on segment 0).
+
+### dbc
 > `= xhci[ <integer> | @pci<bus>:<slot>.<func> ]`
 
 Specify the USB controller to use, either by instance number (when going
 over the PCI busses sequentially) or by PCI device (must be on segment 0).
 
-Use `ehci` for EHCI debug port, use `xhci` for XHCI debug capability (output
-only). XHCI driver will wait indefinitely for the debug host to connect - make
-sure the cable is connected.
+Output only console. XHCI driver will wait indefinitely for the debug host to
+connect - make sure the cable is connected.
 
 ### debug_stack_lines
 > `= <integer>`
@@ -1174,7 +1180,7 @@ virtualization, to allow the L1 hypervisor to use EPT 
even if the L0 hypervisor
 does not provide `VM_ENTRY_LOAD_GUEST_PAT`.
 
 ### gdb
-> `= com1[H,L] | com2[H,L] | dbgp`
+> `= com1[H,L] | com2[H,L] | dbgp | dbc`
 
 > Default: ``
 
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index 47899222cef8..7daaa61361bb 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -311,6 +311,12 @@ int __init serial_parse_handle(const char *conf)
         goto common;
     }
 
+    if ( !strncmp(conf, "dbc", 3) && (!conf[3] || conf[3] == ',') )
+    {
+        handle = SERHND_DBC;
+        goto common;
+    }
+
     if ( !strncmp(conf, "dtuart", 6) )
     {
         handle = SERHND_DTUART;
diff --git a/xen/drivers/char/xhci-dbc.c b/xen/drivers/char/xhci-dbc.c
index ca7d4a62139e..eb35e3a2ee4f 100644
--- a/xen/drivers/char/xhci-dbc.c
+++ b/xen/drivers/char/xhci-dbc.c
@@ -1058,9 +1058,9 @@ static struct xhci_dbc_ctx ctx __aligned(16);
 static uint8_t out_wrk_buf[DBC_WORK_RING_CAP];
 static struct xhci_string_descriptor str_buf[DBC_STRINGS_COUNT];
 
-static char __initdata opt_dbgp[30];
+static char __initdata opt_dbc[30];
 
-string_param("dbgp", opt_dbgp);
+string_param("dbc", opt_dbc);
 
 void __init xhci_dbc_uart_init(void)
 {
@@ -1068,25 +1068,25 @@ void __init xhci_dbc_uart_init(void)
     struct dbc *dbc = &uart->dbc;
     const char *e;
 
-    if ( strncmp(opt_dbgp, "xhci", 4) )
+    if ( strncmp(opt_dbc, "xhci", 4) )
         return;
 
     memset(dbc, 0, sizeof(*dbc));
 
-    if ( isdigit(opt_dbgp[4]) )
+    if ( isdigit(opt_dbc[4]) )
     {
-        dbc->xhc_num = simple_strtoul(opt_dbgp + 4, &e, 10);
+        dbc->xhc_num = simple_strtoul(opt_dbc + 4, &e, 10);
     }
-    else if ( strncmp(opt_dbgp + 4, "@pci", 4) == 0 )
+    else if ( strncmp(opt_dbc + 4, "@pci", 4) == 0 )
     {
         unsigned int bus, slot, func;
 
-        e = parse_pci(opt_dbgp + 8, NULL, &bus, &slot, &func);
+        e = parse_pci(opt_dbc + 8, NULL, &bus, &slot, &func);
         if ( !e || *e )
         {
             printk(XENLOG_ERR
-                   "Invalid dbgp= PCI device spec: '%s'\n",
-                   opt_dbgp + 8);
+                   "Invalid dbc= PCI device spec: '%s'\n",
+                   opt_dbc + 8);
             return;
         }
 
@@ -1102,7 +1102,7 @@ void __init xhci_dbc_uart_init(void)
     dbc->dbc_str = str_buf;
 
     if ( dbc_open(dbc) )
-        serial_register_uart(SERHND_DBGP, &dbc_uart_driver, &dbc_uart);
+        serial_register_uart(SERHND_DBC, &dbc_uart_driver, &dbc_uart);
 }
 
 #ifdef DBC_DEBUG
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 4cd4ae5e6f1c..186afbed9c92 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -95,6 +95,7 @@ struct uart_driver {
 # define SERHND_COM1    (0<<0)
 # define SERHND_COM2    (1<<0)
 # define SERHND_DBGP    (2<<0)
+# define SERHND_DBC     (3<<0)
 # define SERHND_DTUART  (0<<0) /* Steal SERHND_COM1 value */
 #define SERHND_HI       (1<<2) /* Mux/demux each transferred char by MSB. */
 #define SERHND_LO       (1<<3) /* Ditto, except that the MSB is cleared.  */
-- 
git-series 0.9.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.