]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: unify all serials' registers with the first serial
authorLiming Wang <walimisdev@gmail.com>
Fri, 12 Aug 2011 14:59:29 +0000 (22:59 +0800)
committerPekka Enberg <penberg@kernel.org>
Fri, 12 Aug 2011 15:27:14 +0000 (18:27 +0300)
To make all serials work well, unify value of the last three
serials' registers with the first serial. Otherwise, using ttyS1,
ttyS2, ttyS3 as console will slow the output.

Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/hw/serial.c

index 1199264e12e2f650a5cd2afde74f2665c9d45c8b..f817a4ee8a2acfd1c36a4343aa1bb28cdcaa5ee7 100644 (file)
@@ -31,6 +31,12 @@ struct serial8250_device {
        u8                      scr;
 };
 
+#define SERIAL_REGS_SETTING \
+       .iir                    = UART_IIR_NO_INT, \
+       .lsr                    = UART_LSR_TEMT | UART_LSR_THRE, \
+       .msr                    = UART_MSR_DCD | UART_MSR_DSR | UART_MSR_CTS, \
+       .mcr                    = UART_MCR_OUT2,
+
 static struct serial8250_device devices[] = {
        /* ttyS0 */
        [0]     = {
@@ -39,10 +45,7 @@ static struct serial8250_device devices[] = {
                .iobase                 = 0x3f8,
                .irq                    = 4,
 
-               .iir                    = UART_IIR_NO_INT,
-               .lsr                    = UART_LSR_TEMT | UART_LSR_THRE,
-               .msr                    = UART_MSR_DCD | UART_MSR_DSR | UART_MSR_CTS,
-               .mcr                    = UART_MCR_OUT2,
+               SERIAL_REGS_SETTING
        },
        /* ttyS1 */
        [1]     = {
@@ -51,7 +54,7 @@ static struct serial8250_device devices[] = {
                .iobase                 = 0x2f8,
                .irq                    = 3,
 
-               .iir                    = UART_IIR_NO_INT,
+               SERIAL_REGS_SETTING
        },
        /* ttyS2 */
        [2]     = {
@@ -60,7 +63,7 @@ static struct serial8250_device devices[] = {
                .iobase                 = 0x3e8,
                .irq                    = 4,
 
-               .iir                    = UART_IIR_NO_INT,
+               SERIAL_REGS_SETTING
        },
        /* ttyS3 */
        [3]     = {
@@ -69,7 +72,7 @@ static struct serial8250_device devices[] = {
                .iobase                 = 0x2e8,
                .irq                    = 3,
 
-               .iir                    = UART_IIR_NO_INT,
+               SERIAL_REGS_SETTING
        },
 };