aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2014-05-16 07:37:02 -0400
committerMichal Simek <michal.simek@xilinx.com>2014-06-04 00:59:57 -0400
commit193bca5934db1ca1d0ffcedf551030ff5556a07c (patch)
treee5ae4908176bd9b26f1b73407892d9b64be12410 /arch/microblaze/kernel
parent28d1880c6872af3d1c17bc46da5795b9eba04bee (diff)
microblaze: Cleanup PCI_DRAM_OFFSET handling
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>
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r--arch/microblaze/kernel/dma.c23
1 files changed, 3 insertions, 20 deletions
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,