0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef __ASM_OUTERCACHE_H
0010 #define __ASM_OUTERCACHE_H
0011
0012 #include <linux/types.h>
0013
0014 struct l2x0_regs;
0015
0016 struct outer_cache_fns {
0017 void (*inv_range)(unsigned long, unsigned long);
0018 void (*clean_range)(unsigned long, unsigned long);
0019 void (*flush_range)(unsigned long, unsigned long);
0020 void (*flush_all)(void);
0021 void (*disable)(void);
0022 #ifdef CONFIG_OUTER_CACHE_SYNC
0023 void (*sync)(void);
0024 #endif
0025 void (*resume)(void);
0026
0027
0028 void (*write_sec)(unsigned long, unsigned);
0029 void (*configure)(const struct l2x0_regs *);
0030 };
0031
0032 extern struct outer_cache_fns outer_cache;
0033
0034 #ifdef CONFIG_OUTER_CACHE
0035
0036
0037
0038
0039
0040 static inline void outer_inv_range(phys_addr_t start, phys_addr_t end)
0041 {
0042 if (outer_cache.inv_range)
0043 outer_cache.inv_range(start, end);
0044 }
0045
0046
0047
0048
0049
0050
0051 static inline void outer_clean_range(phys_addr_t start, phys_addr_t end)
0052 {
0053 if (outer_cache.clean_range)
0054 outer_cache.clean_range(start, end);
0055 }
0056
0057
0058
0059
0060
0061
0062 static inline void outer_flush_range(phys_addr_t start, phys_addr_t end)
0063 {
0064 if (outer_cache.flush_range)
0065 outer_cache.flush_range(start, end);
0066 }
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079 static inline void outer_flush_all(void)
0080 {
0081 if (outer_cache.flush_all)
0082 outer_cache.flush_all();
0083 }
0084
0085
0086
0087
0088
0089
0090
0091
0092 extern void outer_disable(void);
0093
0094
0095
0096
0097
0098
0099
0100 static inline void outer_resume(void)
0101 {
0102 if (outer_cache.resume)
0103 outer_cache.resume();
0104 }
0105
0106 #else
0107
0108 static inline void outer_inv_range(phys_addr_t start, phys_addr_t end)
0109 { }
0110 static inline void outer_clean_range(phys_addr_t start, phys_addr_t end)
0111 { }
0112 static inline void outer_flush_range(phys_addr_t start, phys_addr_t end)
0113 { }
0114 static inline void outer_flush_all(void) { }
0115 static inline void outer_disable(void) { }
0116 static inline void outer_resume(void) { }
0117
0118 #endif
0119
0120 #endif