aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/microblaze/include/asm/device.h1
-rw-r--r--arch/microblaze/include/asm/io.h3
-rw-r--r--arch/microblaze/kernel/dma.c23
-rw-r--r--arch/microblaze/pci/pci-common.c3
4 files changed, 3 insertions, 27 deletions
diff --git a/arch/microblaze/include/asm/device.h b/arch/microblaze/include/asm/device.h
index 123b2fe72d01..eb639b479c7b 100644
--- a/arch/microblaze/include/asm/device.h
+++ b/arch/microblaze/include/asm/device.h
@@ -14,7 +14,6 @@ struct device_node;
14struct dev_archdata { 14struct dev_archdata {
15 /* DMA operations on that device */ 15 /* DMA operations on that device */
16 struct dma_map_ops *dma_ops; 16 struct dma_map_ops *dma_ops;
17 void *dma_data;
18}; 17};
19 18
20struct pdev_archdata { 19struct pdev_archdata {
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 1e4c3329f62e..433751b2a003 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -19,17 +19,14 @@
19#ifndef CONFIG_PCI 19#ifndef CONFIG_PCI
20#define _IO_BASE 0 20#define _IO_BASE 0
21#define _ISA_MEM_BASE 0 21#define _ISA_MEM_BASE 0
22#define PCI_DRAM_OFFSET 0
23#else 22#else
24#define _IO_BASE isa_io_base 23#define _IO_BASE isa_io_base
25#define _ISA_MEM_BASE isa_mem_base 24#define _ISA_MEM_BASE isa_mem_base
26#define PCI_DRAM_OFFSET pci_dram_offset
27struct pci_dev; 25struct pci_dev;
28extern void pci_iounmap(struct pci_dev *dev, void __iomem *); 26extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
29#define pci_iounmap pci_iounmap 27#define pci_iounmap pci_iounmap
30 28
31extern unsigned long isa_io_base; 29extern unsigned long isa_io_base;
32extern unsigned long pci_dram_offset;
33extern resource_size_t isa_mem_base; 30extern resource_size_t isa_mem_base;
34#endif 31#endif
35 32
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
index da68d00fd087..8f9b99508e79 100644
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -13,23 +13,6 @@
13#include <linux/export.h> 13#include <linux/export.h>
14#include <linux/bug.h> 14#include <linux/bug.h>
15 15
16/*
17 * Generic direct DMA implementation
18 *
19 * This implementation supports a per-device offset that can be applied if
20 * the address at which memory is visible to devices is not 0. Platform code
21 * can set archdata.dma_data to an unsigned long holding the offset. By
22 * default the offset is PCI_DRAM_OFFSET.
23 */
24
25static unsigned long get_dma_direct_offset(struct device *dev)
26{
27 if (likely(dev))
28 return (unsigned long)dev->archdata.dma_data;
29
30 return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */
31}
32
33#define NOT_COHERENT_CACHE 16#define NOT_COHERENT_CACHE
34 17
35static void *dma_direct_alloc_coherent(struct device *dev, size_t size, 18static 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,
51 return NULL; 34 return NULL;
52 ret = page_address(page); 35 ret = page_address(page);
53 memset(ret, 0, size); 36 memset(ret, 0, size);
54 *dma_handle = virt_to_phys(ret) + get_dma_direct_offset(dev); 37 *dma_handle = virt_to_phys(ret);
55 38
56 return ret; 39 return ret;
57#endif 40#endif
@@ -77,7 +60,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl,
77 60
78 /* FIXME this part of code is untested */ 61 /* FIXME this part of code is untested */
79 for_each_sg(sgl, sg, nents, i) { 62 for_each_sg(sgl, sg, nents, i) {
80 sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev); 63 sg->dma_address = sg_phys(sg);
81 __dma_sync(page_to_phys(sg_page(sg)) + sg->offset, 64 __dma_sync(page_to_phys(sg_page(sg)) + sg->offset,
82 sg->length, direction); 65 sg->length, direction);
83 } 66 }
@@ -104,7 +87,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev,
104 struct dma_attrs *attrs) 87 struct dma_attrs *attrs)
105{ 88{
106 __dma_sync(page_to_phys(page) + offset, size, direction); 89 __dma_sync(page_to_phys(page) + offset, size, direction);
107 return page_to_phys(page) + offset + get_dma_direct_offset(dev); 90 return page_to_phys(page) + offset;
108} 91}
109 92
110static inline void dma_direct_unmap_page(struct device *dev, 93static inline void dma_direct_unmap_page(struct device *dev,
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 99ac12ad4b9b..2cf412f4db4e 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -48,7 +48,6 @@ static int global_phb_number; /* Global phb counter */
48resource_size_t isa_mem_base; 48resource_size_t isa_mem_base;
49 49
50unsigned long isa_io_base; 50unsigned long isa_io_base;
51unsigned long pci_dram_offset;
52static int pci_bus_count; 51static int pci_bus_count;
53 52
54struct pci_controller *pcibios_alloc_controller(struct device_node *dev) 53struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
@@ -872,8 +871,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
872 */ 871 */
873 set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); 872 set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
874 873
875 dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
876
877 /* Read default IRQs and fixup if necessary */ 874 /* Read default IRQs and fixup if necessary */
878 dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); 875 dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
879 } 876 }