0036-MIPS-ath79-remove-irq-code-from-pci.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. --- a/arch/mips/pci/pci-ar71xx.c
  2. +++ b/arch/mips/pci/pci-ar71xx.c
  3. @@ -54,11 +54,9 @@
  4. struct ar71xx_pci_controller {
  5. struct device_node *np;
  6. void __iomem *cfg_base;
  7. - int irq;
  8. struct pci_controller pci_ctrl;
  9. struct resource io_res;
  10. struct resource mem_res;
  11. - struct irq_domain *domain;
  12. };
  13. /* Byte lane enable bits */
  14. @@ -230,104 +228,6 @@ static struct pci_ops ar71xx_pci_ops = {
  15. .write = ar71xx_pci_write_config,
  16. };
  17. -static void ar71xx_pci_irq_handler(struct irq_desc *desc)
  18. -{
  19. - void __iomem *base = ath79_reset_base;
  20. - struct irq_chip *chip = irq_desc_get_chip(desc);
  21. - struct ar71xx_pci_controller *apc = irq_desc_get_handler_data(desc);
  22. - u32 pending;
  23. -
  24. - chained_irq_enter(chip, desc);
  25. - pending = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_STATUS) &
  26. - __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  27. -
  28. - if (pending & AR71XX_PCI_INT_DEV0)
  29. - generic_handle_irq(irq_linear_revmap(apc->domain, 1));
  30. -
  31. - else if (pending & AR71XX_PCI_INT_DEV1)
  32. - generic_handle_irq(irq_linear_revmap(apc->domain, 2));
  33. -
  34. - else if (pending & AR71XX_PCI_INT_DEV2)
  35. - generic_handle_irq(irq_linear_revmap(apc->domain, 3));
  36. -
  37. - else if (pending & AR71XX_PCI_INT_CORE)
  38. - generic_handle_irq(irq_linear_revmap(apc->domain, 4));
  39. -
  40. - else
  41. - spurious_interrupt();
  42. - chained_irq_exit(chip, desc);
  43. -}
  44. -
  45. -static void ar71xx_pci_irq_unmask(struct irq_data *d)
  46. -{
  47. - struct ar71xx_pci_controller *apc;
  48. - unsigned int irq;
  49. - void __iomem *base = ath79_reset_base;
  50. - u32 t;
  51. -
  52. - apc = irq_data_get_irq_chip_data(d);
  53. - irq = irq_linear_revmap(apc->domain, d->irq);
  54. -
  55. - t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  56. - __raw_writel(t | (1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  57. -
  58. - /* flush write */
  59. - __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  60. -}
  61. -
  62. -static void ar71xx_pci_irq_mask(struct irq_data *d)
  63. -{
  64. - struct ar71xx_pci_controller *apc;
  65. - unsigned int irq;
  66. - void __iomem *base = ath79_reset_base;
  67. - u32 t;
  68. -
  69. - apc = irq_data_get_irq_chip_data(d);
  70. - irq = irq_linear_revmap(apc->domain, d->irq);
  71. -
  72. - t = __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  73. - __raw_writel(t & ~(1 << irq), base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  74. -
  75. - /* flush write */
  76. - __raw_readl(base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  77. -}
  78. -
  79. -static struct irq_chip ar71xx_pci_irq_chip = {
  80. - .name = "AR71XX PCI",
  81. - .irq_mask = ar71xx_pci_irq_mask,
  82. - .irq_unmask = ar71xx_pci_irq_unmask,
  83. - .irq_mask_ack = ar71xx_pci_irq_mask,
  84. -};
  85. -
  86. -static int ar71xx_pci_irq_map(struct irq_domain *d,
  87. - unsigned int irq, irq_hw_number_t hw)
  88. -{
  89. - struct ar71xx_pci_controller *apc = d->host_data;
  90. -
  91. - irq_set_chip_and_handler(irq, &ar71xx_pci_irq_chip, handle_level_irq);
  92. - irq_set_chip_data(irq, apc);
  93. -
  94. - return 0;
  95. -}
  96. -
  97. -static const struct irq_domain_ops ar71xx_pci_domain_ops = {
  98. - .xlate = irq_domain_xlate_onecell,
  99. - .map = ar71xx_pci_irq_map,
  100. -};
  101. -
  102. -static void ar71xx_pci_irq_init(struct ar71xx_pci_controller *apc)
  103. -{
  104. - void __iomem *base = ath79_reset_base;
  105. -
  106. - __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_ENABLE);
  107. - __raw_writel(0, base + AR71XX_RESET_REG_PCI_INT_STATUS);
  108. -
  109. - apc->domain = irq_domain_add_linear(apc->np, AR71XX_PCI_IRQ_COUNT,
  110. - &ar71xx_pci_domain_ops, apc);
  111. - irq_set_chained_handler_and_data(apc->irq, ar71xx_pci_irq_handler,
  112. - apc);
  113. -}
  114. -
  115. static void ar71xx_pci_reset(void)
  116. {
  117. ath79_device_reset_set(AR71XX_RESET_PCI_BUS | AR71XX_RESET_PCI_CORE);
  118. @@ -361,10 +261,6 @@ static int ar71xx_pci_probe(struct platf
  119. if (IS_ERR(apc->cfg_base))
  120. return PTR_ERR(apc->cfg_base);
  121. - apc->irq = platform_get_irq(pdev, 0);
  122. - if (apc->irq < 0)
  123. - return -EINVAL;
  124. -
  125. ar71xx_pci_reset();
  126. /* setup COMMAND register */
  127. @@ -375,8 +271,6 @@ static int ar71xx_pci_probe(struct platf
  128. /* clear bus errors */
  129. ar71xx_pci_check_error(apc, 1);
  130. - ar71xx_pci_irq_init(apc);
  131. -
  132. apc->np = pdev->dev.of_node;
  133. apc->pci_ctrl.pci_ops = &ar71xx_pci_ops;
  134. apc->pci_ctrl.mem_resource = &apc->mem_res;