summaryrefslogtreecommitdiffstats
path: root/arch/nios2/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-07-02 10:59:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-07-02 10:59:22 +0200
commitdd3c898d06a55a4c6fe94dae3f732a541e983432 (patch)
tree9f8ea0b057a6a1b52c948214d27ccde9378326a9 /arch/nios2/include
parent649f558483f9959c0ac4123da8c7b647d9808be5 (diff)
parent40faf584cd60c1e0e083ac75eb9ef5f9e7c071d0 (diff)
downloadbarebox-dd3c898d06a55a4c6fe94dae3f732a541e983432.tar.gz
barebox-dd3c898d06a55a4c6fe94dae3f732a541e983432.tar.xz
Merge branch 'for-next/dma-cache-align'
Diffstat (limited to 'arch/nios2/include')
-rw-r--r--arch/nios2/include/asm/dma-mapping.h10
-rw-r--r--arch/nios2/include/asm/dma.h8
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h
index 5b70f4cead..9819a973e7 100644
--- a/arch/nios2/include/asm/dma-mapping.h
+++ b/arch/nios2/include/asm/dma-mapping.h
@@ -1,8 +1,12 @@
#ifndef __ASM_NIOS2_DMA_MAPPING_H
#define __ASM_NIOS2_DMA_MAPPING_H
+#include <common.h>
+#include <xfuncs.h>
+
#include <asm/cache.h>
+
/* dma_alloc_coherent() return cache-line aligned allocation which is mapped
* to uncached io region.
*
@@ -22,4 +26,10 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
return (void *)(*handle | IO_REGION_BASE);
}
+#define dma_alloc dma_alloc
+static inline void *dma_alloc(size_t size)
+{
+ return xmemalign(DCACHE_LINE_SIZE, ALIGN(size, DCACHE_LINE_SIZE));
+}
+
#endif /* __ASM_NIOS2_DMA_MAPPING_H */
diff --git a/arch/nios2/include/asm/dma.h b/arch/nios2/include/asm/dma.h
new file mode 100644
index 0000000000..8f709d2dbf
--- /dev/null
+++ b/arch/nios2/include/asm/dma.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2012 by Marc Kleine-Budde <mkl@pengutronix.de>
+ *
+ * This file is released under the GPLv2
+ *
+ */
+
+#include <asm/dma-mapping.h>