[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 09/37] serial: add "baudbase" property
From: |
Marc-André Lureau |
Subject: |
[PATCH v4 09/37] serial: add "baudbase" property |
Date: |
Wed, 20 Nov 2019 19:24:14 +0400 |
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
---
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
- [PATCH v4 02/37] sysbus: remove unused sysbus_try_create*, (continued)
- [PATCH v4 02/37] sysbus: remove unused sysbus_try_create*, Marc-André Lureau, 2019/11/20
- [PATCH v4 03/37] sysbus: remove outdated comment, Marc-André Lureau, 2019/11/20
- [PATCH v4 04/37] chardev: generate an internal id when none given, Marc-André Lureau, 2019/11/20
- [PATCH v4 06/37] serial: initial qom-ification, Marc-André Lureau, 2019/11/20
- [PATCH v4 07/37] serial: register vmsd with DeviceClass, Marc-André Lureau, 2019/11/20
- [PATCH v4 05/37] serial-pci-multi: factor out multi_serial_get_port_count(), Marc-André Lureau, 2019/11/20
- [PATCH v4 08/37] serial: add "chardev" property, Marc-André Lureau, 2019/11/20
- [PATCH v4 09/37] serial: add "baudbase" property,
Marc-André Lureau <=
- [PATCH v4 10/37] serial: realize the serial device, Marc-André Lureau, 2019/11/20
- [PATCH v4 11/37] serial: replace serial_exit_core() with unrealize, Marc-André Lureau, 2019/11/20
- [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/20
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Peter Maydell, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Peter Maydell, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/21
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Peter Maydell, 2019/11/22
- Re: [PATCH v4 12/37] serial: start making SerialMM a sysbus device, Marc-André Lureau, 2019/11/22