]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm,serial: Enable THRI bit in IIR register
authorPekka Enberg <penberg@kernel.org>
Sat, 8 Jan 2011 20:56:25 +0000 (22:56 +0200)
committerPekka Enberg <penberg@kernel.org>
Sat, 8 Jan 2011 20:56:25 +0000 (22:56 +0200)
This patch enables the THRI ("transmission holding register empty") bit in the
IIR register to make sure the guest doesn't think we have data waiting for it.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/early_printk.c

index a10d35846309cbf665973630666c984abe2b20e1..d5db3a12a523b8693a4e9ff09f4e5807d9c12e51 100644 (file)
@@ -24,6 +24,7 @@
 #define IIR            2
 
 #define UART_IIR_NO_INT                0x01
+#define UART_IIR_THRI          0x02
 
 /* 16550 FIFO Control Register */
 #define FCR            2
@@ -130,13 +131,13 @@ static bool serial8250_in(struct kvm *self, uint16_t port, void *data, int size,
 
        switch (offset) {
        case THR:
-               ioport__write8(data, 0x00);
+               /* TODO: input support */
                break;
        case IER:
                ioport__write8(data, device.ier);
                break;
        case IIR:
-               ioport__write8(data, UART_IIR_NO_INT);
+               ioport__write8(data, UART_IIR_NO_INT | UART_IIR_THRI);
                break;
        case LCR:
                ioport__write8(data, device.lcr);