mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-09-04 12:41:37 +00:00
kvm,8250: Fix device initial state
This patch fixes 8250 device initial state for registers and IRQ based on what Qemu does. Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
279ba8253e
commit
bc4b0ffef3
+11
-3
@@ -32,8 +32,10 @@ static struct serial8250_device devices[] = {
|
||||
.iobase = 0x3f8,
|
||||
.irq = 4,
|
||||
|
||||
.lsr = UART_LSR_TEMT | UART_LSR_THRE,
|
||||
.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,
|
||||
},
|
||||
/* ttyS1 */
|
||||
[1] = {
|
||||
@@ -282,13 +284,19 @@ static struct ioport_operations serial8250_ops = {
|
||||
.io_out = serial8250_out,
|
||||
};
|
||||
|
||||
void serial8250__init(void)
|
||||
static void serial8250__device_init(struct kvm *kvm, struct serial8250_device *dev)
|
||||
{
|
||||
ioport__register(dev->iobase, &serial8250_ops, 8);
|
||||
kvm__irq_line(kvm, dev->irq, 0);
|
||||
}
|
||||
|
||||
void serial8250__init(struct kvm *kvm)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(devices); i++) {
|
||||
struct serial8250_device *dev = &devices[i];
|
||||
|
||||
ioport__register(dev->iobase, &serial8250_ops, 8);
|
||||
serial8250__device_init(kvm, dev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
struct kvm;
|
||||
|
||||
void serial8250__init(void);
|
||||
void serial8250__interrupt(struct kvm *self);
|
||||
void serial8250__init(struct kvm *kvm);
|
||||
void serial8250__interrupt(struct kvm *kvm);
|
||||
|
||||
#endif /* KVM__8250_SERIAL_H */
|
||||
|
||||
Reference in New Issue
Block a user