From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Marcel Apfelbaum <marcel.a@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Anthony Liguori <aliguori@amazon.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 01/10] serial-pci: Set prog interface field of pci config to 16550 compatible
Date: Thu, 5 Jun 2014 20:17:07 +0300 [thread overview]
Message-ID: <1401986505-12359-2-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1401986505-12359-1-git-send-email-mst@redhat.com>
From: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/hw/i386/pc.h | 15 +++++++++++++++
hw/char/serial-pci.c | 7 +++++++
2 files changed, 22 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 32a7687..552fbd8 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -271,6 +271,21 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
.driver = "apic",\
.property = "version",\
.value = stringify(0x11),\
+ },\
+ {\
+ .driver = "pci-serial",\
+ .property = "prog_if",\
+ .value = stringify(0),\
+ },\
+ {\
+ .driver = "pci-serial-2x",\
+ .property = "prof_if",\
+ .value = stringify(0),\
+ },\
+ {\
+ .driver = "pci-serial-4x",\
+ .property = "prog_if",\
+ .value = stringify(0),\
}
#define PC_COMPAT_1_7 \
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 991c99f..acccc9c 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -34,6 +34,7 @@
typedef struct PCISerialState {
PCIDevice dev;
SerialState state;
+ uint8_t prog_if;
} PCISerialState;
typedef struct PCIMultiSerialState {
@@ -44,6 +45,7 @@ typedef struct PCIMultiSerialState {
SerialState state[PCI_SERIAL_MAX_PORTS];
uint32_t level[PCI_SERIAL_MAX_PORTS];
qemu_irq *irqs;
+ uint8_t prog_if;
} PCIMultiSerialState;
static int serial_pci_init(PCIDevice *dev)
@@ -60,6 +62,7 @@ static int serial_pci_init(PCIDevice *dev)
return -1;
}
+ pci->dev.config[PCI_CLASS_PROG] = pci->prog_if;
pci->dev.config[PCI_INTERRUPT_PIN] = 0x01;
s->irq = pci_allocate_irq(&pci->dev);
@@ -101,6 +104,7 @@ static int multi_serial_pci_init(PCIDevice *dev)
assert(pci->ports > 0);
assert(pci->ports <= PCI_SERIAL_MAX_PORTS);
+ pci->dev.config[PCI_CLASS_PROG] = pci->prog_if;
pci->dev.config[PCI_INTERRUPT_PIN] = 0x01;
memory_region_init(&pci->iobar, OBJECT(pci), "multiserial", 8 * pci->ports);
pci_register_bar(&pci->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->iobar);
@@ -177,12 +181,14 @@ static const VMStateDescription vmstate_pci_multi_serial = {
static Property serial_pci_properties[] = {
DEFINE_PROP_CHR("chardev", PCISerialState, state.chr),
+ DEFINE_PROP_UINT8("prog_if", PCISerialState, prog_if, 0x02),
DEFINE_PROP_END_OF_LIST(),
};
static Property multi_2x_serial_pci_properties[] = {
DEFINE_PROP_CHR("chardev1", PCIMultiSerialState, state[0].chr),
DEFINE_PROP_CHR("chardev2", PCIMultiSerialState, state[1].chr),
+ DEFINE_PROP_UINT8("prog_if", PCIMultiSerialState, prog_if, 0x02),
DEFINE_PROP_END_OF_LIST(),
};
@@ -191,6 +197,7 @@ static Property multi_4x_serial_pci_properties[] = {
DEFINE_PROP_CHR("chardev2", PCIMultiSerialState, state[1].chr),
DEFINE_PROP_CHR("chardev3", PCIMultiSerialState, state[2].chr),
DEFINE_PROP_CHR("chardev4", PCIMultiSerialState, state[3].chr),
+ DEFINE_PROP_UINT8("prog_if", PCIMultiSerialState, prog_if, 0x02),
DEFINE_PROP_END_OF_LIST(),
};
--
MST
next prev parent reply other threads:[~2014-06-05 17:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 17:17 [Qemu-devel] [PULL 00/10] pc,pci,virtio,qdev fixes, tests Michael S. Tsirkin
2014-06-05 17:17 ` Michael S. Tsirkin [this message]
2014-06-05 17:17 ` [Qemu-devel] [PULL 02/10] SMBIOS: Fix endian-ness when populating multi-byte fields Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 03/10] SMBIOS: Update Type 0 struct generator for machines >= 2.1 Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 04/10] SMBIOS: Fix type 17 field sizes Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 05/10] pcie_host: Turn pcie_host_init() into an instance_init Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 06/10] virtio-balloon: return empty data when no stats are available Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 07/10] tests: rename acpi-test to bios-tables-test Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 08/10] tests: add smbios testing Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 09/10] qdev: Display warning about unused -global Michael S. Tsirkin
2014-06-05 17:17 ` [Qemu-devel] [PULL 10/10] qdev: Add test of qdev_prop_check_global Michael S. Tsirkin
2014-06-09 12:19 ` Peter Maydell
2014-06-09 13:10 ` Michael S. Tsirkin
2014-06-09 22:53 ` Eduardo Habkost
2014-06-05 21:40 ` [Qemu-devel] [PULL 00/10] pc,pci,virtio,qdev fixes, tests 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=1401986505-12359-2-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@amazon.com \
--cc=kraxel@redhat.com \
--cc=marcel.a@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).