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 //it was changed for fiasco use-case (default 0x3f8)
21 #define UART_BASE 0x2f8
27 #define UART_LCR_8N1 0x03
28 #define UART_LCR_DLAB 0x80
30 #define UART_LSR_THRE 0x20
32 void arch_dbg_write_init(void)
34 outb(UART_LCR_DLAB, UART_BASE + UART_LCR);
35 #ifdef CONFIG_UART_OXPCIE952
36 outb(0x22, UART_BASE + UART_DLL);
38 outb(1, UART_BASE + UART_DLL);
40 outb(0, UART_BASE + UART_DLM);
41 outb(UART_LCR_8N1, UART_BASE + UART_LCR);
44 void arch_dbg_write(const char *msg)
55 while (!(inb(UART_BASE + UART_LSR) & UART_LSR_THRE))
57 if (panic_in_progress && panic_cpu != phys_processor_id())
59 outb(c, UART_BASE + UART_TX);