This source file includes following definitions.
- cvmx_get_l2c_tag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #ifndef __CVMX_L2C_H__
34 #define __CVMX_L2C_H__
35
36 #include <uapi/asm/bitfield.h>
37
38 #define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc()
39 #define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits()
40 #define CVMX_L2_SETS cvmx_l2c_get_num_sets()
41
42
43 #define CVMX_L2C_IDX_ADDR_SHIFT 7
44 #define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1)
45
46
47 #define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT (CVMX_L2C_IDX_ADDR_SHIFT + \
48 cvmx_l2c_get_set_bits())
49 #define CVMX_L2C_ALIAS_MASK (CVMX_L2C_IDX_MASK << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT)
50 #define CVMX_L2C_MEMBANK_SELECT_SIZE 4096
51
52
53 #define CVMX_L2C_TADS 1
54
55 union cvmx_l2c_tag {
56 uint64_t u64;
57 struct {
58 __BITFIELD_FIELD(uint64_t reserved:28,
59 __BITFIELD_FIELD(uint64_t V:1,
60 __BITFIELD_FIELD(uint64_t D:1,
61 __BITFIELD_FIELD(uint64_t L:1,
62 __BITFIELD_FIELD(uint64_t U:1,
63 __BITFIELD_FIELD(uint64_t addr:32,
64 ;))))))
65 } s;
66 };
67
68
69 enum cvmx_l2c_event {
70 CVMX_L2C_EVENT_CYCLES = 0,
71 CVMX_L2C_EVENT_INSTRUCTION_MISS = 1,
72 CVMX_L2C_EVENT_INSTRUCTION_HIT = 2,
73 CVMX_L2C_EVENT_DATA_MISS = 3,
74 CVMX_L2C_EVENT_DATA_HIT = 4,
75 CVMX_L2C_EVENT_MISS = 5,
76 CVMX_L2C_EVENT_HIT = 6,
77 CVMX_L2C_EVENT_VICTIM_HIT = 7,
78 CVMX_L2C_EVENT_INDEX_CONFLICT = 8,
79 CVMX_L2C_EVENT_TAG_PROBE = 9,
80 CVMX_L2C_EVENT_TAG_UPDATE = 10,
81 CVMX_L2C_EVENT_TAG_COMPLETE = 11,
82 CVMX_L2C_EVENT_TAG_DIRTY = 12,
83 CVMX_L2C_EVENT_DATA_STORE_NOP = 13,
84 CVMX_L2C_EVENT_DATA_STORE_READ = 14,
85 CVMX_L2C_EVENT_DATA_STORE_WRITE = 15,
86 CVMX_L2C_EVENT_FILL_DATA_VALID = 16,
87 CVMX_L2C_EVENT_WRITE_REQUEST = 17,
88 CVMX_L2C_EVENT_READ_REQUEST = 18,
89 CVMX_L2C_EVENT_WRITE_DATA_VALID = 19,
90 CVMX_L2C_EVENT_XMC_NOP = 20,
91 CVMX_L2C_EVENT_XMC_LDT = 21,
92 CVMX_L2C_EVENT_XMC_LDI = 22,
93 CVMX_L2C_EVENT_XMC_LDD = 23,
94 CVMX_L2C_EVENT_XMC_STF = 24,
95 CVMX_L2C_EVENT_XMC_STT = 25,
96 CVMX_L2C_EVENT_XMC_STP = 26,
97 CVMX_L2C_EVENT_XMC_STC = 27,
98 CVMX_L2C_EVENT_XMC_DWB = 28,
99 CVMX_L2C_EVENT_XMC_PL2 = 29,
100 CVMX_L2C_EVENT_XMC_PSL1 = 30,
101 CVMX_L2C_EVENT_XMC_IOBLD = 31,
102 CVMX_L2C_EVENT_XMC_IOBST = 32,
103 CVMX_L2C_EVENT_XMC_IOBDMA = 33,
104 CVMX_L2C_EVENT_XMC_IOBRSP = 34,
105 CVMX_L2C_EVENT_XMC_BUS_VALID = 35,
106 CVMX_L2C_EVENT_XMC_MEM_DATA = 36,
107 CVMX_L2C_EVENT_XMC_REFL_DATA = 37,
108 CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38,
109 CVMX_L2C_EVENT_RSC_NOP = 39,
110 CVMX_L2C_EVENT_RSC_STDN = 40,
111 CVMX_L2C_EVENT_RSC_FILL = 41,
112 CVMX_L2C_EVENT_RSC_REFL = 42,
113 CVMX_L2C_EVENT_RSC_STIN = 43,
114 CVMX_L2C_EVENT_RSC_SCIN = 44,
115 CVMX_L2C_EVENT_RSC_SCFL = 45,
116 CVMX_L2C_EVENT_RSC_SCDN = 46,
117 CVMX_L2C_EVENT_RSC_DATA_VALID = 47,
118 CVMX_L2C_EVENT_RSC_VALID_FILL = 48,
119 CVMX_L2C_EVENT_RSC_VALID_STRSP = 49,
120 CVMX_L2C_EVENT_RSC_VALID_REFL = 50,
121 CVMX_L2C_EVENT_LRF_REQ = 51,
122 CVMX_L2C_EVENT_DT_RD_ALLOC = 52,
123 CVMX_L2C_EVENT_DT_WR_INVAL = 53,
124 CVMX_L2C_EVENT_MAX
125 };
126
127
128 enum cvmx_l2c_tad_event {
129 CVMX_L2C_TAD_EVENT_NONE = 0,
130 CVMX_L2C_TAD_EVENT_TAG_HIT = 1,
131 CVMX_L2C_TAD_EVENT_TAG_MISS = 2,
132 CVMX_L2C_TAD_EVENT_TAG_NOALLOC = 3,
133 CVMX_L2C_TAD_EVENT_TAG_VICTIM = 4,
134 CVMX_L2C_TAD_EVENT_SC_FAIL = 5,
135 CVMX_L2C_TAD_EVENT_SC_PASS = 6,
136 CVMX_L2C_TAD_EVENT_LFB_VALID = 7,
137 CVMX_L2C_TAD_EVENT_LFB_WAIT_LFB = 8,
138 CVMX_L2C_TAD_EVENT_LFB_WAIT_VAB = 9,
139 CVMX_L2C_TAD_EVENT_QUAD0_INDEX = 128,
140 CVMX_L2C_TAD_EVENT_QUAD0_READ = 129,
141 CVMX_L2C_TAD_EVENT_QUAD0_BANK = 130,
142 CVMX_L2C_TAD_EVENT_QUAD0_WDAT = 131,
143 CVMX_L2C_TAD_EVENT_QUAD1_INDEX = 144,
144 CVMX_L2C_TAD_EVENT_QUAD1_READ = 145,
145 CVMX_L2C_TAD_EVENT_QUAD1_BANK = 146,
146 CVMX_L2C_TAD_EVENT_QUAD1_WDAT = 147,
147 CVMX_L2C_TAD_EVENT_QUAD2_INDEX = 160,
148 CVMX_L2C_TAD_EVENT_QUAD2_READ = 161,
149 CVMX_L2C_TAD_EVENT_QUAD2_BANK = 162,
150 CVMX_L2C_TAD_EVENT_QUAD2_WDAT = 163,
151 CVMX_L2C_TAD_EVENT_QUAD3_INDEX = 176,
152 CVMX_L2C_TAD_EVENT_QUAD3_READ = 177,
153 CVMX_L2C_TAD_EVENT_QUAD3_BANK = 178,
154 CVMX_L2C_TAD_EVENT_QUAD3_WDAT = 179,
155 CVMX_L2C_TAD_EVENT_MAX
156 };
157
158
159
160
161
162
163
164
165
166
167
168
169 void cvmx_l2c_config_perf(uint32_t counter, enum cvmx_l2c_event event,
170 uint32_t clear_on_read);
171
172
173
174
175
176
177
178
179
180 uint64_t cvmx_l2c_read_perf(uint32_t counter);
181
182
183
184
185
186
187
188
189
190
191 int cvmx_l2c_get_core_way_partition(uint32_t core);
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209 int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask);
210
211
212
213
214
215
216
217
218 int cvmx_l2c_get_hw_way_partition(void);
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235 int cvmx_l2c_set_hw_way_partition(uint32_t mask);
236
237
238
239
240
241
242
243
244
245
246 int cvmx_l2c_lock_line(uint64_t addr);
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264 int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len);
265
266
267
268
269
270
271
272
273
274
275
276
277
278 int cvmx_l2c_unlock_line(uint64_t address);
279
280
281
282
283
284
285
286
287
288 int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len);
289
290
291
292
293
294
295
296
297
298
299 union cvmx_l2c_tag cvmx_l2c_get_tag(uint32_t association, uint32_t index);
300
301
302 static inline union cvmx_l2c_tag cvmx_get_l2c_tag(uint32_t association,
303 uint32_t index)
304 __attribute__((deprecated));
305 static inline union cvmx_l2c_tag cvmx_get_l2c_tag(uint32_t association,
306 uint32_t index)
307 {
308 return cvmx_l2c_get_tag(association, index);
309 }
310
311
312
313
314
315
316
317
318
319 uint32_t cvmx_l2c_address_to_index(uint64_t addr);
320
321
322
323
324
325
326 void cvmx_l2c_flush(void);
327
328
329
330
331
332
333 int cvmx_l2c_get_cache_size_bytes(void);
334
335
336
337
338
339
340 int cvmx_l2c_get_num_sets(void);
341
342
343
344
345
346 int cvmx_l2c_get_set_bits(void);
347
348
349
350
351
352 int cvmx_l2c_get_num_assoc(void);
353
354
355
356
357
358
359
360
361
362 void cvmx_l2c_flush_line(uint32_t assoc, uint32_t index);
363
364 #endif