[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 34/40] PPC: E500: PCI: Make IRQ calculation more gen
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 34/40] PPC: E500: PCI: Make IRQ calculation more generic |
Date: |
Fri, 14 Dec 2012 13:13:50 +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-devel] [PATCH 29/40] PPC: e500: Declare pci bridge as bridge, (continued)
- [Qemu-devel] [PATCH 29/40] PPC: e500: Declare pci bridge as bridge, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 13/40] mpic: Unify numbering scheme, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 40/40] pseries: Increase default NVRAM size, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 35/40] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 38/40] PPC: e500: pci: Export slot2irq calculation, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 24/40] openpic: remove irq_out, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 28/40] PPC: e500: Add MSI support, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 31/40] openpic: fix minor coding style issues, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 36/40] PPC: E500: Move PCI slot information into params, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 02/40] pseries: Use #define for XICS base irq number, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 34/40] PPC: E500: PCI: Make IRQ calculation more generic,
Alexander Graf <=
- [Qemu-devel] [PATCH 08/40] pseries: Update SLOF for NVRAM support, Alexander Graf, 2012/12/14
- Re: [Qemu-devel] [PULL 00/40] ppc patch queue 2012-12-14, Blue Swirl, 2012/12/15