diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-10-22 00:35:36 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-07 16:50:48 +0400 |
commit | 96651db423a0a25466629d35c775531f5145a66a (patch) | |
tree | ef3639f2ef0443d3e6238a882286e7f943f36f6a | |
parent | ff22c588f474c6799015365d25548ab845a4f5cd (diff) | |
download | qemu-96651db423a0a25466629d35c775531f5145a66a.zip qemu-96651db423a0a25466629d35c775531f5145a66a.tar.gz qemu-96651db423a0a25466629d35c775531f5145a66a.tar.bz2 |
serial: add "baudbase" property
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/char/serial-isa.c | 1 | ||||
-rw-r--r-- | hw/char/serial-pci-multi.c | 1 | ||||
-rw-r--r-- | hw/char/serial-pci.c | 1 | ||||
-rw-r--r-- | hw/char/serial.c | 5 | ||||
-rw-r--r-- | include/hw/char/serial.h | 2 |
5 files changed, 4 insertions, 6 deletions
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 9a5928b..2a4c8de 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -73,7 +73,6 @@ static void serial_isa_realizefn(DeviceState *dev, Error **errp) } index++; - s->baudbase = 115200; isa_init_irq(isadev, &s->irq, isa->isairq); serial_realize_core(s, errp); qdev_set_legacy_instance_id(dev, isa->iobase, 3); diff --git a/hw/char/serial-pci-multi.c b/hw/char/serial-pci-multi.c index edfbfdc..4891f32 100644 --- a/hw/char/serial-pci-multi.c +++ b/hw/char/serial-pci-multi.c @@ -106,7 +106,6 @@ static void multi_serial_pci_realize(PCIDevice *dev, Error **errp) for (i = 0; i < nports; i++) { s = pci->state + i; - s->baudbase = 115200; serial_realize_core(s, &err); if (err != NULL) { error_propagate(errp, err); diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index f99b6c1..db2c17a 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -49,7 +49,6 @@ static void serial_pci_realize(PCIDevice *dev, Error **errp) SerialState *s = &pci->state; Error *err = NULL; - s->baudbase = 115200; serial_realize_core(s, &err); if (err != NULL) { error_propagate(errp, err); diff --git a/hw/char/serial.c b/hw/char/serial.c index 1746dbc..a4f0566 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -988,7 +988,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase, SerialState *s = SERIAL(dev); s->irq = irq; - s->baudbase = baudbase; + qdev_prop_set_uint32(dev, "baudbase", baudbase); qdev_prop_set_chr(dev, "chardev", chr); serial_realize_core(s, &error_fatal); qdev_set_legacy_instance_id(dev, base, 2); @@ -1002,6 +1002,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase, static Property serial_properties[] = { DEFINE_PROP_CHR("chardev", SerialState, chr), + DEFINE_PROP_UINT32("baudbase", SerialState, baudbase, 115200), DEFINE_PROP_END_OF_LIST(), }; @@ -1072,7 +1073,7 @@ SerialState *serial_mm_init(MemoryRegion *address_space, s->it_shift = it_shift; s->irq = irq; - s->baudbase = baudbase; + qdev_prop_set_uint32(dev, "baudbase", baudbase); qdev_prop_set_chr(dev, "chardev", chr); serial_realize_core(s, &error_fatal); diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 180cc7c..3dc6185 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -58,7 +58,7 @@ typedef struct SerialState { CharBackend chr; int last_break_enable; int it_shift; - int baudbase; + uint32_t baudbase; uint32_t tsr_retry; guint watch_tag; uint32_t wakeup; |