27 extern void l2cache_register_drv(
void);
29 #define L2CACHE_ERR_OK 0 30 #define L2CACHE_ERR_NOINIT -1 31 #define L2CACHE_ERR_EINVAL -2 32 #define L2CACHE_ERR_TOOMANY -3 33 #define L2CACHE_ERR_ERROR -4 36 #define L2CACHE_OPTIONS_FLUSH_WAIT (0x1 << 2) 37 #define L2CACHE_OPTIONS_FLUSH_INVALIDATE (0x3 << 0) 38 #define L2CACHE_OPTIONS_FLUSH_WRITEBACK (0x2 << 0) 39 #define L2CACHE_OPTIONS_FLUSH_INV_WBACK (0x1 << 0) 40 #define L2CACHE_OPTIONS_FLUSH_NONE (0 << 0) 43 #define L2CACHE_STATUS_ENABLED 1 44 #define L2CACHE_STATUS_SPLIT_ENABLED (0x1 << 1) 45 #define L2CACHE_STATUS_EDAC_ENABLED (0x1 << 2) 46 #define L2CACHE_STATUS_REPL (0x3 << L2CACHE_STATUS_REPL_BIT) 47 #define L2CACHE_STATUS_REPL_BIT 3 48 #define L2CACHE_STATUS_WRITETHROUGH (0x1 << 5) 49 #define L2CACHE_STATUS_LOCK (0xf << L2CACHE_STATUS_LOCK_BIT) 50 #define L2CACHE_STATUS_LOCK_BIT 6 51 #define L2CACHE_STATUS_SCRUB_ENABLED (0x1 << 10) 52 #define L2CACHE_STATUS_INT (0xf << L2CACHE_STATUS_INT_BIT) 53 #define L2CACHE_STATUS_INT_BIT 11 54 #define L2CACHE_STATUS_INT_BCKEND (0x1 << 11) 55 #define L2CACHE_STATUS_INT_WPHIT (0x1 << 12) 56 #define L2CACHE_STATUS_INT_UEE (0x1 << 13) 57 #define L2CACHE_STATUS_INT_CEE (0x1 << 14) 58 #define L2CACHE_STATUS_SCRUB_DELAY (0xffff << L2CACHE_STATUS_SCRUB_DELAY_BIT) 59 #define L2CACHE_STATUS_SCRUB_DELAY_BIT 15 60 #define L2CACHE_STATUS_SIGN_BIT 31 63 #define L2CACHE_ENABLED(status) (status & L2CACHE_STATUS_ENABLED) 64 #define L2CACHE_DISABLED(status) (!(status & L2CACHE_STATUS_ENABLED)) 65 #define L2CACHE_SPLIT_ENABLED(status) (status & L2CACHE_STATUS_SPLIT_ENABLED) 66 #define L2CACHE_SPLIT_DISABLED(status) \ 67 (!(status & L2CACHE_STATUS_SPLIT_ENABLED)) 68 #define L2CACHE_EDAC_ENABLED(status) (status & L2CACHE_STATUS_EDAC_ENABLED) 69 #define L2CACHE_EDAC_DISABLED(status) (!(status & L2CACHE_STATUS_EDAC_ENABLED)) 70 #define L2CACHE_REPL(status) \ 71 ((status & L2CACHE_STATUS_REPL) >> L2CACHE_STATUS_REPL_BIT) 72 #define L2CACHE_WRITETHROUGH(status) (status & L2CACHE_STATUS_WRITETHROUGH) 73 #define L2CACHE_WRITEBACK(status) (!(status & L2CACHE_STATUS_WRITETHROUGH)) 74 #define L2CACHE_LOCKED_WAYS(status) \ 75 ((status & L2CACHE_STATUS_LOCK) >> L2CACHE_STATUS_LOCK_BIT) 76 #define L2CACHE_SCRUB_ENABLED(status) (status & L2CACHE_STATUS_SCRUB_ENABLED) 77 #define L2CACHE_SCRUB_DISABLED(status) \ 78 (!(status & L2CACHE_STATUS_SCRUB_ENABLED)) 79 #define L2CACHE_SCRUB_DELAY(status) \ 80 ((status & L2CACHE_STATUS_SCRUB_DELAY) >> L2CACHE_STATUS_SCRUB_DELAY_BIT) 81 #define L2CACHE_INT_ENABLED(status) (status & L2CACHE_STATUS_INT) 82 #define L2CACHE_INT_DISABLED(status) (!(status & L2CACHE_STATUS_INT)) 83 extern int l2cache_status(
void);
86 extern int l2cache_enable(
int flush);
87 extern int l2cache_disable(
int flush);
89 extern int l2cache_split_enable(
void);
90 extern int l2cache_split_disable(
void);
92 extern int l2cache_edac_enable(
int flush);
93 extern int l2cache_edac_disable(
int flush);
95 extern int l2cache_scrub_enable(
int delay);
96 extern int l2cache_scrub_disable(
void);
97 extern int l2cache_scrub_line(
int way,
int index);
99 extern int l2cache_writethrough(
int flush);
100 extern int l2cache_writeback(
int flush);
102 #define L2CACHE_OPTIONS_REPL_INDEX_WAY_BIT (2) 103 #define L2CACHE_OPTIONS_REPL_MASTERIDX_MOD (3 << 0) 104 #define L2CACHE_OPTIONS_REPL_MASTERIDX_IDX (2 << 0) 105 #define L2CACHE_OPTIONS_REPL_RANDOM (1 << 0) 106 #define L2CACHE_OPTIONS_REPL_LRU (0 << 0) 107 extern int l2cache_replacement(
int options,
int flush);
110 extern int l2cache_flush(
int flush);
111 extern int l2cache_flush_address(uint32_t addr,
int size,
int flush);
112 extern int l2cache_flush_line(
int way,
int index,
int flush);
113 extern int l2cache_flush_way(
int way,
int flush);
116 #define L2CACHE_OPTIONS_DIRTY (0x1 << 2) 117 #define L2CACHE_OPTIONS_VALID (0x1 << 1) 118 #define L2CACHE_OPTIONS_FETCH (0x1 << 0) 119 #define L2CACHE_OPTIONS_DISABLE 2 120 #define L2CACHE_OPTIONS_ENABLE 1 121 #define L2CACHE_OPTIONS_NONE 0 122 extern int l2cache_lock_way(uint32_t tag,
int options,
int flush,
int enable);
123 extern int l2cache_unlock(
void);
126 extern int l2cache_fill_way(
int way, uint32_t tag,
int options,
int flush);
129 #define L2CACHE_OPTIONS_MTRR_ACCESS_WRITETHROUGH (0x1 << 2) 130 #define L2CACHE_OPTIONS_MTRR_ACCESS_UNCACHED (0x0 << 2) 131 #define L2CACHE_OPTIONS_MTRR_WRITEPROT_ENABLE (0x1 << 1) 132 #define L2CACHE_OPTIONS_MTRR_WRITEPROT_DISABLE (0x0 << 1) 133 extern int l2cache_mtrr_enable(
int id, uint32_t addr, uint32_t mask,
134 int options,
int flush);
135 extern int l2cache_mtrr_disable(
int id);
138 extern int l2cache_print(
void);
146 typedef void (*l2cache_isr_t)(
void *arg, uint32_t addr, uint32_t status);
147 #define L2CACHE_INTERRUPT_ALL (0xf << 0) 148 #define L2CACHE_INTERRUPT_BACKENDERROR (0x1 << 3) 149 #define L2CACHE_INTERRUPT_WPROTHIT (0x1 << 2) 150 #define L2CACHE_INTERRUPT_UNCORRERROR (0x1 << 1) 151 #define L2CACHE_INTERRUPT_CORRERROR (0x1 << 0) 152 extern int l2cache_isr_register( l2cache_isr_t isr,
void * arg,
int options);
153 extern int l2cache_isr_unregister(
void);
154 extern int l2cache_interrupt_mask(
int options);
155 extern int l2cache_interrupt_unmask(
int options);
158 #define L2CACHE_STATUS_MULTIPLEERRORS 2 159 #define L2CACHE_STATUS_NEWERROR 1 160 #define L2CACHE_STATUS_NOERROR 0 161 extern int l2cache_error_status(uint32_t * addr, uint32_t * status);
179 struct l2cache_dataline {
183 extern int l2cache_get_index( uint32_t addr);
184 extern uint32_t l2cache_get_tag( uint32_t addr);
186 extern int l2cache_diag_tag(
int way,
int index,
struct l2cache_tag * tag);
187 extern int l2cache_diag_line(
int way,
int index,
188 struct l2cache_dataline * dataline);
190 #define L2CACHE_HIT 1 191 #define L2CACHE_MISS 0 192 extern int l2cache_lookup(uint32_t addr,
int * way);
194 extern int l2cache_error_inject_address( uint32_t addr, uint32_t mask);
unsigned size
Definition: tte.h:74