1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
4 #include <arch/cache.h>
5 #include <arch/hwregs/dma.h>
7 /* This file is used to workaround a cache bug, Guinness TR 106. */
9 inline void flush_dma_descr(struct dma_descr_data
*descr
, int flush_buf
)
11 /* Flush descriptor to make sure we get correct in_eop and after. */
12 asm volatile ("ftagd [%0]" :: "r" (descr
));
13 /* Flush buffer pointed out by descriptor. */
15 cris_flush_cache_range(phys_to_virt((unsigned)descr
->buf
),
16 (unsigned)(descr
->after
- descr
->buf
));
18 EXPORT_SYMBOL(flush_dma_descr
);
20 void flush_dma_list(struct dma_descr_data
*descr
)
23 flush_dma_descr(descr
, 1);
26 descr
= phys_to_virt((unsigned)descr
->next
);
29 EXPORT_SYMBOL(flush_dma_list
);
31 /* From cacheflush.S */
32 EXPORT_SYMBOL(cris_flush_cache
);
33 /* From cacheflush.S */
34 EXPORT_SYMBOL(cris_flush_cache_range
);