aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-09-20 00:34:26 -0400
committerShawn Guo <shawn.guo@freescale.com>2014-05-16 04:19:12 -0400
commit0a911f537055e872691f8ac057eb74e9a90877b2 (patch)
tree2e53701d5f892d287236a905d10b55dbdf8465c6
parent0a60ddc194485aa16a810d80a38a2ca1c557f3b9 (diff)
ENGR00313685-8 microblaze/pci: Drop PowerPC-ism from irq parsing
commit f27446c3ad5b6d3b5b28ec0176e23d3ceca595d8 upstream. 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> Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
-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