[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 1/4] hpet: inverse polarity when pin above ISA_NU
From: |
Liu Ping Fan |
Subject: |
[Qemu-devel] [PATCH v7 1/4] hpet: inverse polarity when pin above ISA_NUM_IRQS |
Date: |
Thu, 17 Oct 2013 11:16:02 +0800 |
According to hpet spec, hpet irq is high active. But according to
ICH spec, there is inversion before the input of ioapic. So the OS
will expect low active on this IRQ line. (On bare metal, if OS driver
claims high active on this line, spurious irq is generated)
We fold the emulation of this inversion inside the hpet logic.
Signed-off-by: Liu Ping Fan <address@hidden>
---
hw/timer/hpet.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index fcd22ae..8429eb3 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -198,13 +198,23 @@ static void update_irq(struct HPETTimer *timer, int set)
if (!set || !timer_enabled(timer) || !hpet_enabled(timer->state)) {
s->isr &= ~mask;
if (!timer_fsb_route(timer)) {
- qemu_irq_lower(s->irqs[route]);
+ /* fold the ICH PIRQ# pin's internal inversion logic into hpet */
+ if (route >= ISA_NUM_IRQS) {
+ qemu_irq_raise(s->irqs[route]);
+ } else {
+ qemu_irq_lower(s->irqs[route]);
+ }
}
} else if (timer_fsb_route(timer)) {
stl_le_phys(timer->fsb >> 32, timer->fsb & 0xffffffff);
} else if (timer->config & HPET_TN_TYPE_LEVEL) {
s->isr |= mask;
- qemu_irq_raise(s->irqs[route]);
+ /* fold the ICH PIRQ# pin's internal inversion logic into hpet */
+ if (route >= ISA_NUM_IRQS) {
+ qemu_irq_lower(s->irqs[route]);
+ } else {
+ qemu_irq_raise(s->irqs[route]);
+ }
} else {
s->isr &= ~mask;
qemu_irq_pulse(s->irqs[route]);
--
1.8.1.4
- [Qemu-devel] [PATCH v7 0/4] bugs fix for hpet, Liu Ping Fan, 2013/10/16
- [Qemu-devel] [PATCH v7 1/4] hpet: inverse polarity when pin above ISA_NUM_IRQS,
Liu Ping Fan <=
- [Qemu-devel] [PATCH v7 2/4] hpet: enable to entitle more irq pins for hpet, Liu Ping Fan, 2013/10/16
- [Qemu-devel] [PATCH v7 3/4] PC: use qdev_xx to create hpet instead of sysbus_create_xx, Liu Ping Fan, 2013/10/16
- [Qemu-devel] [PATCH v7 4/4] PC: differentiate hpet's interrupt capability on piix and q35, Liu Ping Fan, 2013/10/16
- Re: [Qemu-devel] [PATCH v7 4/4] PC: differentiate hpet's interrupt capability on piix and q35, Paolo Bonzini, 2013/10/17
- Re: [Qemu-devel] [PATCH v7 4/4] PC: differentiate hpet's interrupt capability on piix and q35, Paolo Bonzini, 2013/10/17
- Re: [Qemu-devel] [PATCH v7 0/4] bugs fix for hpet, Michael S. Tsirkin, 2013/10/17