All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PULL 09/37] serial: add "baudbase" property
Date: Tue,  7 Jan 2020 19:04:14 +0400	[thread overview]
Message-ID: <20200107150442.1727958-10-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20200107150442.1727958-1-marcandre.lureau@redhat.com>

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>
---
 include/hw/char/serial.h   | 2 +-
 hw/char/serial-isa.c       | 1 -
 hw/char/serial-pci-multi.c | 1 -
 hw/char/serial-pci.c       | 1 -
 hw/char/serial.c           | 5 +++--
 5 files changed, 4 insertions(+), 6 deletions(-)

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;
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);
-- 
2.25.0.rc1.20.g2443f3f80d



  parent reply	other threads:[~2020-01-07 15:10 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 15:04 [PULL 00/37] qom-ify serial and remove QDEV_PROP_PTR Marc-André Lureau
2020-01-07 15:04 ` [PULL 01/37] hw/display/sm501: Always map the UART0 Marc-André Lureau
2020-01-07 15:04 ` [PULL 02/37] sysbus: remove unused sysbus_try_create* Marc-André Lureau
2020-01-07 15:04 ` [PULL 03/37] sysbus: remove outdated comment Marc-André Lureau
2020-01-07 15:04 ` [PULL 04/37] chardev: generate an internal id when none given Marc-André Lureau
2020-01-07 15:04 ` [PULL 05/37] serial-pci-multi: factor out multi_serial_get_port_count() Marc-André Lureau
2020-01-07 15:04 ` [PULL 06/37] serial: initial qom-ification Marc-André Lureau
2020-01-07 15:04 ` [PULL 07/37] serial: register vmsd with DeviceClass Marc-André Lureau
2020-01-07 15:04 ` [PULL 08/37] serial: add "chardev" property Marc-André Lureau
2020-01-07 15:04 ` Marc-André Lureau [this message]
2020-01-07 15:04 ` [PULL 10/37] serial: realize the serial device Marc-André Lureau
2020-01-07 15:04 ` [PULL 11/37] serial: replace serial_exit_core() with unrealize Marc-André Lureau
2020-01-07 15:04 ` [PULL 12/37] serial: start making SerialMM a sysbus device Marc-André Lureau
2020-01-07 15:04 ` [PULL 13/37] serial-mm: add "regshift" property Marc-André Lureau
2020-01-07 15:04 ` [PULL 14/37] serial-mm: add endianness property Marc-André Lureau
2020-01-07 15:04 ` [PULL 15/37] serial-mm: use sysbus facilities Marc-André Lureau
2020-01-07 15:04 ` [PULL 16/37] serial: make SerialIO a sysbus device Marc-André Lureau
2020-01-07 15:04 ` [PULL 17/37] mips: inline serial_init() Marc-André Lureau
2020-01-07 15:04 ` [PULL 18/37] mips: baudbase is 115200 by default Marc-André Lureau
2020-01-07 15:04 ` [PULL 19/37] mips: use sysbus_add_io() Marc-André Lureau
2020-01-07 15:04 ` [PULL 20/37] mips: use sysbus_mmio_get_region() instead of internal fields Marc-André Lureau
2020-01-07 15:04 ` [PULL 21/37] sm501: make SerialMM a child, export chardev property Marc-André Lureau
2020-01-07 15:04 ` [PULL 22/37] vmmouse: replace PROP_PTR with PROP_LINK Marc-André Lureau
2020-01-07 15:04 ` [PULL 23/37] lance: " Marc-André Lureau
2020-01-07 15:04 ` [PULL 24/37] etraxfs: remove PROP_PTR usage Marc-André Lureau
2020-01-07 15:04 ` [PULL 25/37] dp8393x: replace PROP_PTR with PROP_LINK Marc-André Lureau
2020-01-07 15:04 ` [PULL 26/37] leon3: use qemu_irq framework instead of callback as property Marc-André Lureau
2020-01-07 15:04 ` [PULL 27/37] leon3: use qdev gpio facilities for the PIL Marc-André Lureau
2020-01-07 15:04 ` [PULL 28/37] qdev: use g_strcmp0() instead of open-coding it Marc-André Lureau
2020-01-07 15:04 ` [PULL 29/37] mips/cps: fix setting saar property Marc-André Lureau
2020-01-07 15:04 ` [PULL 30/37] cris: improve passing PIC interrupt vector to the CPU Marc-André Lureau
2020-01-07 15:04 ` [PULL 31/37] smbus-eeprom: remove PROP_PTR Marc-André Lureau
2020-01-07 15:04 ` [PULL 32/37] omap-intc: " Marc-André Lureau
2020-01-07 15:04 ` [PULL 33/37] omap-i2c: " Marc-André Lureau
2020-01-07 15:04 ` [PULL 34/37] omap-gpio: " Marc-André Lureau
2020-01-07 15:04 ` [PULL 35/37] qdev: remove PROP_MEMORY_REGION Marc-André Lureau
2020-01-07 15:04 ` [PULL 36/37] qdev: remove QDEV_PROP_PTR Marc-André Lureau
2020-07-06  8:44   ` Philippe Mathieu-Daudé
2020-07-06 10:01     ` Marc-André Lureau
2020-07-06 10:13       ` Philippe Mathieu-Daudé
2020-07-06 12:03         ` Markus Armbruster
2020-01-07 15:04 ` [PULL 37/37] qdev/qom: remove some TODO limitations now that PROP_PTR is gone Marc-André Lureau
2020-01-10 10:31 ` [PULL 00/37] qom-ify serial and remove QDEV_PROP_PTR Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200107150442.1727958-10-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.