1 --- a/arch/arm/mach-cns3xxx/pcie.c
2 +++ b/arch/arm/mach-cns3xxx/pcie.c
5 #include <linux/ioport.h>
6 #include <linux/interrupt.h>
7 +#include <linux/irq.h>
8 #include <linux/ptrace.h>
9 #include <asm/mach/map.h>
11 @@ -27,7 +28,7 @@ struct cns3xxx_pcie {
12 void __iomem *host_regs; /* PCI config registers for host bridge */
13 void __iomem *cfg0_regs; /* PCI Type 0 config registers */
14 void __iomem *cfg1_regs; /* PCI Type 1 config registers */
15 - unsigned int irqs[2];
16 + unsigned int irqs[5];
17 struct resource res_io;
18 struct resource res_mem;
20 @@ -95,7 +96,7 @@ static inline int check_master_abort(str
21 void __iomem *host_base;
24 - host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
25 + host_base = (void __iomem *) cnspci->host_regs;
26 sreg = __raw_readw(host_base + 0x6) & 0xF900;
27 ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
29 @@ -209,7 +210,7 @@ static struct pci_ops cns3xxx_pcie_ops =
30 static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
32 struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
33 - int irq = cnspci->irqs[!!dev->bus->number];
34 + int irq = cnspci->irqs[!!dev->bus->number + pin - 1];
36 pr_info("PCIe map irq: %04d:%02x:%02x.%02x slot %d, pin %d, irq: %d\n",
37 pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn),
38 @@ -235,7 +236,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
39 .end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */
40 .flags = IORESOURCE_MEM,
42 - .irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
44 + IRQ_CNS3XXX_PCIE0_RC,
45 + IRQ_CNS3XXX_PCIE0_DEVICE,
46 + IRQ_CNS3XXX_PCIE0_DEVICE,
47 + IRQ_CNS3XXX_PCIE0_DEVICE,
48 + IRQ_CNS3XXX_PCIE0_DEVICE,
53 @@ -254,7 +261,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
54 .end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */
55 .flags = IORESOURCE_MEM,
57 - .irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
59 + IRQ_CNS3XXX_PCIE1_RC,
60 + IRQ_CNS3XXX_PCIE1_DEVICE,
61 + IRQ_CNS3XXX_PCIE1_DEVICE,
62 + IRQ_CNS3XXX_PCIE1_DEVICE,
63 + IRQ_CNS3XXX_PCIE1_DEVICE,
68 @@ -346,6 +359,14 @@ static int cns3xxx_pcie_abort_handler(un
72 +void __init cns3xxx_pcie_set_irqs(int bus, int *irqs)
76 + for (i = 0; i < 4; i++)
77 + cns3xxx_pcie[bus].irqs[i + 1] = irqs[i];
80 void __init cns3xxx_pcie_init_late(void)
83 --- a/arch/arm/mach-cns3xxx/core.h
84 +++ b/arch/arm/mach-cns3xxx/core.h
85 @@ -18,8 +18,10 @@ extern void cns3xxx_timer_init(void);
88 extern void __init cns3xxx_pcie_init_late(void);
89 +extern void __init cns3xxx_pcie_set_irqs(int bus, int *irqs);
91 static inline void __init cns3xxx_pcie_init_late(void) {}
92 +static inline void cns3xxx_pcie_set_irqs(int bus, int *irqs) {}
95 void __init cns3xxx_map_io(void);