aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/octeon/cvmx-l2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/octeon/cvmx-l2c.h')
-rw-r--r--arch/mips/include/asm/octeon/cvmx-l2c.h210
1 files changed, 105 insertions, 105 deletions
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c.h b/arch/mips/include/asm/octeon/cvmx-l2c.h
index 2c8ff9e33ec3..11c0a8fa8eb5 100644
--- a/arch/mips/include/asm/octeon/cvmx-l2c.h
+++ b/arch/mips/include/asm/octeon/cvmx-l2c.h
@@ -33,13 +33,13 @@
33#ifndef __CVMX_L2C_H__ 33#ifndef __CVMX_L2C_H__
34#define __CVMX_L2C_H__ 34#define __CVMX_L2C_H__
35 35
36#define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc() /* Deprecated macro, use function */ 36#define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc() /* Deprecated macro, use function */
37#define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits() /* Deprecated macro, use function */ 37#define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits() /* Deprecated macro, use function */
38#define CVMX_L2_SETS cvmx_l2c_get_num_sets() /* Deprecated macro, use function */ 38#define CVMX_L2_SETS cvmx_l2c_get_num_sets() /* Deprecated macro, use function */
39 39
40 40
41#define CVMX_L2C_IDX_ADDR_SHIFT 7 /* based on 128 byte cache line size */ 41#define CVMX_L2C_IDX_ADDR_SHIFT 7 /* based on 128 byte cache line size */
42#define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1) 42#define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1)
43 43
44/* Defines for index aliasing computations */ 44/* Defines for index aliasing computations */
45#define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT (CVMX_L2C_IDX_ADDR_SHIFT + cvmx_l2c_get_set_bits()) 45#define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT (CVMX_L2C_IDX_ADDR_SHIFT + cvmx_l2c_get_set_bits())
@@ -67,91 +67,91 @@ union cvmx_l2c_tag {
67 67
68 /* L2C Performance Counter events. */ 68 /* L2C Performance Counter events. */
69enum cvmx_l2c_event { 69enum cvmx_l2c_event {
70 CVMX_L2C_EVENT_CYCLES = 0, 70 CVMX_L2C_EVENT_CYCLES = 0,
71 CVMX_L2C_EVENT_INSTRUCTION_MISS = 1, 71 CVMX_L2C_EVENT_INSTRUCTION_MISS = 1,
72 CVMX_L2C_EVENT_INSTRUCTION_HIT = 2, 72 CVMX_L2C_EVENT_INSTRUCTION_HIT = 2,
73 CVMX_L2C_EVENT_DATA_MISS = 3, 73 CVMX_L2C_EVENT_DATA_MISS = 3,
74 CVMX_L2C_EVENT_DATA_HIT = 4, 74 CVMX_L2C_EVENT_DATA_HIT = 4,
75 CVMX_L2C_EVENT_MISS = 5, 75 CVMX_L2C_EVENT_MISS = 5,
76 CVMX_L2C_EVENT_HIT = 6, 76 CVMX_L2C_EVENT_HIT = 6,
77 CVMX_L2C_EVENT_VICTIM_HIT = 7, 77 CVMX_L2C_EVENT_VICTIM_HIT = 7,
78 CVMX_L2C_EVENT_INDEX_CONFLICT = 8, 78 CVMX_L2C_EVENT_INDEX_CONFLICT = 8,
79 CVMX_L2C_EVENT_TAG_PROBE = 9, 79 CVMX_L2C_EVENT_TAG_PROBE = 9,
80 CVMX_L2C_EVENT_TAG_UPDATE = 10, 80 CVMX_L2C_EVENT_TAG_UPDATE = 10,
81 CVMX_L2C_EVENT_TAG_COMPLETE = 11, 81 CVMX_L2C_EVENT_TAG_COMPLETE = 11,
82 CVMX_L2C_EVENT_TAG_DIRTY = 12, 82 CVMX_L2C_EVENT_TAG_DIRTY = 12,
83 CVMX_L2C_EVENT_DATA_STORE_NOP = 13, 83 CVMX_L2C_EVENT_DATA_STORE_NOP = 13,
84 CVMX_L2C_EVENT_DATA_STORE_READ = 14, 84 CVMX_L2C_EVENT_DATA_STORE_READ = 14,
85 CVMX_L2C_EVENT_DATA_STORE_WRITE = 15, 85 CVMX_L2C_EVENT_DATA_STORE_WRITE = 15,
86 CVMX_L2C_EVENT_FILL_DATA_VALID = 16, 86 CVMX_L2C_EVENT_FILL_DATA_VALID = 16,
87 CVMX_L2C_EVENT_WRITE_REQUEST = 17, 87 CVMX_L2C_EVENT_WRITE_REQUEST = 17,
88 CVMX_L2C_EVENT_READ_REQUEST = 18, 88 CVMX_L2C_EVENT_READ_REQUEST = 18,
89 CVMX_L2C_EVENT_WRITE_DATA_VALID = 19, 89 CVMX_L2C_EVENT_WRITE_DATA_VALID = 19,
90 CVMX_L2C_EVENT_XMC_NOP = 20, 90 CVMX_L2C_EVENT_XMC_NOP = 20,
91 CVMX_L2C_EVENT_XMC_LDT = 21, 91 CVMX_L2C_EVENT_XMC_LDT = 21,
92 CVMX_L2C_EVENT_XMC_LDI = 22, 92 CVMX_L2C_EVENT_XMC_LDI = 22,
93 CVMX_L2C_EVENT_XMC_LDD = 23, 93 CVMX_L2C_EVENT_XMC_LDD = 23,
94 CVMX_L2C_EVENT_XMC_STF = 24, 94 CVMX_L2C_EVENT_XMC_STF = 24,
95 CVMX_L2C_EVENT_XMC_STT = 25, 95 CVMX_L2C_EVENT_XMC_STT = 25,
96 CVMX_L2C_EVENT_XMC_STP = 26, 96 CVMX_L2C_EVENT_XMC_STP = 26,
97 CVMX_L2C_EVENT_XMC_STC = 27, 97 CVMX_L2C_EVENT_XMC_STC = 27,
98 CVMX_L2C_EVENT_XMC_DWB = 28, 98 CVMX_L2C_EVENT_XMC_DWB = 28,
99 CVMX_L2C_EVENT_XMC_PL2 = 29, 99 CVMX_L2C_EVENT_XMC_PL2 = 29,
100 CVMX_L2C_EVENT_XMC_PSL1 = 30, 100 CVMX_L2C_EVENT_XMC_PSL1 = 30,
101 CVMX_L2C_EVENT_XMC_IOBLD = 31, 101 CVMX_L2C_EVENT_XMC_IOBLD = 31,
102 CVMX_L2C_EVENT_XMC_IOBST = 32, 102 CVMX_L2C_EVENT_XMC_IOBST = 32,
103 CVMX_L2C_EVENT_XMC_IOBDMA = 33, 103 CVMX_L2C_EVENT_XMC_IOBDMA = 33,
104 CVMX_L2C_EVENT_XMC_IOBRSP = 34, 104 CVMX_L2C_EVENT_XMC_IOBRSP = 34,
105 CVMX_L2C_EVENT_XMC_BUS_VALID = 35, 105 CVMX_L2C_EVENT_XMC_BUS_VALID = 35,
106 CVMX_L2C_EVENT_XMC_MEM_DATA = 36, 106 CVMX_L2C_EVENT_XMC_MEM_DATA = 36,
107 CVMX_L2C_EVENT_XMC_REFL_DATA = 37, 107 CVMX_L2C_EVENT_XMC_REFL_DATA = 37,
108 CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38, 108 CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38,
109 CVMX_L2C_EVENT_RSC_NOP = 39, 109 CVMX_L2C_EVENT_RSC_NOP = 39,
110 CVMX_L2C_EVENT_RSC_STDN = 40, 110 CVMX_L2C_EVENT_RSC_STDN = 40,
111 CVMX_L2C_EVENT_RSC_FILL = 41, 111 CVMX_L2C_EVENT_RSC_FILL = 41,
112 CVMX_L2C_EVENT_RSC_REFL = 42, 112 CVMX_L2C_EVENT_RSC_REFL = 42,
113 CVMX_L2C_EVENT_RSC_STIN = 43, 113 CVMX_L2C_EVENT_RSC_STIN = 43,
114 CVMX_L2C_EVENT_RSC_SCIN = 44, 114 CVMX_L2C_EVENT_RSC_SCIN = 44,
115 CVMX_L2C_EVENT_RSC_SCFL = 45, 115 CVMX_L2C_EVENT_RSC_SCFL = 45,
116 CVMX_L2C_EVENT_RSC_SCDN = 46, 116 CVMX_L2C_EVENT_RSC_SCDN = 46,
117 CVMX_L2C_EVENT_RSC_DATA_VALID = 47, 117 CVMX_L2C_EVENT_RSC_DATA_VALID = 47,
118 CVMX_L2C_EVENT_RSC_VALID_FILL = 48, 118 CVMX_L2C_EVENT_RSC_VALID_FILL = 48,
119 CVMX_L2C_EVENT_RSC_VALID_STRSP = 49, 119 CVMX_L2C_EVENT_RSC_VALID_STRSP = 49,
120 CVMX_L2C_EVENT_RSC_VALID_REFL = 50, 120 CVMX_L2C_EVENT_RSC_VALID_REFL = 50,
121 CVMX_L2C_EVENT_LRF_REQ = 51, 121 CVMX_L2C_EVENT_LRF_REQ = 51,
122 CVMX_L2C_EVENT_DT_RD_ALLOC = 52, 122 CVMX_L2C_EVENT_DT_RD_ALLOC = 52,
123 CVMX_L2C_EVENT_DT_WR_INVAL = 53, 123 CVMX_L2C_EVENT_DT_WR_INVAL = 53,
124 CVMX_L2C_EVENT_MAX 124 CVMX_L2C_EVENT_MAX
125}; 125};
126 126
127/* L2C Performance Counter events for Octeon2. */ 127/* L2C Performance Counter events for Octeon2. */
128enum cvmx_l2c_tad_event { 128enum cvmx_l2c_tad_event {
129 CVMX_L2C_TAD_EVENT_NONE = 0, 129 CVMX_L2C_TAD_EVENT_NONE = 0,
130 CVMX_L2C_TAD_EVENT_TAG_HIT = 1, 130 CVMX_L2C_TAD_EVENT_TAG_HIT = 1,
131 CVMX_L2C_TAD_EVENT_TAG_MISS = 2, 131 CVMX_L2C_TAD_EVENT_TAG_MISS = 2,
132 CVMX_L2C_TAD_EVENT_TAG_NOALLOC = 3, 132 CVMX_L2C_TAD_EVENT_TAG_NOALLOC = 3,
133 CVMX_L2C_TAD_EVENT_TAG_VICTIM = 4, 133 CVMX_L2C_TAD_EVENT_TAG_VICTIM = 4,
134 CVMX_L2C_TAD_EVENT_SC_FAIL = 5, 134 CVMX_L2C_TAD_EVENT_SC_FAIL = 5,
135 CVMX_L2C_TAD_EVENT_SC_PASS = 6, 135 CVMX_L2C_TAD_EVENT_SC_PASS = 6,
136 CVMX_L2C_TAD_EVENT_LFB_VALID = 7, 136 CVMX_L2C_TAD_EVENT_LFB_VALID = 7,
137 CVMX_L2C_TAD_EVENT_LFB_WAIT_LFB = 8, 137 CVMX_L2C_TAD_EVENT_LFB_WAIT_LFB = 8,
138 CVMX_L2C_TAD_EVENT_LFB_WAIT_VAB = 9, 138 CVMX_L2C_TAD_EVENT_LFB_WAIT_VAB = 9,
139 CVMX_L2C_TAD_EVENT_QUAD0_INDEX = 128, 139 CVMX_L2C_TAD_EVENT_QUAD0_INDEX = 128,
140 CVMX_L2C_TAD_EVENT_QUAD0_READ = 129, 140 CVMX_L2C_TAD_EVENT_QUAD0_READ = 129,
141 CVMX_L2C_TAD_EVENT_QUAD0_BANK = 130, 141 CVMX_L2C_TAD_EVENT_QUAD0_BANK = 130,
142 CVMX_L2C_TAD_EVENT_QUAD0_WDAT = 131, 142 CVMX_L2C_TAD_EVENT_QUAD0_WDAT = 131,
143 CVMX_L2C_TAD_EVENT_QUAD1_INDEX = 144, 143 CVMX_L2C_TAD_EVENT_QUAD1_INDEX = 144,
144 CVMX_L2C_TAD_EVENT_QUAD1_READ = 145, 144 CVMX_L2C_TAD_EVENT_QUAD1_READ = 145,
145 CVMX_L2C_TAD_EVENT_QUAD1_BANK = 146, 145 CVMX_L2C_TAD_EVENT_QUAD1_BANK = 146,
146 CVMX_L2C_TAD_EVENT_QUAD1_WDAT = 147, 146 CVMX_L2C_TAD_EVENT_QUAD1_WDAT = 147,
147 CVMX_L2C_TAD_EVENT_QUAD2_INDEX = 160, 147 CVMX_L2C_TAD_EVENT_QUAD2_INDEX = 160,
148 CVMX_L2C_TAD_EVENT_QUAD2_READ = 161, 148 CVMX_L2C_TAD_EVENT_QUAD2_READ = 161,
149 CVMX_L2C_TAD_EVENT_QUAD2_BANK = 162, 149 CVMX_L2C_TAD_EVENT_QUAD2_BANK = 162,
150 CVMX_L2C_TAD_EVENT_QUAD2_WDAT = 163, 150 CVMX_L2C_TAD_EVENT_QUAD2_WDAT = 163,
151 CVMX_L2C_TAD_EVENT_QUAD3_INDEX = 176, 151 CVMX_L2C_TAD_EVENT_QUAD3_INDEX = 176,
152 CVMX_L2C_TAD_EVENT_QUAD3_READ = 177, 152 CVMX_L2C_TAD_EVENT_QUAD3_READ = 177,
153 CVMX_L2C_TAD_EVENT_QUAD3_BANK = 178, 153 CVMX_L2C_TAD_EVENT_QUAD3_BANK = 178,
154 CVMX_L2C_TAD_EVENT_QUAD3_WDAT = 179, 154 CVMX_L2C_TAD_EVENT_QUAD3_WDAT = 179,
155 CVMX_L2C_TAD_EVENT_MAX 155 CVMX_L2C_TAD_EVENT_MAX
156}; 156};
157 157
@@ -159,10 +159,10 @@ enum cvmx_l2c_tad_event {
159 * Configure one of the four L2 Cache performance counters to capture event 159 * Configure one of the four L2 Cache performance counters to capture event
160 * occurrences. 160 * occurrences.
161 * 161 *
162 * @counter: The counter to configure. Range 0..3. 162 * @counter: The counter to configure. Range 0..3.
163 * @event: The type of L2 Cache event occurrence to count. 163 * @event: The type of L2 Cache event occurrence to count.
164 * @clear_on_read: When asserted, any read of the performance counter 164 * @clear_on_read: When asserted, any read of the performance counter
165 * clears the counter. 165 * clears the counter.
166 * 166 *
167 * @note The routine does not clear the counter. 167 * @note The routine does not clear the counter.
168 */ 168 */
@@ -184,8 +184,8 @@ uint64_t cvmx_l2c_read_perf(uint32_t counter);
184 * @core: The core processor of interest. 184 * @core: The core processor of interest.
185 * 185 *
186 * Returns The mask specifying the partitioning. 0 bits in mask indicates 186 * Returns The mask specifying the partitioning. 0 bits in mask indicates
187 * the cache 'ways' that a core can evict from. 187 * the cache 'ways' that a core can evict from.
188 * -1 on error 188 * -1 on error
189 */ 189 */
190int cvmx_l2c_get_core_way_partition(uint32_t core); 190int cvmx_l2c_get_core_way_partition(uint32_t core);
191 191
@@ -194,16 +194,16 @@ int cvmx_l2c_get_core_way_partition(uint32_t core);
194 * 194 *
195 * @core: The core that the partitioning applies to. 195 * @core: The core that the partitioning applies to.
196 * @mask: The partitioning of the ways expressed as a binary 196 * @mask: The partitioning of the ways expressed as a binary
197 * mask. A 0 bit allows the core to evict cache lines from 197 * mask. A 0 bit allows the core to evict cache lines from
198 * a way, while a 1 bit blocks the core from evicting any 198 * a way, while a 1 bit blocks the core from evicting any
199 * lines from that way. There must be at least one allowed 199 * lines from that way. There must be at least one allowed
200 * way (0 bit) in the mask. 200 * way (0 bit) in the mask.
201 * 201 *
202 202
203 * @note If any ways are blocked for all cores and the HW blocks, then 203 * @note If any ways are blocked for all cores and the HW blocks, then
204 * those ways will never have any cache lines evicted from them. 204 * those ways will never have any cache lines evicted from them.
205 * All cores and the hardware blocks are free to read from all 205 * All cores and the hardware blocks are free to read from all
206 * ways regardless of the partitioning. 206 * ways regardless of the partitioning.
207 */ 207 */
208int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask); 208int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask);
209 209
@@ -211,8 +211,8 @@ int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask);
211 * Return the L2 Cache way partitioning for the hw blocks. 211 * Return the L2 Cache way partitioning for the hw blocks.
212 * 212 *
213 * Returns The mask specifying the reserved way. 0 bits in mask indicates 213 * Returns The mask specifying the reserved way. 0 bits in mask indicates
214 * the cache 'ways' that a core can evict from. 214 * the cache 'ways' that a core can evict from.
215 * -1 on error 215 * -1 on error
216 */ 216 */
217int cvmx_l2c_get_hw_way_partition(void); 217int cvmx_l2c_get_hw_way_partition(void);
218 218
@@ -220,16 +220,16 @@ int cvmx_l2c_get_hw_way_partition(void);
220 * Partitions the L2 cache for the hardware blocks. 220 * Partitions the L2 cache for the hardware blocks.
221 * 221 *
222 * @mask: The partitioning of the ways expressed as a binary 222 * @mask: The partitioning of the ways expressed as a binary
223 * mask. A 0 bit allows the core to evict cache lines from 223 * mask. A 0 bit allows the core to evict cache lines from
224 * a way, while a 1 bit blocks the core from evicting any 224 * a way, while a 1 bit blocks the core from evicting any
225 * lines from that way. There must be at least one allowed 225 * lines from that way. There must be at least one allowed
226 * way (0 bit) in the mask. 226 * way (0 bit) in the mask.
227 * 227 *
228 228
229 * @note If any ways are blocked for all cores and the HW blocks, then 229 * @note If any ways are blocked for all cores and the HW blocks, then
230 * those ways will never have any cache lines evicted from them. 230 * those ways will never have any cache lines evicted from them.
231 * All cores and the hardware blocks are free to read from all 231 * All cores and the hardware blocks are free to read from all
232 * ways regardless of the partitioning. 232 * ways regardless of the partitioning.
233 */ 233 */
234int cvmx_l2c_set_hw_way_partition(uint32_t mask); 234int cvmx_l2c_set_hw_way_partition(uint32_t mask);
235 235
@@ -240,7 +240,7 @@ int cvmx_l2c_set_hw_way_partition(uint32_t mask);
240 * @addr: physical address of line to lock 240 * @addr: physical address of line to lock
241 * 241 *
242 * Returns 0 on success, 242 * Returns 0 on success,
243 * 1 if line not locked. 243 * 1 if line not locked.
244 */ 244 */
245int cvmx_l2c_lock_line(uint64_t addr); 245int cvmx_l2c_lock_line(uint64_t addr);
246 246
@@ -258,7 +258,7 @@ int cvmx_l2c_lock_line(uint64_t addr);
258 * @len: Length (in bytes) of region to lock 258 * @len: Length (in bytes) of region to lock
259 * 259 *
260 * Returns Number of requested lines that where not locked. 260 * Returns Number of requested lines that where not locked.
261 * 0 on success (all locked) 261 * 0 on success (all locked)
262 */ 262 */
263int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len); 263int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len);
264 264
@@ -272,7 +272,7 @@ int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len);
272 * @address: Physical address to unlock 272 * @address: Physical address to unlock
273 * 273 *
274 * Returns 0: line not unlocked 274 * Returns 0: line not unlocked
275 * 1: line unlocked 275 * 1: line unlocked
276 */ 276 */
277int cvmx_l2c_unlock_line(uint64_t address); 277int cvmx_l2c_unlock_line(uint64_t address);
278 278
@@ -290,7 +290,7 @@ int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len);
290 * Read the L2 controller tag for a given location in L2 290 * Read the L2 controller tag for a given location in L2
291 * 291 *
292 * @association: 292 * @association:
293 * Which association to read line from 293 * Which association to read line from
294 * @index: Which way to read from. 294 * @index: Which way to read from.
295 * 295 *
296 * Returns l2c tag structure for line requested. 296 * Returns l2c tag structure for line requested.