[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/9] PPC: Make interrupts work
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 5/9] PPC: Make interrupts work |
Date: |
Tue, 12 Jan 2010 12:58:42 +0100 |
The interrupt code as is didn't really work for me. I couldn't even convince
Linux to take interrupt 9 in an interrupt-map.
So let's do this right. Let's map all PCI interrupts to 0x1b - 0x1e. That way
we're at least a small step closer to what real hardware does.
I also took the interrupt pin to line conversion from OpenBIOS, which at least
assures us we're compatible with our firmware :-).
A dump of the PCI interrupt-map from a U2 (iBook):
00009000 00000000 00000000 00000000 ff97c528 00000034 00000001
0000d800 00000000 00000000 00000000 ff97c528 0000003f 00000001
0000c000 00000000 00000000 00000000 ff97c528 0000001b 00000001
0000c800 00000000 00000000 00000000 ff97c528 0000001c 00000001
0000d000 00000000 00000000 00000000 ff97c528 0000001d 00000001
Signed-off-by: Alexander Graf <address@hidden>
---
hw/unin_pci.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/hw/unin_pci.c b/hw/unin_pci.c
index 1e32d63..ca980ec 100644
--- a/hw/unin_pci.c
+++ b/hw/unin_pci.c
@@ -36,22 +36,30 @@
#define UNIN_DPRINTF(fmt, ...)
#endif
+static const int unin_irq_line[] = { 0x1b, 0x1c, 0x1d, 0x1e };
+
typedef struct UNINState {
SysBusDevice busdev;
PCIHostState host_state;
} UNINState;
-/* Don't know if this matches real hardware, but it agrees with OHW. */
static int pci_unin_map_irq(PCIDevice *pci_dev, int irq_num)
{
- return (irq_num + (pci_dev->devfn >> 3)) & 3;
+ int retval;
+ int devfn = pci_dev->devfn & 0x00FFFFFF;
+
+ retval = (((devfn >> 11) & 0x1F) + irq_num) & 3;
+
+ return retval;
}
static void pci_unin_set_irq(void *opaque, int irq_num, int level)
{
qemu_irq *pic = opaque;
- qemu_set_irq(pic[irq_num + 8], level);
+ UNIN_DPRINTF("%s: setting INT %d = %d\n", __func__,
+ unin_irq_line[irq_num], level);
+ qemu_set_irq(pic[unin_irq_line[irq_num]], level);
}
static void pci_unin_save(QEMUFile* f, void *opaque)
--
1.6.0.2
- [Qemu-devel] [PATCH 8/9] PPC: Get rid of segfaults in DBDMA emulation, (continued)
- [Qemu-devel] [PATCH 8/9] PPC: Get rid of segfaults in DBDMA emulation, Alexander Graf, 2010/01/12
- [Qemu-devel] [PATCH 1/9] PCI: PCI config space access overhaul, Alexander Graf, 2010/01/12
- [Qemu-devel] [PATCH 4/9] PPC: Include dump of lspci -nn on real G5, Alexander Graf, 2010/01/12
- [Qemu-devel] [PATCH 9/9] PPC: Add USB per default on U3, Alexander Graf, 2010/01/12
- [Qemu-devel] [PATCH 5/9] PPC: Make interrupts work,
Alexander Graf <=
- [Qemu-devel] [PATCH 3/9] PPC: Use Mac99_U3 type on ppc64, Alexander Graf, 2010/01/12
- [Qemu-devel] [PATCH 2/9] PPC: Add config space conversion function for uni_north, Alexander Graf, 2010/01/12
- [Qemu-devel] [PATCH 7/9] PPC: Use macio IDE controller for Newworld, Alexander Graf, 2010/01/12
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Blue Swirl, 2010/01/12
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Alexander Graf, 2010/01/12
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Blue Swirl, 2010/01/12
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Alexander Graf, 2010/01/12
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Blue Swirl, 2010/01/13
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Alexander Graf, 2010/01/13
- Re: [Qemu-devel] [PATCH 0/9] PPC NewWorld fixery v3, Blue Swirl, 2010/01/13