console: add EHCI debug port based serial console

Low level hardware interface pieces adapted from Linux.

For setup information, see Linux'es Documentation/x86/earlyprintk.txt
and/or http://www.coreboot.org/EHCI_Debug_Port.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Keir Fraser <keir@xen.org>
This commit is contained in:
Jan Beulich committed 2012-09-11 15:49:52 +02:00
1 parent af844567f0
commit 322ecbe4ac
10 files changed
+1644 -3

No files matched your search

+9 -1
View File
@@ -244,7 +244,7 @@ A typical setup for most situations might be `com1=115200,8n1`
Specify the size of the console ring buffer.
### console
> `= List of [ vga | com1[H,L] | com2[H,L] | none ]`
> `= List of [ vga | com1[H,L] | com2[H,L] | dbgp | none ]`
> Default: `console=com1,vga`
@@ -260,6 +260,8 @@ the converse; transmitted and received characters will have their MSB
cleared. This allows a single port to be shared by two subsystems
(e.g. console and debugger).
`dbgp` indicates that Xen should use a USB debug port.
`none` indicates that Xen should not use a console. This option only
makes sense on its own.
@@ -352,6 +354,12 @@ combination with the `low_crashinfo` command line option.
### credit2\_load\_window\_shift
> `= <integer>`
### 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).
### debug\_stack\_lines
> `= <integer>`
+1
View File
@@ -7,6 +7,7 @@ HAS_CPUFREQ := y
HAS_PCI := y
HAS_PASSTHROUGH := y
HAS_NS16550 := y
HAS_EHCI := y
HAS_KEXEC := y
HAS_GDBSX := y
xenoprof := y
+14
View File
@@ -8,6 +8,7 @@
#include <xen/event.h>
#include <xen/guest_access.h>
#include <xen/iocap.h>
#include <xen/serial.h>
#include <asm/current.h>
#include <asm/io_apic.h>
#include <asm/msi.h>
@@ -722,6 +723,19 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
break;
}
case PHYSDEVOP_dbgp_op: {
struct physdev_dbgp_op op;
if ( !IS_PRIV(v->domain) )
ret = -EPERM;
else if ( copy_from_guest(&op, arg, 1) )
ret = -EFAULT;
else
ret = dbgp_op(&op);
break;
}
default:
ret = -ENOSYS;
break;
+1
View File
@@ -606,6 +606,7 @@ void __init __start_xen(unsigned long mbi_p)
ns16550.io_base = 0x2f8;
ns16550.irq = 3;
ns16550_init(1, &ns16550);
ehci_dbgp_init();
console_init_preirq();
printk("Bootloader: %s\n", loader);
+1
View File
@@ -1,4 +1,5 @@
obj-y += console.o
obj-$(HAS_NS16550) += ns16550.o
obj-$(HAS_PL011) += pl011.o
obj-$(HAS_EHCI) += ehci-dbgp.o
obj-y += serial.o
File diff suppressed because it is too large. Load diff
+8
View File
@@ -265,6 +265,14 @@ int __init serial_parse_handle(char *conf)
{
int handle;
if ( !strncmp(conf, "dbgp", 4) && (!conf[4] || conf[4] == ',') )
{
if ( !com[SERHND_DBGP].driver )
goto fail;
return SERHND_DBGP | SERHND_COOKED;
}
if ( strncmp(conf, "com", 3) )
goto fail;
+9 -1
View File
@@ -36,7 +36,15 @@
* from the end of virtual memory backwards.
*/
enum fixed_addresses {
FIX_RESERVED, /* Index 0 is reserved since fix_to_virt(0) > FIXADDR_TOP. */
/* Index 0 is reserved since fix_to_virt(0) == FIXADDR_TOP. */
FIX_RESERVED,
/*
* Indexes using the page tables set up before entering __start_xen()
* must be among the first (L1_PAGETABLE_ENTRIES - 1) entries.
* These are generally those needed by the various console drivers.
*/
FIX_EHCI_DBGP,
/* Everything else should go further down. */
#ifdef __i386__
FIX_PAE_HIGHMEM_0,
FIX_PAE_HIGHMEM_END = FIX_PAE_HIGHMEM_0 + NR_CPUS-1,
+18
View File
@@ -312,6 +312,24 @@ struct physdev_pci_device {
typedef struct physdev_pci_device physdev_pci_device_t;
DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
#define PHYSDEVOP_DBGP_RESET_PREPARE 1
#define PHYSDEVOP_DBGP_RESET_DONE 2
#define PHYSDEVOP_DBGP_BUS_UNKNOWN 0
#define PHYSDEVOP_DBGP_BUS_PCI 1
#define PHYSDEVOP_dbgp_op 29
struct physdev_dbgp_op {
/* IN */
uint8_t op;
uint8_t bus;
union {
struct physdev_pci_device pci;
} u;
};
typedef struct physdev_dbgp_op physdev_dbgp_op_t;
DEFINE_XEN_GUEST_HANDLE(physdev_dbgp_op_t);
/*
* Notify that some PIRQ-bound event channels have been unmasked.
* ** This command is obsolete since interface version 0x00030202 and is **
+6 -1
View File
@@ -69,9 +69,10 @@ struct uart_driver {
};
/* 'Serial handles' are composed from the following fields. */
#define SERHND_IDX (3<<0) /* COM1 or COM2? */
#define SERHND_IDX (3<<0) /* COM1, COM2, or DBGP? */
# define SERHND_COM1 (0<<0)
# define SERHND_COM2 (1<<0)
# define SERHND_DBGP (2<<0)
#define SERHND_HI (1<<2) /* Mux/demux each transferred char by MSB. */
#define SERHND_LO (1<<3) /* Ditto, except that the MSB is cleared. */
#define SERHND_COOKED (1<<4) /* Newline/carriage-return translation? */
@@ -142,9 +143,13 @@ struct ns16550_defaults {
unsigned long io_base; /* default io_base address */
};
void ns16550_init(int index, struct ns16550_defaults *defaults);
void ehci_dbgp_init(void);
void pl011_init(int index, unsigned long register_base_address);
struct physdev_dbgp_op;
int dbgp_op(const struct physdev_dbgp_op *);
/* Baud rate was pre-configured before invoking the UART driver. */
#define BAUD_AUTO (-1)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.