162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci#ifndef DMA_H 362306a36Sopenharmony_ci#define DMA_H 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#include <asm/glue-cache.h> 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#ifndef MULTI_CACHE 862306a36Sopenharmony_ci#define dmac_map_area __glue(_CACHE,_dma_map_area) 962306a36Sopenharmony_ci#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci/* 1262306a36Sopenharmony_ci * These are private to the dma-mapping API. Do not use directly. 1362306a36Sopenharmony_ci * Their sole purpose is to ensure that data held in the cache 1462306a36Sopenharmony_ci * is visible to DMA, or data written by DMA to system memory is 1562306a36Sopenharmony_ci * visible to the CPU. 1662306a36Sopenharmony_ci */ 1762306a36Sopenharmony_ciextern void dmac_map_area(const void *, size_t, int); 1862306a36Sopenharmony_ciextern void dmac_unmap_area(const void *, size_t, int); 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#else 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci/* 2362306a36Sopenharmony_ci * These are private to the dma-mapping API. Do not use directly. 2462306a36Sopenharmony_ci * Their sole purpose is to ensure that data held in the cache 2562306a36Sopenharmony_ci * is visible to DMA, or data written by DMA to system memory is 2662306a36Sopenharmony_ci * visible to the CPU. 2762306a36Sopenharmony_ci */ 2862306a36Sopenharmony_ci#define dmac_map_area cpu_cache.dma_map_area 2962306a36Sopenharmony_ci#define dmac_unmap_area cpu_cache.dma_unmap_area 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci#endif 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#endif 34