aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/Kconfig1
-rw-r--r--arch/mips/include/asm/dma-mapping.h11
-rw-r--r--arch/mips/mm/dma-default.c7
3 files changed, 9 insertions, 10 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 03bd56a2fb6e..1aad0d9f5074 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1,6 +1,7 @@
1config MIPS 1config MIPS
2 bool 2 bool
3 default y 3 default y
4 select HAVE_GENERIC_DMA_COHERENT
4 select HAVE_IDE 5 select HAVE_IDE
5 select HAVE_OPROFILE 6 select HAVE_OPROFILE
6 select HAVE_ARCH_KGDB 7 select HAVE_ARCH_KGDB
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index d16afddb09a9..664ba53dc32a 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -3,6 +3,7 @@
3 3
4#include <asm/scatterlist.h> 4#include <asm/scatterlist.h>
5#include <asm/cache.h> 5#include <asm/cache.h>
6#include <asm-generic/dma-coherent.h>
6 7
7void *dma_alloc_noncoherent(struct device *dev, size_t size, 8void *dma_alloc_noncoherent(struct device *dev, size_t size,
8 dma_addr_t *dma_handle, gfp_t flag); 9 dma_addr_t *dma_handle, gfp_t flag);
@@ -73,14 +74,4 @@ extern int dma_is_consistent(struct device *dev, dma_addr_t dma_addr);
73extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 74extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
74 enum dma_data_direction direction); 75 enum dma_data_direction direction);
75 76
76#if 0
77#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
78
79extern int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
80 dma_addr_t device_addr, size_t size, int flags);
81extern void dma_release_declared_memory(struct device *dev);
82extern void * dma_mark_declared_memory_occupied(struct device *dev,
83 dma_addr_t device_addr, size_t size);
84#endif
85
86#endif /* _ASM_DMA_MAPPING_H */ 77#endif /* _ASM_DMA_MAPPING_H */
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 7e48e76148aa..9367e33fbd18 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -90,6 +90,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
90{ 90{
91 void *ret; 91 void *ret;
92 92
93 if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
94 return ret;
95
93 gfp = massage_gfp_flags(dev, gfp); 96 gfp = massage_gfp_flags(dev, gfp);
94 97
95 ret = (void *) __get_free_pages(gfp, get_order(size)); 98 ret = (void *) __get_free_pages(gfp, get_order(size));
@@ -122,6 +125,10 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
122 dma_addr_t dma_handle) 125 dma_addr_t dma_handle)
123{ 126{
124 unsigned long addr = (unsigned long) vaddr; 127 unsigned long addr = (unsigned long) vaddr;
128 int order = get_order(size);
129
130 if (dma_release_from_coherent(dev, order, vaddr))
131 return;
125 132
126 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); 133 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
127 134