aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-09-20 00:34:26 -0400
committerGrant Likely <grant.likely@linaro.org>2013-10-24 06:50:37 -0400
commitf27446c3ad5b6d3b5b28ec0176e23d3ceca595d8 (patch)
tree3dcd528f69ad37178d7536cceb4e40d875ad9e21 /arch
parent16b84e5a505c790538e534ad8dfda9c288691e40 (diff)
microblaze/pci: Drop PowerPC-ism from irq parsing
The Microblaze PCI code copied the PowerPC irq handling, but powerpc needs to handle broken device trees that are not present on Microblaze. This patch removes the powerpc special case and replaces it with a direct of_irq_parse_and_map_pci() call. Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/pci.h2
-rw-r--r--arch/microblaze/pci/pci-common.c71
2 files changed, 1 insertions, 72 deletions
diff --git a/arch/microblaze/include/asm/pci.h b/arch/microblaze/include/asm/pci.h
index d52abb6812fa..935f9bec414a 100644
--- a/arch/microblaze/include/asm/pci.h
+++ b/arch/microblaze/include/asm/pci.h
@@ -127,8 +127,6 @@ extern void of_scan_pci_bridge(struct device_node *node,
127extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); 127extern void of_scan_bus(struct device_node *node, struct pci_bus *bus);
128extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus); 128extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus);
129 129
130extern int pci_read_irq_line(struct pci_dev *dev);
131
132extern int pci_bus_find_capability(struct pci_bus *bus, 130extern int pci_bus_find_capability(struct pci_bus *bus,
133 unsigned int devfn, int cap); 131 unsigned int devfn, int cap);
134 132
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 60b386c72c57..5060fc554aab 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -193,75 +193,6 @@ void pcibios_set_master(struct pci_dev *dev)
193} 193}
194 194
195/* 195/*
196 * Reads the interrupt pin to determine if interrupt is use by card.
197 * If the interrupt is used, then gets the interrupt line from the
198 * openfirmware and sets it in the pci_dev and pci_config line.
199 */
200int pci_read_irq_line(struct pci_dev *pci_dev)
201{
202 struct of_phandle_args oirq;
203 unsigned int virq;
204
205 /* The current device-tree that iSeries generates from the HV
206 * PCI informations doesn't contain proper interrupt routing,
207 * and all the fallback would do is print out crap, so we
208 * don't attempt to resolve the interrupts here at all, some
209 * iSeries specific fixup does it.
210 *
211 * In the long run, we will hopefully fix the generated device-tree
212 * instead.
213 */
214 pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
215
216#ifdef DEBUG
217 memset(&oirq, 0xff, sizeof(oirq));
218#endif
219 /* Try to get a mapping from the device-tree */
220 if (of_irq_parse_pci(pci_dev, &oirq)) {
221 u8 line, pin;
222
223 /* If that fails, lets fallback to what is in the config
224 * space and map that through the default controller. We
225 * also set the type to level low since that's what PCI
226 * interrupts are. If your platform does differently, then
227 * either provide a proper interrupt tree or don't use this
228 * function.
229 */
230 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
231 return -1;
232 if (pin == 0)
233 return -1;
234 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
235 line == 0xff || line == 0) {
236 return -1;
237 }
238 pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
239 line, pin);
240
241 virq = irq_create_mapping(NULL, line);
242 if (virq)
243 irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
244 } else {
245 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
246 oirq.args_count, oirq.args[0], oirq.args[1],
247 of_node_full_name(oirq.np));
248
249 virq = irq_create_of_mapping(&oirq);
250 }
251 if (!virq) {
252 pr_debug(" Failed to map !\n");
253 return -1;
254 }
255
256 pr_debug(" Mapped to linux irq %d\n", virq);
257
258 pci_dev->irq = virq;
259
260 return 0;
261}
262EXPORT_SYMBOL(pci_read_irq_line);
263
264/*
265 * Platform support for /proc/bus/pci/X/Y mmap()s, 196 * Platform support for /proc/bus/pci/X/Y mmap()s,
266 * modelled on the sparc64 implementation by Dave Miller. 197 * modelled on the sparc64 implementation by Dave Miller.
267 * -- paulus. 198 * -- paulus.
@@ -959,7 +890,7 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
959 dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET; 890 dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
960 891
961 /* Read default IRQs and fixup if necessary */ 892 /* Read default IRQs and fixup if necessary */
962 pci_read_irq_line(dev); 893 dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
963 } 894 }
964} 895}
965 896