summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorDenis Orlov <denorl2009@gmail.com>2023-02-10 17:47:45 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2023-02-14 13:09:10 +0100
commit9214b7a79b13a3e4884db70cc0d82095875c89ea (patch)
tree8d6e9c2f83eab5e1b7a34c7e8699f8137244aecd /arch/mips
parent763273ce9e2999ddc995e339bfe8d1450fb7fa7a (diff)
downloadbarebox-9214b7a79b13a3e4884db70cc0d82095875c89ea.tar.gz
MIPS: dma: simplify source structure
There is no reason to keep code from 'dma-mapping.h' in a separate file, so merge it into 'dma.h'. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210144745.915720-5-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/dma-mapping.h40
-rw-r--r--arch/mips/include/asm/dma.h31
2 files changed, 30 insertions, 41 deletions
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
deleted file mode 100644
index 9f6ec03e3b..0000000000
--- a/arch/mips/include/asm/dma-mapping.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef _ASM_DMA_MAPPING_H
-#define _ASM_DMA_MAPPING_H
-
-#include <common.h>
-#include <xfuncs.h>
-#include <asm/addrspace.h>
-#include <asm/types.h>
-#include <malloc.h>
-#include <asm/io.h>
-
-#define dma_alloc_coherent dma_alloc_coherent
-static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
-{
- void *ret;
-
- ret = xmemalign(PAGE_SIZE, size);
-
- memset(ret, 0, size);
-
- if (dma_handle)
- *dma_handle = CPHYSADDR(ret);
-
- dma_flush_range((unsigned long)ret, (unsigned long)(ret + size));
-
- return (void *)CKSEG1ADDR(ret);
-}
-
-#define dma_free_coherent dma_free_coherent
-static inline void dma_free_coherent(void *vaddr, dma_addr_t dma_handle,
- size_t size)
-{
- if (IS_ENABLED(CONFIG_MMU) && vaddr)
- free((void *)CKSEG0ADDR(vaddr));
- else
- free(vaddr);
-}
-
-#endif /* _ASM_DMA_MAPPING_H */
diff --git a/arch/mips/include/asm/dma.h b/arch/mips/include/asm/dma.h
index 49eeaac1a2..62d9c7c548 100644
--- a/arch/mips/include/asm/dma.h
+++ b/arch/mips/include/asm/dma.h
@@ -7,8 +7,12 @@
#define __ASM_DMA_H
#include <common.h>
+#include <malloc.h>
#include <xfuncs.h>
+#include <asm/addrspace.h>
#include <asm/cpu-info.h>
+#include <asm/io.h>
+#include <asm/types.h>
#define dma_alloc dma_alloc
static inline void *dma_alloc(size_t size)
@@ -18,6 +22,31 @@ static inline void *dma_alloc(size_t size)
return xmemalign(max_linesz, ALIGN(size, max_linesz));
}
-#include "asm/dma-mapping.h"
+#define dma_alloc_coherent dma_alloc_coherent
+static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
+{
+ void *ret;
+
+ ret = xmemalign(PAGE_SIZE, size);
+
+ memset(ret, 0, size);
+
+ if (dma_handle)
+ *dma_handle = CPHYSADDR(ret);
+
+ dma_flush_range((unsigned long)ret, (unsigned long)(ret + size));
+
+ return (void *)CKSEG1ADDR(ret);
+}
+
+#define dma_free_coherent dma_free_coherent
+static inline void dma_free_coherent(void *vaddr, dma_addr_t dma_handle,
+ size_t size)
+{
+ if (IS_ENABLED(CONFIG_MMU) && vaddr)
+ free((void *)CKSEG0ADDR(vaddr));
+ else
+ free(vaddr);
+}
#endif /* __ASM_DMA_H */