110-pci_isolated_interrupts.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. --- a/arch/arm/mach-cns3xxx/pcie.c
  2. +++ b/arch/arm/mach-cns3xxx/pcie.c
  3. @@ -18,6 +18,7 @@
  4. #include <linux/io.h>
  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>
  10. #include "cns3xxx.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;
  19. int port;
  20. @@ -95,7 +96,7 @@ static inline int check_master_abort(str
  21. void __iomem *host_base;
  22. u32 sreg, ereg;
  23. - host_base = (void __iomem *) cnspci->cfg_bases[CNS3XXX_HOST_TYPE].virtual;
  24. + host_base = (void __iomem *) cnspci->host_regs;
  25. sreg = __raw_readw(host_base + 0x6) & 0xF900;
  26. ereg = __raw_readl(host_base + 0x104); // Uncorrectable Error Status Reg
  27. @@ -209,7 +210,7 @@ static struct pci_ops cns3xxx_pcie_ops =
  28. static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  29. {
  30. struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
  31. - int irq = cnspci->irqs[!!dev->bus->number];
  32. + int irq = cnspci->irqs[!!dev->bus->number + pin - 1];
  33. pr_info("PCIe map irq: %04d:%02x:%02x.%02x slot %d, pin %d, irq: %d\n",
  34. pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn),
  35. @@ -235,7 +236,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
  36. .end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */
  37. .flags = IORESOURCE_MEM,
  38. },
  39. - .irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
  40. + .irqs = {
  41. + IRQ_CNS3XXX_PCIE0_RC,
  42. + IRQ_CNS3XXX_PCIE0_DEVICE,
  43. + IRQ_CNS3XXX_PCIE0_DEVICE,
  44. + IRQ_CNS3XXX_PCIE0_DEVICE,
  45. + IRQ_CNS3XXX_PCIE0_DEVICE,
  46. + },
  47. .port = 0,
  48. },
  49. [1] = {
  50. @@ -254,7 +261,13 @@ static struct cns3xxx_pcie cns3xxx_pcie[
  51. .end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */
  52. .flags = IORESOURCE_MEM,
  53. },
  54. - .irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
  55. + .irqs = {
  56. + IRQ_CNS3XXX_PCIE1_RC,
  57. + IRQ_CNS3XXX_PCIE1_DEVICE,
  58. + IRQ_CNS3XXX_PCIE1_DEVICE,
  59. + IRQ_CNS3XXX_PCIE1_DEVICE,
  60. + IRQ_CNS3XXX_PCIE1_DEVICE,
  61. + },
  62. .port = 1,
  63. },
  64. };
  65. @@ -346,6 +359,14 @@ static int cns3xxx_pcie_abort_handler(un
  66. return 0;
  67. }
  68. +void __init cns3xxx_pcie_set_irqs(int bus, int *irqs)
  69. +{
  70. + int i;
  71. +
  72. + for (i = 0; i < 4; i++)
  73. + cns3xxx_pcie[bus].irqs[i + 1] = irqs[i];
  74. +}
  75. +
  76. void __init cns3xxx_pcie_init_late(void)
  77. {
  78. int i;
  79. --- a/arch/arm/mach-cns3xxx/core.h
  80. +++ b/arch/arm/mach-cns3xxx/core.h
  81. @@ -18,8 +18,10 @@ extern void cns3xxx_timer_init(void);
  82. #ifdef CONFIG_PCI
  83. extern void __init cns3xxx_pcie_init_late(void);
  84. +extern void __init cns3xxx_pcie_set_irqs(int bus, int *irqs);
  85. #else
  86. static inline void __init cns3xxx_pcie_init_late(void) {}
  87. +static inline void cns3xxx_pcie_set_irqs(int bus, int *irqs) {}
  88. #endif
  89. void __init cns3xxx_map_io(void);