18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef DMA_H
38c2ecf20Sopenharmony_ci#define DMA_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/glue-cache.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#ifndef MULTI_CACHE
88c2ecf20Sopenharmony_ci#define dmac_map_area			__glue(_CACHE,_dma_map_area)
98c2ecf20Sopenharmony_ci#define dmac_unmap_area 		__glue(_CACHE,_dma_unmap_area)
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci/*
128c2ecf20Sopenharmony_ci * These are private to the dma-mapping API.  Do not use directly.
138c2ecf20Sopenharmony_ci * Their sole purpose is to ensure that data held in the cache
148c2ecf20Sopenharmony_ci * is visible to DMA, or data written by DMA to system memory is
158c2ecf20Sopenharmony_ci * visible to the CPU.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ciextern void dmac_map_area(const void *, size_t, int);
188c2ecf20Sopenharmony_ciextern void dmac_unmap_area(const void *, size_t, int);
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#else
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/*
238c2ecf20Sopenharmony_ci * These are private to the dma-mapping API.  Do not use directly.
248c2ecf20Sopenharmony_ci * Their sole purpose is to ensure that data held in the cache
258c2ecf20Sopenharmony_ci * is visible to DMA, or data written by DMA to system memory is
268c2ecf20Sopenharmony_ci * visible to the CPU.
278c2ecf20Sopenharmony_ci */
288c2ecf20Sopenharmony_ci#define dmac_map_area			cpu_cache.dma_map_area
298c2ecf20Sopenharmony_ci#define dmac_unmap_area 		cpu_cache.dma_unmap_area
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#endif
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#endif
34