]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
microblaze: Cleanup PCI_DRAM_OFFSET handling
authorMichal Simek <michal.simek@xilinx.com>
Fri, 16 May 2014 11:37:02 +0000 (13:37 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 9 Sep 2014 09:53:43 +0000 (11:53 +0200)
PCI_DRAM_OFFSET/pci_dram_offset is 0 all the time and there
is no difference for PCI and !PCI cases.
Also remove the whole code which setup archdata.dma_data
which is completely unused.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/include/asm/device.h
arch/microblaze/include/asm/io.h
arch/microblaze/kernel/dma.c
arch/microblaze/pci/pci-common.c

index 123b2fe72d01f93a82076a87548e1050bead7d07..eb639b479c7b0e72680a14c6a2abcd0ed6ea3c6a 100644 (file)
@@ -14,7 +14,6 @@ struct device_node;
 struct dev_archdata {
        /* DMA operations on that device */
        struct dma_map_ops      *dma_ops;
-       void                    *dma_data;
 };
 
 struct pdev_archdata {
index 1e4c3329f62e5b7be40c1cfe79a565a8d66b77fb..433751b2a003309bb2a449888ac5b48f6f747d3c 100644 (file)
 #ifndef CONFIG_PCI
 #define _IO_BASE       0
 #define _ISA_MEM_BASE  0
-#define PCI_DRAM_OFFSET        0
 #else
 #define _IO_BASE       isa_io_base
 #define _ISA_MEM_BASE  isa_mem_base
-#define PCI_DRAM_OFFSET        pci_dram_offset
 struct pci_dev;
 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
 #define pci_iounmap pci_iounmap
 
 extern unsigned long isa_io_base;
-extern unsigned long pci_dram_offset;
 extern resource_size_t isa_mem_base;
 #endif
 
index da68d00fd087e74d4de4286cd3150c97395d9511..8f9b99508e797055f25edf180942dd6f55f455ea 100644 (file)
 #include <linux/export.h>
 #include <linux/bug.h>
 
-/*
- * Generic direct DMA implementation
- *
- * This implementation supports a per-device offset that can be applied if
- * the address at which memory is visible to devices is not 0. Platform code
- * can set archdata.dma_data to an unsigned long holding the offset. By
- * default the offset is PCI_DRAM_OFFSET.
- */
-
-static unsigned long get_dma_direct_offset(struct device *dev)
-{
-       if (likely(dev))
-               return (unsigned long)dev->archdata.dma_data;
-
-       return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */
-}
-
 #define NOT_COHERENT_CACHE
 
 static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
@@ -51,7 +34,7 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
                return NULL;
        ret = page_address(page);
        memset(ret, 0, size);
-       *dma_handle = virt_to_phys(ret) + get_dma_direct_offset(dev);
+       *dma_handle = virt_to_phys(ret);
 
        return ret;
 #endif
@@ -77,7 +60,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
 
        /* FIXME this part of code is untested */
        for_each_sg(sgl, sg, nents, i) {
-               sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
+               sg->dma_address = sg_phys(sg);
                __dma_sync(page_to_phys(sg_page(sg)) + sg->offset,
                                                        sg->length, direction);
        }
@@ -104,7 +87,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev,
                                             struct dma_attrs *attrs)
 {
        __dma_sync(page_to_phys(page) + offset, size, direction);
-       return page_to_phys(page) + offset + get_dma_direct_offset(dev);
+       return page_to_phys(page) + offset;
 }
 
 static inline void dma_direct_unmap_page(struct device *dev,
index 5eb3b3a27b4e27499b5e7d35bcd987184889c3c8..11d5a7c319fde0409a829d4bbe3cde1fd23229a6 100644 (file)
@@ -48,7 +48,6 @@ static int global_phb_number;         /* Global phb counter */
 resource_size_t isa_mem_base;
 
 unsigned long isa_io_base;
-unsigned long pci_dram_offset;
 static int pci_bus_count;
 
 struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
@@ -872,8 +871,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
                 */
                set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
 
-               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);
        }