]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blob - arch/cris/arch-v32/kernel/cache.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-kernels.git] / arch / cris / arch-v32 / kernel / cache.c
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>
6
7 /* This file is used to workaround a cache bug, Guinness TR 106. */
8
9 inline void flush_dma_descr(struct dma_descr_data *descr, int flush_buf)
10 {
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));
17 }
18 EXPORT_SYMBOL(flush_dma_descr);
19
20 void flush_dma_list(struct dma_descr_data *descr)
21 {
22 while (1) {
23 flush_dma_descr(descr, 1);
24 if (descr->eol)
25 break;
26 descr = phys_to_virt((unsigned)descr->next);
27 }
28 }
29 EXPORT_SYMBOL(flush_dma_list);
30
31 /* From cacheflush.S */
32 EXPORT_SYMBOL(cris_flush_cache);
33 /* From cacheflush.S */
34 EXPORT_SYMBOL(cris_flush_cache_range);