]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
57c230a8 JN |
2 | #include <linux/module.h> |
3 | #include <asm/io.h> | |
556dcee7 JN |
4 | #include <arch/cache.h> |
5 | #include <arch/hwregs/dma.h> | |
57c230a8 JN |
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); |