1 From 5aeff609a8dadb82acf69650bd98faba80a47b6e Mon Sep 17 00:00:00 2001
2 From: Dan Pasanen <dan.pasanen@gmail.com>
3 Date: Thu, 21 Sep 2017 09:55:42 -0500
4 Subject: [PATCH 001/773] arm: partially revert
5 702b94bff3c50542a6e4ab9a4f4cef093262fe65
7 * Re-expose some dmi APIs for use in VCSM
9 arch/arm/include/asm/cacheflush.h | 21 +++++++++++++++++++++
10 arch/arm/include/asm/glue-cache.h | 2 ++
11 arch/arm/mm/proc-macros.S | 2 ++
12 arch/arm/mm/proc-syms.c | 3 +++
13 4 files changed, 28 insertions(+)
15 --- a/arch/arm/include/asm/cacheflush.h
16 +++ b/arch/arm/include/asm/cacheflush.h
21 + * dma_inv_range(start, end)
23 + * Invalidate (discard) the specified virtual address range.
24 + * May not write back any entries. If 'start' or 'end'
25 + * are not cache line aligned, those lines must be written
27 + * - start - virtual start address
28 + * - end - virtual end address
30 + * dma_clean_range(start, end)
32 + * Clean (write back) the specified virtual address range.
33 + * - start - virtual start address
34 + * - end - virtual end address
36 * dma_flush_range(start, end)
38 * Clean and invalidate the specified virtual address range.
39 @@ -115,6 +130,8 @@ struct cpu_cache_fns {
40 void (*dma_map_area)(const void *, size_t, int);
41 void (*dma_unmap_area)(const void *, size_t, int);
43 + void (*dma_inv_range)(const void *, const void *);
44 + void (*dma_clean_range)(const void *, const void *);
45 void (*dma_flush_range)(const void *, const void *);
46 } __no_randomize_layout;
48 @@ -140,6 +157,8 @@ extern struct cpu_cache_fns cpu_cache;
49 * is visible to DMA, or data written by DMA to system memory is
52 +#define dmac_inv_range cpu_cache.dma_inv_range
53 +#define dmac_clean_range cpu_cache.dma_clean_range
54 #define dmac_flush_range cpu_cache.dma_flush_range
57 @@ -159,6 +178,8 @@ extern void __cpuc_flush_dcache_area(voi
58 * is visible to DMA, or data written by DMA to system memory is
61 +extern void dmac_inv_range(const void *, const void *);
62 +extern void dmac_clean_range(const void *, const void *);
63 extern void dmac_flush_range(const void *, const void *);
66 --- a/arch/arm/include/asm/glue-cache.h
67 +++ b/arch/arm/include/asm/glue-cache.h
68 @@ -158,6 +158,8 @@ static inline void nop_dma_unmap_area(co
69 #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
70 #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
72 +#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
73 +#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
74 #define dmac_flush_range __glue(_CACHE,_dma_flush_range)
77 --- a/arch/arm/mm/proc-macros.S
78 +++ b/arch/arm/mm/proc-macros.S
79 @@ -335,6 +335,8 @@ ENTRY(\name\()_cache_fns)
80 .long \name\()_flush_kern_dcache_area
81 .long \name\()_dma_map_area
82 .long \name\()_dma_unmap_area
83 + .long \name\()_dma_inv_range
84 + .long \name\()_dma_clean_range
85 .long \name\()_dma_flush_range
86 .size \name\()_cache_fns, . - \name\()_cache_fns
88 --- a/arch/arm/mm/proc-syms.c
89 +++ b/arch/arm/mm/proc-syms.c
90 @@ -30,6 +30,9 @@ EXPORT_SYMBOL(__cpuc_flush_user_all);
91 EXPORT_SYMBOL(__cpuc_flush_user_range);
92 EXPORT_SYMBOL(__cpuc_coherent_kern_range);
93 EXPORT_SYMBOL(__cpuc_flush_dcache_area);
94 +EXPORT_SYMBOL(dmac_inv_range);
95 +EXPORT_SYMBOL(dmac_clean_range);
96 +EXPORT_SYMBOL(dmac_flush_range);
98 EXPORT_SYMBOL(cpu_cache);