From: Liu Ping Fan <qemulist@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Jan Kiszka" <jan.kiszka@siemens.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH v5 4/5] PC: differentiate hpet's interrupt capability on piix and q35
Date: Thu, 12 Sep 2013 11:25:17 +0800 [thread overview]
Message-ID: <1378956318-23395-5-git-send-email-pingfank@linux.vnet.ibm.com> (raw)
In-Reply-To: <1378956318-23395-1-git-send-email-pingfank@linux.vnet.ibm.com>
For pc-piix-*, hpet's intcap is always hard coded as IRQ2. While
for pc-q35-*, we resort to compat property to fix it (a later patch).
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
hw/i386/pc.c | 12 ++++++++----
hw/i386/pc_piix.c | 3 ++-
hw/i386/pc_q35.c | 2 +-
include/hw/i386/pc.h | 3 ++-
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f2b7b6c..b8e7cee 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1219,7 +1219,8 @@ static const MemoryRegionOps ioportF0_io_ops = {
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
ISADevice **floppy,
- bool no_vmport)
+ bool no_vmport,
+ bool hpet_irqs)
{
int i;
DriveInfo *fd[MAX_FD];
@@ -1249,10 +1250,13 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
/* In order to set property, here not using sysbus_try_create_simple */
hpet = qdev_try_create(NULL, "hpet");
if (hpet) {
- /* tmp fix. For compat, hard code to IRQ2 until we have correct
- * compat property and differentiate pc-iix with pc-q35
- */
qdev_prop_set_uint32(hpet, "intcap", 0x4);
+ /* For pc-piix-*, hpet's intcap is always IRQ2. While for pc-q35-*,
+ * we resort to compat property to fix it.
+ */
+ if (!hpet_irqs) {
+ qdev_prop_set_uint32(hpet, "intcap", 0x4);
+ }
qdev_init_nofail(hpet);
sysbus_mmio_map(SYS_BUS_DEVICE(hpet), 0, HPET_BASE);
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 907792b..8dcd0d6 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -180,7 +180,8 @@ static void pc_init1(QEMUMachineInitArgs *args,
pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
/* init basic PC hardware */
- pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled());
+ pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled(),
+ false);
pc_nic_init(isa_bus, pci_bus);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index ca84e1c..9e41f4a 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -181,7 +181,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
pc_register_ferr_irq(gsi[13]);
/* init basic PC hardware */
- pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, false);
+ pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, false, true);
/* connect pm stuff to lpc */
ich9_lpc_pm_init(lpc);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 9b2ddc4..9dd077f 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -134,7 +134,8 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
ISADevice **floppy,
- bool no_vmport);
+ bool no_vmport,
+ bool hpet_irqs);
void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
const char *boot_device,
--
1.8.1.4
next prev parent reply other threads:[~2013-09-12 3:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 3:25 [Qemu-devel] [PATCH v5 0/5] bugs fix for hpet Liu Ping Fan
2013-09-12 3:25 ` [Qemu-devel] [PATCH v5 1/5] hpet: inverse polarity when pin above ISA_NUM_IRQS Liu Ping Fan
2013-09-28 19:52 ` Michael S. Tsirkin
2013-09-29 3:25 ` liu ping fan
2013-09-29 4:20 ` Michael S. Tsirkin
2013-09-30 8:04 ` liu ping fan
2013-09-12 3:25 ` [Qemu-devel] [PATCH v5 2/5] hpet: entitle more irq pins for hpet Liu Ping Fan
2013-09-28 19:56 ` Michael S. Tsirkin
2013-09-29 3:49 ` liu ping fan
2013-09-29 4:15 ` Michael S. Tsirkin
2013-09-30 8:02 ` liu ping fan
2013-09-30 9:06 ` Michael S. Tsirkin
2013-09-30 9:06 ` Paolo Bonzini
2013-09-30 9:30 ` Michael S. Tsirkin
2013-09-30 15:48 ` Paolo Bonzini
2013-09-30 15:58 ` Michael S. Tsirkin
2013-10-09 3:27 ` liu ping fan
2013-10-09 7:24 ` Michael S. Tsirkin
2013-10-09 7:41 ` Paolo Bonzini
2013-10-09 8:01 ` Michael S. Tsirkin
2013-10-09 8:41 ` Paolo Bonzini
2013-09-12 3:25 ` [Qemu-devel] [PATCH v5 3/5] PC: use qdev_xx to create hpet instead of sysbus_create_xx Liu Ping Fan
2013-09-12 3:25 ` Liu Ping Fan [this message]
2013-09-12 3:25 ` [Qemu-devel] [PATCH v5 5/5] PC-1.6: add compatibility for hpet intcap on pc-q35-1.6 Liu Ping Fan
2013-09-12 6:29 ` [Qemu-devel] [PATCH v5 0/5] bugs fix for hpet Paolo Bonzini
2013-09-12 7:49 ` liu ping fan
2013-09-25 6:27 ` liu ping fan
2013-09-25 15:59 ` Paolo Bonzini
2013-09-26 15:45 ` Mike Day
2013-09-26 15:48 ` Mike Day
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=1378956318-23395-5-git-send-email-pingfank@linux.vnet.ibm.com \
--to=qemulist@gmail.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=jan.kiszka@siemens.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).