[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 2/5] PPC: E500: PCI: Make IRQ calculation more generic
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 2/5] PPC: E500: PCI: Make IRQ calculation more generic |
Date: |
Wed, 12 Dec 2012 15:09:55 +0100 |
The IRQ line calculation is more or less hardcoded today. Instead, let's
write it as an algorithmic function that theoretically allows an arbitrary
number of PCI slots.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppce500_pci.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c
index 4cd4edc..561a776 100644
--- a/hw/ppce500_pci.c
+++ b/hw/ppce500_pci.c
@@ -253,17 +253,10 @@ static const MemoryRegionOps e500_pci_reg_ops = {
static int mpc85xx_pci_map_irq(PCIDevice *pci_dev, int irq_num)
{
- int devno = pci_dev->devfn >> 3, ret = 0;
+ int devno = pci_dev->devfn >> 3;
+ int ret;
- switch (devno) {
- /* Two PCI slot */
- case 0x11:
- case 0x12:
- ret = (irq_num + devno - 0x10) % 4;
- break;
- default:
- printf("Error:%s:unknown dev number\n", __func__);
- }
+ ret = (irq_num + devno) % 4;
pci_debug("%s: devfn %x irq %d -> %d devno:%x\n", __func__,
pci_dev->devfn, irq_num, ret, devno);
--
1.6.0.2
- [Qemu-ppc] [PATCH 5/5] PPC: E500plat: Make a lot of PCI slots available, (continued)
- [Qemu-ppc] [PATCH 5/5] PPC: E500plat: Make a lot of PCI slots available, Alexander Graf, 2012/12/12
- [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/12
- Re: [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Scott Wood, 2012/12/12
- Re: [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/12
- Re: [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Scott Wood, 2012/12/12
- Re: [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/12
- Re: [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Scott Wood, 2012/12/12
- Re: [Qemu-ppc] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Scott Wood, 2012/12/12
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 3/5] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/12
[Qemu-ppc] [PATCH 2/5] PPC: E500: PCI: Make IRQ calculation more generic,
Alexander Graf <=
[Qemu-ppc] [PATCH 1/5] PPC: E500: PCI: Make first slot qdev settable, Alexander Graf, 2012/12/12