Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com> Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> --- hw/char/serial-isa.c | 1 - hw/char/serial-pci-multi.c | 1 - hw/char/serial-pci.c | 1 - hw/char/serial.c | 5 +++-- 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 9a5928b3ee..2a4c8de1bf 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 edfbfdca9e..4891f32230 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 f99b6c19e0..db2c17aafd 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 83417cb8c4..4a598ead21 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(), }; @@ -1071,7 +1072,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 180cc7c24e..3dc618598e 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; -- 2.24.0