Merge tag 'renesas-boards-cleanups2-for-v3.19' of git://git.kernel.org/pub/scm/linux...
[firefly-linux-kernel-4.4.55.git] / arch / microblaze / pci / pci-common.c
index 70996cc66aa228c688d298ade87fd31c5cedaaac..b30e41c0c0335cf2ab79e716c9c41c0ebced18e8 100644 (file)
@@ -47,24 +47,9 @@ static int global_phb_number;                /* Global phb counter */
 /* ISA Memory physical address */
 resource_size_t isa_mem_base;
 
-static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
-
 unsigned long isa_io_base;
-unsigned long pci_dram_offset;
 static int pci_bus_count;
 
-
-void set_pci_dma_ops(struct dma_map_ops *dma_ops)
-{
-       pci_dma_ops = dma_ops;
-}
-
-struct dma_map_ops *get_pci_dma_ops(void)
-{
-       return pci_dma_ops;
-}
-EXPORT_SYMBOL(get_pci_dma_ops);
-
 struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
 {
        struct pci_controller *phb;
@@ -168,26 +153,6 @@ struct pci_controller *pci_find_hose_for_OF_device(struct device_node *node)
        return NULL;
 }
 
-static ssize_t pci_show_devspec(struct device *dev,
-               struct device_attribute *attr, char *buf)
-{
-       struct pci_dev *pdev;
-       struct device_node *np;
-
-       pdev = to_pci_dev(dev);
-       np = pci_device_to_OF_node(pdev);
-       if (np == NULL || np->full_name == NULL)
-               return 0;
-       return sprintf(buf, "%s", np->full_name);
-}
-static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL);
-
-/* Add sysfs properties */
-int pcibios_add_platform_entries(struct pci_dev *pdev)
-{
-       return device_create_file(&pdev->dev, &dev_attr_devspec);
-}
-
 void pcibios_set_master(struct pci_dev *dev)
 {
        /* No special bus mastering setup handling */
@@ -695,8 +660,13 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose,
                        res = &hose->mem_resources[memno++];
                        break;
                }
-               if (res != NULL)
-                       of_pci_range_to_resource(&range, dev, res);
+               if (res != NULL) {
+                       res->name = dev->full_name;
+                       res->flags = range.flags;
+                       res->start = range.cpu_addr;
+                       res->end = range.cpu_addr + range.size - 1;
+                       res->parent = res->child = res->sibling = NULL;
+               }
        }
 
        /* If there's an ISA hole and the pci_mem_offset is -not- matching
@@ -886,10 +856,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
                 */
                set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
 
-               /* Hook up default DMA ops */
-               set_dma_ops(&dev->dev, pci_dma_ops);
-               dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
-
                /* Read default IRQs and fixup if necessary */
                dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
        }