2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #include <jailhouse/printk.h>
14 #include <jailhouse/processor.h>
17 #ifdef CONFIG_UART_OXPCIE952
18 #define UART_BASE 0xe010
20 #define UART_BASE 0x3f8
26 #define UART_LCR_8N1 0x03
27 #define UART_LCR_DLAB 0x80
29 #define UART_LSR_THRE 0x20
31 void arch_dbg_write_init(void)
33 outb(UART_LCR_DLAB, UART_BASE + UART_LCR);
34 #ifdef CONFIG_UART_OXPCIE952
35 outb(0x22, UART_BASE + UART_DLL);
37 outb(1, UART_BASE + UART_DLL);
39 outb(0, UART_BASE + UART_DLM);
40 outb(UART_LCR_8N1, UART_BASE + UART_LCR);
43 void arch_dbg_write(const char *msg)
51 while (!(inb(UART_BASE + UART_LSR) & UART_LSR_THRE))
53 if (panic_in_progress && panic_cpu != phys_processor_id())
55 outb(c, UART_BASE + UART_TX);