Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: pmu_ccx_sel5_0x10_thAll.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #define PIC_COUNT_th0 0x6 | |
39 | #define PIC_COUNT_th1 0x9 | |
40 | #define PIC_COUNT_th2 0xa | |
41 | #define PIC_COUNT_th3 0xf | |
42 | #define PIC_COUNT_th4 0x3 | |
43 | #define PIC_COUNT_th5 0x2 | |
44 | #define PIC_COUNT_th6 0xe | |
45 | #define PIC_COUNT_th7 0x1 | |
46 | ||
47 | #define MAIN_PAGE_HV_ALSO | |
48 | #include "hboot.s" | |
49 | ||
50 | .text | |
51 | .global main | |
52 | ||
53 | main: | |
54 | ||
55 | ! Get TID | |
56 | ta T_RD_THID | |
57 | mov %o1, %l6 | |
58 | nop | |
59 | ||
60 | cmp %l6, 0 | |
61 | be thread_0 | |
62 | nop | |
63 | ||
64 | cmp %l6, 1 | |
65 | be thread_1 | |
66 | nop | |
67 | ||
68 | cmp %l6, 2 | |
69 | be thread_2 | |
70 | nop | |
71 | ||
72 | cmp %l6, 3 | |
73 | be thread_3 | |
74 | nop | |
75 | ||
76 | cmp %l6, 4 | |
77 | be thread_4 | |
78 | nop | |
79 | ||
80 | cmp %l6, 5 | |
81 | be thread_5 | |
82 | nop | |
83 | ||
84 | cmp %l6, 6 | |
85 | be thread_6 | |
86 | nop | |
87 | ||
88 | cmp %l6, 7 | |
89 | be thread_7 | |
90 | nop | |
91 | ||
92 | thread_0: | |
93 | ||
94 | setx 0x0000deadbeefbad0, %l5, %l4 | |
95 | ||
96 | !# Switch to hpriv mode | |
97 | ta T_CHANGE_HPRIV | |
98 | !# Check to make sure pic is zero | |
99 | rd %pic, %g4 | |
100 | cmp %g0, %g4 | |
101 | bne,pn %icc, fail | |
102 | nop | |
103 | ||
104 | !# Setup PCR Register | |
105 | set 0x0000000020414408, %g2 | |
106 | wr %g2, %g0, %pcr | |
107 | ||
108 | or %g0, %g0, %g3 | |
109 | ccx_st_th0: | |
110 | umul %g3, 32, %g4 | |
111 | setx DATA_0x0, %g1, %l5 | |
112 | stx %g3, [%l5 + %g4] | |
113 | add %g3, 1 , %g3 | |
114 | cmp %g3, PIC_COUNT_th0 | |
115 | bne,pn %xcc, ccx_st_th0 | |
116 | nop | |
117 | ||
118 | membar #Sync | |
119 | ||
120 | check_pic_th0: | |
121 | rd %pic, %g4 | |
122 | mov %g4, %i7 | |
123 | cmp %g4, PIC_COUNT_th0 | |
124 | bne,pn %icc, fail | |
125 | nop | |
126 | ||
127 | check_pic1_isZero_th0: | |
128 | setx 0xffffffff00000000, %l5, %l0 | |
129 | and %i7, %l0, %i7 | |
130 | cmp %i7, 0x0 | |
131 | bne,pn %icc, fail | |
132 | nop | |
133 | ||
134 | EXIT_GOOD | |
135 | ||
136 | thread_1: | |
137 | ||
138 | setx 0x0000deadbeefbad0, %l5, %l4 | |
139 | ||
140 | !# Switch to hpriv mode | |
141 | ta T_CHANGE_HPRIV | |
142 | !# Check to make sure pic is zero | |
143 | rd %pic, %g4 | |
144 | cmp %g0, %g4 | |
145 | bne,pn %icc, fail | |
146 | nop | |
147 | ||
148 | !# Setup PCR Register | |
149 | set 0x0000000020414408, %g2 | |
150 | wr %g2, %g0, %pcr | |
151 | ||
152 | or %g0, %g0, %g3 | |
153 | ccx_st_th1: | |
154 | umul %g3, 32, %g4 | |
155 | setx DATA_0x0, %g1, %l5 | |
156 | stx %g3, [%l5 + %g4] | |
157 | add %g3, 1 , %g3 | |
158 | cmp %g3, PIC_COUNT_th1 | |
159 | bne,pn %xcc, ccx_st_th1 | |
160 | nop | |
161 | ||
162 | membar #Sync | |
163 | ||
164 | check_pic_th1: | |
165 | rd %pic, %g4 | |
166 | mov %g4, %i7 | |
167 | cmp %g4, PIC_COUNT_th1 | |
168 | bne,pn %icc, fail | |
169 | nop | |
170 | ||
171 | check_pic1_isZero_th1: | |
172 | setx 0xffffffff00000000, %l5, %l0 | |
173 | and %i7, %l0, %i7 | |
174 | cmp %i7, 0x0 | |
175 | bne,pn %icc, fail | |
176 | nop | |
177 | ||
178 | EXIT_GOOD | |
179 | ||
180 | thread_2: | |
181 | ||
182 | setx 0x0000deadbeefbad0, %l5, %l4 | |
183 | ||
184 | !# Switch to hpriv mode | |
185 | ta T_CHANGE_HPRIV | |
186 | !# Check to make sure pic is zero | |
187 | rd %pic, %g4 | |
188 | cmp %g0, %g4 | |
189 | bne,pn %icc, fail | |
190 | nop | |
191 | ||
192 | !# Setup PCR Register | |
193 | set 0x0000000020414408, %g2 | |
194 | wr %g2, %g0, %pcr | |
195 | ||
196 | or %g0, %g0, %g3 | |
197 | ccx_st_th2: | |
198 | umul %g3, 32, %g4 | |
199 | setx DATA_0x0, %g1, %l5 | |
200 | stx %g3, [%l5 + %g4] | |
201 | add %g3, 1 , %g3 | |
202 | cmp %g3, PIC_COUNT_th2 | |
203 | bne,pn %xcc, ccx_st_th2 | |
204 | nop | |
205 | ||
206 | membar #Sync | |
207 | ||
208 | check_pic_th2: | |
209 | rd %pic, %g4 | |
210 | mov %g4, %i7 | |
211 | cmp %g4, PIC_COUNT_th2 | |
212 | bne,pn %icc, fail | |
213 | nop | |
214 | ||
215 | check_pic1_isZero_th2: | |
216 | setx 0xffffffff00000000, %l5, %l0 | |
217 | and %i7, %l0, %i7 | |
218 | cmp %i7, 0x0 | |
219 | bne,pn %icc, fail | |
220 | nop | |
221 | ||
222 | EXIT_GOOD | |
223 | ||
224 | thread_3: | |
225 | ||
226 | setx 0x0000deadbeefbad0, %l5, %l4 | |
227 | ||
228 | !# Switch to hpriv mode | |
229 | ta T_CHANGE_HPRIV | |
230 | !# Check to make sure pic is zero | |
231 | rd %pic, %g4 | |
232 | cmp %g0, %g4 | |
233 | bne,pn %icc, fail | |
234 | nop | |
235 | ||
236 | !# Setup PCR Register | |
237 | set 0x0000000020414408, %g2 | |
238 | wr %g2, %g0, %pcr | |
239 | ||
240 | or %g0, %g0, %g3 | |
241 | ccx_st_th3: | |
242 | umul %g3, 32, %g4 | |
243 | setx DATA_0x0, %g1, %l5 | |
244 | stx %g3, [%l5 + %g4] | |
245 | add %g3, 1 , %g3 | |
246 | cmp %g3, PIC_COUNT_th3 | |
247 | bne,pn %xcc, ccx_st_th3 | |
248 | nop | |
249 | ||
250 | membar #Sync | |
251 | ||
252 | check_pic_th3: | |
253 | rd %pic, %g4 | |
254 | mov %g4, %i7 | |
255 | cmp %g4, PIC_COUNT_th3 | |
256 | bne,pn %icc, fail | |
257 | nop | |
258 | ||
259 | check_pic1_isZero_th3: | |
260 | setx 0xffffffff00000000, %l5, %l0 | |
261 | and %i7, %l0, %i7 | |
262 | cmp %i7, 0x0 | |
263 | bne,pn %icc, fail | |
264 | nop | |
265 | ||
266 | EXIT_GOOD | |
267 | ||
268 | ||
269 | thread_4: | |
270 | ||
271 | setx 0x0000deadbeefbad0, %l5, %l4 | |
272 | ||
273 | !# Switch to hpriv mode | |
274 | ta T_CHANGE_HPRIV | |
275 | !# Check to make sure pic is zero | |
276 | rd %pic, %g4 | |
277 | cmp %g0, %g4 | |
278 | bne,pn %icc, fail | |
279 | nop | |
280 | ||
281 | !# Setup PCR Register | |
282 | set 0x0000000020414408, %g2 | |
283 | wr %g2, %g0, %pcr | |
284 | ||
285 | or %g0, %g0, %g3 | |
286 | ccx_st_th4: | |
287 | umul %g3, 32, %g4 | |
288 | setx DATA_0x0, %g1, %l5 | |
289 | stx %g3, [%l5 + %g4] | |
290 | add %g3, 1 , %g3 | |
291 | cmp %g3, PIC_COUNT_th4 | |
292 | bne,pn %xcc, ccx_st_th4 | |
293 | nop | |
294 | ||
295 | membar #Sync | |
296 | ||
297 | check_pic_th4: | |
298 | rd %pic, %g4 | |
299 | mov %g4, %i7 | |
300 | cmp %g4, PIC_COUNT_th4 | |
301 | bne,pn %icc, fail | |
302 | nop | |
303 | ||
304 | check_pic1_isZero_th4: | |
305 | setx 0xffffffff00000000, %l5, %l0 | |
306 | and %i7, %l0, %i7 | |
307 | cmp %i7, 0x0 | |
308 | bne,pn %icc, fail | |
309 | nop | |
310 | ||
311 | EXIT_GOOD | |
312 | ||
313 | thread_5: | |
314 | ||
315 | setx 0x0000deadbeefbad0, %l5, %l4 | |
316 | ||
317 | !# Switch to hpriv mode | |
318 | ta T_CHANGE_HPRIV | |
319 | !# Check to make sure pic is zero | |
320 | rd %pic, %g4 | |
321 | cmp %g0, %g4 | |
322 | bne,pn %icc, fail | |
323 | nop | |
324 | ||
325 | !# Setup PCR Register | |
326 | set 0x0000000020414408, %g2 | |
327 | wr %g2, %g0, %pcr | |
328 | ||
329 | or %g0, %g0, %g3 | |
330 | ccx_st_th5: | |
331 | umul %g3, 32, %g4 | |
332 | setx DATA_0x0, %g1, %l5 | |
333 | stx %g3, [%l5 + %g4] | |
334 | add %g3, 1 , %g3 | |
335 | cmp %g3, PIC_COUNT_th5 | |
336 | bne,pn %xcc, ccx_st_th5 | |
337 | nop | |
338 | ||
339 | membar #Sync | |
340 | ||
341 | check_pic_th5: | |
342 | rd %pic, %g4 | |
343 | mov %g4, %i7 | |
344 | cmp %g4, PIC_COUNT_th5 | |
345 | bne,pn %icc, fail | |
346 | nop | |
347 | ||
348 | check_pic1_isZero_th5: | |
349 | setx 0xffffffff00000000, %l5, %l0 | |
350 | and %i7, %l0, %i7 | |
351 | cmp %i7, 0x0 | |
352 | bne,pn %icc, fail | |
353 | nop | |
354 | ||
355 | EXIT_GOOD | |
356 | ||
357 | thread_6: | |
358 | ||
359 | setx 0x0000deadbeefbad0, %l5, %l4 | |
360 | ||
361 | !# Switch to hpriv mode | |
362 | ta T_CHANGE_HPRIV | |
363 | !# Check to make sure pic is zero | |
364 | rd %pic, %g4 | |
365 | cmp %g0, %g4 | |
366 | bne,pn %icc, fail | |
367 | nop | |
368 | ||
369 | !# Setup PCR Register | |
370 | set 0x0000000020414408, %g2 | |
371 | wr %g2, %g0, %pcr | |
372 | ||
373 | or %g0, %g0, %g3 | |
374 | ccx_st_th6: | |
375 | umul %g3, 32, %g4 | |
376 | setx DATA_0x0, %g1, %l5 | |
377 | stx %g3, [%l5 + %g4] | |
378 | add %g3, 1 , %g3 | |
379 | cmp %g3, PIC_COUNT_th6 | |
380 | bne,pn %xcc, ccx_st_th6 | |
381 | nop | |
382 | ||
383 | membar #Sync | |
384 | ||
385 | check_pic_th6: | |
386 | rd %pic, %g4 | |
387 | mov %g4, %i7 | |
388 | cmp %g4, PIC_COUNT_th6 | |
389 | bne,pn %icc, fail | |
390 | nop | |
391 | ||
392 | check_pic1_isZero_th6: | |
393 | setx 0xffffffff00000000, %l5, %l0 | |
394 | and %i7, %l0, %i7 | |
395 | cmp %i7, 0x0 | |
396 | bne,pn %icc, fail | |
397 | nop | |
398 | ||
399 | EXIT_GOOD | |
400 | ||
401 | thread_7: | |
402 | ||
403 | setx 0x0000deadbeefbad0, %l5, %l4 | |
404 | ||
405 | !# Switch to hpriv mode | |
406 | ta T_CHANGE_HPRIV | |
407 | !# Check to make sure pic is zero | |
408 | rd %pic, %g4 | |
409 | cmp %g0, %g4 | |
410 | bne,pn %icc, fail | |
411 | nop | |
412 | ||
413 | !# Setup PCR Register | |
414 | set 0x0000000020414408, %g2 | |
415 | wr %g2, %g0, %pcr | |
416 | ||
417 | or %g0, %g0, %g3 | |
418 | ccx_st_th7: | |
419 | umul %g3, 32, %g4 | |
420 | setx DATA_0x0, %g1, %l5 | |
421 | stx %g3, [%l5 + %g4] | |
422 | add %g3, 1 , %g3 | |
423 | cmp %g3, PIC_COUNT_th7 | |
424 | bne,pn %xcc, ccx_st_th7 | |
425 | nop | |
426 | ||
427 | membar #Sync | |
428 | ||
429 | check_pic_th7: | |
430 | rd %pic, %g4 | |
431 | mov %g4, %i7 | |
432 | cmp %g4, PIC_COUNT_th7 | |
433 | bne,pn %icc, fail | |
434 | nop | |
435 | ||
436 | check_pic1_isZero_th7: | |
437 | setx 0xffffffff00000000, %l5, %l0 | |
438 | and %i7, %l0, %i7 | |
439 | cmp %i7, 0x0 | |
440 | bne,pn %icc, fail | |
441 | nop | |
442 | ||
443 | EXIT_GOOD | |
444 | ||
445 | fail: | |
446 | EXIT_BAD | |
447 | ||
448 | .data | |
449 | user_data_start: | |
450 | scratch_area: | |
451 | ||
452 | .align 32 | |
453 | DATA_0x0: | |
454 | .xword 0x0000000000000000 | |
455 | ||
456 | .align 32 | |
457 | DATA_0x1: | |
458 | .xword 0x1111111111111111 | |
459 | ||
460 | .align 32 | |
461 | DATA_0x2: | |
462 | .xword 0x2222222222222222 | |
463 | ||
464 | .align 32 | |
465 | DATA_0x3: | |
466 | .xword 0x3333333333333333 | |
467 | ||
468 | .align 32 | |
469 | DATA_0x4: | |
470 | .xword 0x4444444444444444 | |
471 | ||
472 | .align 32 | |
473 | DATA_0x5: | |
474 | .xword 0x5555555555555555 | |
475 | ||
476 | .align 32 | |
477 | DATA_0x6: | |
478 | .xword 0x6666666666666666 | |
479 | ||
480 | .align 32 | |
481 | DATA_0x7: | |
482 | .xword 0x7777777777777777 | |
483 | ||
484 | .align 32 | |
485 | DATA_0x8: | |
486 | .xword 0x8888888888888888 | |
487 | ||
488 | .align 32 | |
489 | DATA_0x9: | |
490 | .xword 0x9999999999999999 | |
491 | ||
492 | .align 32 | |
493 | DATA_0xa: | |
494 | .xword 0xaaaaaaaaaaaaaaaa | |
495 | ||
496 | .align 32 | |
497 | DATA_0xb: | |
498 | .xword 0xbbbbbbbbbbbbbbbb | |
499 | ||
500 | .align 32 | |
501 | DATA_0xc: | |
502 | .xword 0xcccccccccccccccc | |
503 | ||
504 | .align 32 | |
505 | DATA_0xd: | |
506 | .xword 0xdddddddddddddddd | |
507 | ||
508 | .align 32 | |
509 | DATA_0xe: | |
510 | .xword 0xeeeeeeeeeeeeeeee | |
511 | ||
512 | .align 32 | |
513 | DATA_0xf: | |
514 | .xword 0xffffffffffffffff | |
515 | ||
516 | .end | |
517 | ||
518 | #if 0 | |
519 | #endif |