Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / cris / arch-v32 / kernel / cache.c
bloba080d2fa480371cdf3548d324d83b2d9b51b959e
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
3 #include <asm/io.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. */
14 if (flush_buf)
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)
22 while (1) {
23 flush_dma_descr(descr, 1);
24 if (descr->eol)
25 break;
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);