aboutsummaryrefslogtreecommitdiff
path: root/hw/char
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-10-22 00:35:36 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-07 16:50:48 +0400
commit96651db423a0a25466629d35c775531f5145a66a (patch)
treeef3639f2ef0443d3e6238a882286e7f943f36f6a /hw/char
parentff22c588f474c6799015365d25548ab845a4f5cd (diff)
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>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/serial-isa.c1
-rw-r--r--hw/char/serial-pci-multi.c1
-rw-r--r--hw/char/serial-pci.c1
-rw-r--r--hw/char/serial.c5
4 files changed, 3 insertions, 5 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 1746dbc1c4..a4f0566865 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);