diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2016-02-25 12:10:37 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2016-02-26 15:37:24 +0000 |
commit | 16e506efc08e5cab313588bd0e38803d4bbaad59 (patch) | |
tree | 7fc75d2f12469180b50205fb548641da24650124 /drivers/tty/hvc | |
parent | 81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff) |
hvc_xen: add earlycon support
Introduce EARLYCON support in hvc_xen, useful for early debugging on arm
and arm64, where xen early_printk is not available.
It is different from xenboot_write_console on x86 in two ways:
- it does not return if !xen_pv_domain(), not only because ARM guests
are xen_hvm_domain(), but also because we want to capture all the
early boot messages, before xen support is discovered
- it does not try to print to the domU console at all, because xen
support will only be discovered at a later point
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/tty/hvc')
-rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index fa816b7193b6..68b8ec886bec 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -25,6 +25,7 @@ #include <linux/init.h> #include <linux/types.h> #include <linux/list.h> +#include <linux/serial_core.h> #include <asm/io.h> #include <asm/xen/hypervisor.h> @@ -664,3 +665,18 @@ void xen_raw_printk(const char *fmt, ...) xen_raw_console_write(buf); } + +static void xenboot_earlycon_write(struct console *console, + const char *string, + unsigned len) +{ + dom0_write_console(0, string, len); +} + +static int __init xenboot_earlycon_setup(struct earlycon_device *device, + const char *opt) +{ + device->con->write = xenboot_earlycon_write; + return 0; +} +EARLYCON_DECLARE(xenboot, xenboot_earlycon_setup); |