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>
This commit is contained in:
Marc-André Lureau 2019-10-22 00:35:36 +02:00
parent ff22c588f4
commit 96651db423
5 changed files with 4 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;