diff options
author | Rob Herring <rob.herring@calxeda.com> | 2013-11-07 11:34:46 -0500 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2013-11-07 11:34:46 -0500 |
commit | b5480950c6cbb7b07ab1c1a5af0dc661a1cb6f24 (patch) | |
tree | b5fcb00387a838beb2bcf2f8ed2fd3d6d460c8ae /arch/microblaze | |
parent | e363bbac316ffb5daaf45d855f82680148cafe20 (diff) | |
parent | 355e62f5ad12b005c862838156262eb2df2f8dff (diff) |
Merge remote-tracking branch 'grant/devicetree/next' into for-next
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/include/asm/pci.h | 2 | ||||
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 72 |
2 files changed, 1 insertions, 73 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, | |||
127 | extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); | 127 | extern void of_scan_bus(struct device_node *node, struct pci_bus *bus); |
128 | extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus); | 128 | extern void of_rescan_bus(struct device_node *node, struct pci_bus *bus); |
129 | 129 | ||
130 | extern int pci_read_irq_line(struct pci_dev *dev); | ||
131 | |||
132 | extern int pci_bus_find_capability(struct pci_bus *bus, | 130 | extern 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 7c8a35238f74..66804adcacf0 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -194,76 +194,6 @@ void pcibios_set_master(struct pci_dev *dev) | |||
194 | } | 194 | } |
195 | 195 | ||
196 | /* | 196 | /* |
197 | * Reads the interrupt pin to determine if interrupt is use by card. | ||
198 | * If the interrupt is used, then gets the interrupt line from the | ||
199 | * openfirmware and sets it in the pci_dev and pci_config line. | ||
200 | */ | ||
201 | int pci_read_irq_line(struct pci_dev *pci_dev) | ||
202 | { | ||
203 | struct of_irq oirq; | ||
204 | unsigned int virq; | ||
205 | |||
206 | /* The current device-tree that iSeries generates from the HV | ||
207 | * PCI informations doesn't contain proper interrupt routing, | ||
208 | * and all the fallback would do is print out crap, so we | ||
209 | * don't attempt to resolve the interrupts here at all, some | ||
210 | * iSeries specific fixup does it. | ||
211 | * | ||
212 | * In the long run, we will hopefully fix the generated device-tree | ||
213 | * instead. | ||
214 | */ | ||
215 | pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev)); | ||
216 | |||
217 | #ifdef DEBUG | ||
218 | memset(&oirq, 0xff, sizeof(oirq)); | ||
219 | #endif | ||
220 | /* Try to get a mapping from the device-tree */ | ||
221 | if (of_irq_map_pci(pci_dev, &oirq)) { | ||
222 | u8 line, pin; | ||
223 | |||
224 | /* If that fails, lets fallback to what is in the config | ||
225 | * space and map that through the default controller. We | ||
226 | * also set the type to level low since that's what PCI | ||
227 | * interrupts are. If your platform does differently, then | ||
228 | * either provide a proper interrupt tree or don't use this | ||
229 | * function. | ||
230 | */ | ||
231 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) | ||
232 | return -1; | ||
233 | if (pin == 0) | ||
234 | return -1; | ||
235 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || | ||
236 | line == 0xff || line == 0) { | ||
237 | return -1; | ||
238 | } | ||
239 | pr_debug(" No map ! Using line %d (pin %d) from PCI config\n", | ||
240 | line, pin); | ||
241 | |||
242 | virq = irq_create_mapping(NULL, line); | ||
243 | if (virq) | ||
244 | irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | ||
245 | } else { | ||
246 | pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n", | ||
247 | oirq.size, oirq.specifier[0], oirq.specifier[1], | ||
248 | of_node_full_name(oirq.controller)); | ||
249 | |||
250 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, | ||
251 | oirq.size); | ||
252 | } | ||
253 | if (!virq) { | ||
254 | pr_debug(" Failed to map !\n"); | ||
255 | return -1; | ||
256 | } | ||
257 | |||
258 | pr_debug(" Mapped to linux irq %d\n", virq); | ||
259 | |||
260 | pci_dev->irq = virq; | ||
261 | |||
262 | return 0; | ||
263 | } | ||
264 | EXPORT_SYMBOL(pci_read_irq_line); | ||
265 | |||
266 | /* | ||
267 | * Platform support for /proc/bus/pci/X/Y mmap()s, | 197 | * Platform support for /proc/bus/pci/X/Y mmap()s, |
268 | * modelled on the sparc64 implementation by Dave Miller. | 198 | * modelled on the sparc64 implementation by Dave Miller. |
269 | * -- paulus. | 199 | * -- paulus. |
@@ -961,7 +891,7 @@ void pcibios_setup_bus_devices(struct pci_bus *bus) | |||
961 | dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET; | 891 | dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET; |
962 | 892 | ||
963 | /* Read default IRQs and fixup if necessary */ | 893 | /* Read default IRQs and fixup if necessary */ |
964 | pci_read_irq_line(dev); | 894 | dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); |
965 | } | 895 | } |
966 | } | 896 | } |
967 | 897 | ||