aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 91f56691cfa1..4ea0a44b3602 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.
@@ -989,7 +920,7 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
989 dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET; 920 dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
990 921
991 /* Read default IRQs and fixup if necessary */ 922 /* Read default IRQs and fixup if necessary */
992 pci_read_irq_line(dev); 923 dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
993 } 924 }
994} 925}
995 926