summaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2014-07-04 01:27:01 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-04 07:35:47 +0200
commiteb062ecbdf77e3fa10e8ea64414c4e1a12fecf5e (patch)
treeb30a9d6b587e5de5d705d875b66fc7826bfc9f85 /arch/mips/include
parente829b7c0c8c6fd808421fbfae28f6a1ccb57bd3e (diff)
downloadbarebox-eb062ecbdf77e3fa10e8ea64414c4e1a12fecf5e.tar.gz
barebox-eb062ecbdf77e3fa10e8ea64414c4e1a12fecf5e.tar.xz
MIPS: add dma_alloc_coherent()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/dma-mapping.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
new file mode 100644
index 0000000000..555efa5773
--- /dev/null
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -0,0 +1,25 @@
+#ifndef _ASM_DMA_MAPPING_H
+#define _ASM_DMA_MAPPING_H
+
+#include <xfuncs.h>
+#include <asm/addrspace.h>
+#include <asm/types.h>
+#include <malloc.h>
+
+static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
+{
+ void *ret;
+
+ ret = xmemalign(PAGE_SIZE, size);
+
+ *dma_handle = CPHYSADDR(ret);
+
+ return (void *)CKSEG1ADDR(ret);
+}
+
+static inline void dma_free_coherent(void *vaddr)
+{
+ free(vaddr);
+}
+
+#endif /* _ASM_DMA_MAPPING_H */