Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: err_sca_diag.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 MY_HP_TEXT_PA 0x1050000000 | |
39 | #define MY_HP_DATA_PA 0x1050001000 | |
40 | ||
41 | #define ASI_PRIMARY_CONTEXT_0 0x21 | |
42 | #define ASI_ITLB_DATA_IN_REG 0x54 | |
43 | #define ASI_DMMU_TAG_ACCESS 0x58 | |
44 | #define ASI_DTLB_DATA_IN_REG 0x5c | |
45 | #define ASI_DMMU_SFAR 0x58 | |
46 | ||
47 | ||
48 | #define MY_USER_TEXT_VA000 0x7a000000 | |
49 | #define MY_USER_TEXT_RA000 0x7b000000 | |
50 | #define MY_USER_TEXT_PA000 0x107b000000 | |
51 | #define MY_USER_TEXT_VA001 0x7a010000 | |
52 | #define MY_USER_TEXT_RA001 0x7b010000 | |
53 | #define MY_USER_TEXT_PA001 0x107b010000 | |
54 | #define MY_USER_TEXT_VA002 0x7a020000 | |
55 | #define MY_USER_TEXT_RA002 0x7b020000 | |
56 | #define MY_USER_TEXT_PA002 0x107b020000 | |
57 | #define MY_USER_TEXT_VA003 0x7a030000 | |
58 | #define MY_USER_TEXT_RA003 0x7b030000 | |
59 | #define MY_USER_TEXT_PA003 0x107b030000 | |
60 | #define MY_USER_TEXT_VA004 0x7a040000 | |
61 | #define MY_USER_TEXT_RA004 0x7b040000 | |
62 | #define MY_USER_TEXT_PA004 0x107b040000 | |
63 | #define MY_USER_TEXT_VA005 0x7a050000 | |
64 | #define MY_USER_TEXT_RA005 0x7b050000 | |
65 | #define MY_USER_TEXT_PA005 0x107b050000 | |
66 | ||
67 | #define MY_USER_DATA_VA000 0x6a000000 | |
68 | #define MY_USER_DATA_RA000 0x6b000000 | |
69 | #define MY_USER_DATA_PA000 0x106b000000 | |
70 | #define MY_USER_DATA_VA001 0x6a010000 | |
71 | #define MY_USER_DATA_RA001 0x6b010000 | |
72 | #define MY_USER_DATA_PA001 0x106b010000 | |
73 | #define MY_USER_DATA_VA002 0x6a020000 | |
74 | #define MY_USER_DATA_RA002 0x6b020000 | |
75 | #define MY_USER_DATA_PA002 0x106b020000 | |
76 | #define MY_USER_DATA_VA003 0x6a030000 | |
77 | #define MY_USER_DATA_RA003 0x6b030000 | |
78 | #define MY_USER_DATA_PA003 0x106b030000 | |
79 | #define MY_USER_DATA_VA004 0x6a040000 | |
80 | #define MY_USER_DATA_RA004 0x6b040000 | |
81 | #define MY_USER_DATA_PA004 0x106b040000 | |
82 | #define MY_USER_DATA_VA005 0x6a050000 | |
83 | #define MY_USER_DATA_RA005 0x6b050000 | |
84 | #define MY_USER_DATA_PA005 0x106b050000 | |
85 | ||
86 | #define IMDU_ERR_EN 0xa0000000 | |
87 | #define IMTU_ERR_EN 0x90000000 | |
88 | #define DMDU_ERR_EN 0x88000000 | |
89 | #define DMTU_ERR_EN 0x84000000 | |
90 | #define IRCU_ERR_EN 0x82000000 | |
91 | #define FRCU_ERR_EN 0x81000000 | |
92 | #define SCAU_ERR_EN 0x80800000 | |
93 | #define TCCU_ERR_EN 0x80400000 | |
94 | #define TSAU_ERR_EN 0x80200000 | |
95 | #define MRAU_ERR_EN 0x80100000 | |
96 | #define STAU_ERR_EN 0x80080000 | |
97 | #define STDU_ERR_EN 0x80020000 | |
98 | ||
99 | #define ASI_DESR 0x4c | |
100 | #define ASI_DFESR 0x4c | |
101 | #define DFESR_VA 0x8 | |
102 | #define ASI_DSFSR 0x58 | |
103 | #define ASI_ISFSR 0x50 | |
104 | #define SFSR_VA 0x18 | |
105 | #define ASI_SFAR 0x58 | |
106 | #define SFAR_VA 0x20 | |
107 | #define ASI_ERR_INJ 0x43 | |
108 | #define ASI_CETER 0x4C | |
109 | #define CETER_VA 0x18 | |
110 | #define ASI_CERER 0x4C | |
111 | #define CERER_VA 0x10 | |
112 | ||
113 | #define CERER_SBDPC 0x400 | |
114 | #define CETER_DHCCE 0x1000000000000000 | |
115 | #define CETER_DE 0x2000000000000000 | |
116 | #define CETER_PSCCE 0x4000000000000000 | |
117 | #define DCVP_ERR_TYPE 0x5 | |
118 | #define SCAC_ERR_TYPE 0xa | |
119 | ||
120 | #define MAIN_PAGE_HV_ALSO | |
121 | ||
122 | #define H_HT0_Mem_Address_Not_Aligned_0x34 | |
123 | #define My_HT0_Mem_Address_Not_Aligned_0x34 \ | |
124 | add %g0, CERER_VA, %g3; \ | |
125 | set SCAU_ERR_EN, %g1; \ | |
126 | or %g1, %l2, %g1 ;\ | |
127 | stxa %g1, [%g0]ASI_ERR_INJ;\ | |
128 | done;nop | |
129 | ||
130 | #define H_HT0_Internal_Processor_Error_0x29 | |
131 | #define SUN_H_HT0_Internal_Processor_Error_0x29 \ | |
132 | ba INT_PROC_ERR_HANDLER; \ | |
133 | nop;nop;nop;nop;nop;nop;nop | |
134 | ||
135 | #include "hboot.s" | |
136 | ||
137 | /************************************************************************ | |
138 | Test case: | |
139 | ************************************************************************/ | |
140 | ||
141 | .text | |
142 | .global main | |
143 | ||
144 | main: /* test begin */ | |
145 | ta T_CHANGE_HPRIV | |
146 | ||
147 | !! set CERER.SCAC | |
148 | setx 0x40000000, %g1, %o2 !! enable scac errs | |
149 | add %g0, CERER_VA, %g3 !!g3 has cerer va | |
150 | ||
151 | stxa %o2, [%g3]ASI_CERER | |
152 | ||
153 | !! set CETER.DHCCE | |
154 | setx CETER_PSCCE, %l0, %o2 | |
155 | add %g0, CETER_VA, %g3 | |
156 | stxa %o2, [%g3]ASI_CETER | |
157 | ||
158 | add %g0, 1, %l2 !! mask | |
159 | ||
160 | !! Enable error injection | |
161 | set SCAU_ERR_EN, %l1 | |
162 | or %l1, %l2, %l1 ! set mask bit 0 to 1 | |
163 | stxa %l1, [%g0]ASI_ERR_INJ | |
164 | ||
165 | ta T_CHANGE_NONHPRIV | |
166 | ||
167 | ta T_CHANGE_PRIV | |
168 | mov %g0, %i0 | |
169 | add %g0, 1, %l1 | |
170 | mov %g0, %i1 | |
171 | add %g0, 0x20, %o4 !! asi to clear the err in trap handler | |
172 | setx user_data_begin_000, %g1, %l4 | |
173 | setx user_code_begin_000, %g1, %g2 | |
174 | ||
175 | jmp %g2 | |
176 | mov %g0, %o3 | |
177 | EXIT_BAD | |
178 | ||
179 | /* | |
180 | begin_thread_1: | |
181 | add %g0, 4, %i7 | |
182 | setx THS_START, %g1, %g2 | |
183 | jmp %g2 | |
184 | nop | |
185 | EXIT_BAD | |
186 | ||
187 | begin_thread_2: | |
188 | add %g0, 8, %i7 | |
189 | setx THS_START, %g1, %g2 | |
190 | jmp %g2 | |
191 | nop | |
192 | EXIT_BAD | |
193 | */ | |
194 | ||
195 | /************************************************************************ | |
196 | Test case data start | |
197 | ************************************************************************/ | |
198 | .data | |
199 | .global user_data_start | |
200 | user_data_start: | |
201 | .word 0x12345678 | |
202 | .word 0x9a9b9c9d | |
203 | .word 0x00000000 | |
204 | .word 0xffffffff | |
205 | .word 0x12345678 | |
206 | .word 0x9a9b9c9d | |
207 | .word 0x00000000 | |
208 | .word 0xffffffff | |
209 | ||
210 | !#*********************************************************************** | |
211 | ||
212 | SECTION .My_User_Section_4v000 TEXT_VA=MY_USER_TEXT_VA000, DATA_VA=MY_USER_DATA_VA000 | |
213 | attr_text { | |
214 | Name = .My_User_Section_4v000, | |
215 | part_0_ctx_nonzero_tsb_config_2, | |
216 | VA = MY_USER_TEXT_VA000, | |
217 | RA = MY_USER_TEXT_RA000, | |
218 | PA = ra2pa(MY_USER_TEXT_RA000, 0), | |
219 | TTE_Context = PCONTEXT, | |
220 | TTE_V = 1, | |
221 | TTE_NFO = 0, | |
222 | TTE_L = 0, | |
223 | TTE_Soft = 0, | |
224 | TTE_IE = 0, | |
225 | TTE_E = 0, | |
226 | TTE_CP = 1, | |
227 | TTE_CV = 0, | |
228 | TTE_P = 0, | |
229 | TTE_EP = 1, | |
230 | TTE_W = 0, | |
231 | TTE_SW1 = 0, | |
232 | TTE_SW0 = 0, | |
233 | TTE_RSVD1 = 0, | |
234 | TTE_Size = 0, | |
235 | } | |
236 | attr_text { | |
237 | NAME = .My_User_Section_4v000, | |
238 | hypervisor | |
239 | } | |
240 | .text | |
241 | .global user_code_begin_000 | |
242 | user_code_begin_000: | |
243 | ldx [%l4 + %i1], %i2 !! data to be stored in scratchpad | |
244 | stxa %i2, [%g0 + %i1]0x20 | |
245 | ldxa [%g0 + %i1]0x20, %i3 !! error is precise | |
246 | cmp %i3, %i2 | |
247 | bne FAIL | |
248 | cmp %i0, %l1 | |
249 | bne FAIL | |
250 | mov %g0, %i0 | |
251 | add %i1, 8, %i1 | |
252 | cmp %i1, 0x20 | |
253 | be,a .+8 | |
254 | add %g0, 0x30, %i1 | |
255 | cmp %i1, 0x38 | |
256 | ble user_code_begin_000 | |
257 | nop | |
258 | ||
259 | LOOP_000: | |
260 | add %o3, 8, %o3 !! pt o3 to next location of the ecc value | |
261 | mov %g0, %i1 | |
262 | sll %l2, 1, %l2 | |
263 | cmp %l2, 0x80 | |
264 | !be,a .+8 | |
265 | !mov %g0, %l1 !! no trap if error in bit 7 of syndrome | |
266 | ble user_code_begin_000 | |
267 | ldx [%l4 + 0x2], %i2 ! mem_aligned trap to change the mask in err_inject_reg | |
268 | ||
269 | setx user_code_begin_001, %g1, %g2 | |
270 | jmp %g2 | |
271 | nop | |
272 | ||
273 | FAIL: | |
274 | EXIT_BAD | |
275 | ||
276 | attr_data { | |
277 | Name = .My_User_Section_4v000, | |
278 | part_0_ctx_nonzero_tsb_config_1, | |
279 | VA = MY_USER_DATA_VA000, | |
280 | RA = MY_USER_DATA_RA000, | |
281 | PA = ra2pa(MY_USER_DATA_RA000, 0), | |
282 | TTE_Context = PCONTEXT, | |
283 | TTE_V = 1, | |
284 | TTE_NFO = 0, | |
285 | TTE_L = 0, | |
286 | TTE_Soft = 0, | |
287 | TTE_IE = 0, | |
288 | TTE_E = 0, | |
289 | TTE_CP = 1, | |
290 | TTE_CV = 0, | |
291 | TTE_P = 0, | |
292 | TTE_EP = 0, | |
293 | TTE_W = 1, | |
294 | TTE_SW1 = 0, | |
295 | TTE_SW0 = 0, | |
296 | TTE_RSVD1 = 0, | |
297 | TTE_Size = 0, | |
298 | } | |
299 | attr_data { | |
300 | NAME = .My_User_Section_4v000, | |
301 | hypervisor | |
302 | } | |
303 | .data | |
304 | .global user_data_begin_000 | |
305 | user_data_begin_000: | |
306 | .xword 0xe0066361bd9fcb86 | |
307 | .xword 0xea22901c101f6f52 | |
308 | .xword 0x806faa2171350467 | |
309 | .xword 0xff54f2cd06a0d342 | |
310 | .xword 0x566bff718cddb905 | |
311 | .xword 0x6d367bc4d165d37a | |
312 | .xword 0x5efc42b18f920522 | |
313 | .xword 0x584c92dec4bc66de | |
314 | ||
315 | .xword 0xed9efe0d05896ce1 | |
316 | ||
317 | .xword 0xf9d45b94972117c8 | |
318 | ||
319 | .xword 0xd0c647618c9e43f3 | |
320 | ||
321 | .xword 0xfe04ead3b77c2d11 | |
322 | ||
323 | .xword 0x06d2d7f29e76397c | |
324 | ||
325 | .xword 0x234c366110eddd38 | |
326 | ||
327 | .xword 0xa80656d4288044bc | |
328 | ||
329 | .xword 0x12e763fbd8e2970d | |
330 | ||
331 | .xword 0x7320217fab3eae0e | |
332 | ||
333 | .xword 0x38683cebedefb5af | |
334 | ||
335 | ||
336 | SECTION .My_User_Section_4v001 TEXT_VA=MY_USER_TEXT_VA001, DATA_VA=MY_USER_DATA_VA001 | |
337 | attr_text { | |
338 | Name = .My_User_Section_4v001, | |
339 | part_0_ctx_nonzero_tsb_config_2, | |
340 | VA = MY_USER_TEXT_VA001, | |
341 | RA = MY_USER_TEXT_RA001, | |
342 | PA = ra2pa(MY_USER_TEXT_RA001, 0), | |
343 | TTE_Context = PCONTEXT, | |
344 | TTE_V = 1, | |
345 | TTE_NFO = 0, | |
346 | TTE_L = 0, | |
347 | TTE_Soft = 0, | |
348 | TTE_IE = 0, | |
349 | TTE_E = 0, | |
350 | TTE_CP = 1, | |
351 | TTE_CV = 0, | |
352 | TTE_P = 0, | |
353 | TTE_EP = 1, | |
354 | TTE_W = 0, | |
355 | TTE_SW1 = 0, | |
356 | TTE_SW0 = 0, | |
357 | TTE_RSVD1 = 0, | |
358 | TTE_Size = 0, | |
359 | } | |
360 | attr_text { | |
361 | NAME = .My_User_Section_4v001, | |
362 | hypervisor | |
363 | } | |
364 | .text | |
365 | .global user_code_begin_001 | |
366 | user_code_begin_001: | |
367 | ta T_CHANGE_HPRIV | |
368 | add %g0, 1, %l2 !! mask | |
369 | mov %g0, %o3 | |
370 | ||
371 | !! Enable error injection | |
372 | set SCAU_ERR_EN, %l3 | |
373 | or %l3, %l2, %l3 | |
374 | stxa %l3, [%g0]ASI_ERR_INJ | |
375 | setx user_data_begin_001, %g1, %l4 | |
376 | mov %g0, %i1 | |
377 | add %g0, 1, %l1 | |
378 | add %g0, 0x40, %o4 !! asi to clear the err in trap handler | |
379 | ||
380 | START: | |
381 | ldx [%l4 + %i1], %i2 !! data to be stored in scratchpad | |
382 | stxa %i2, [%g0 + %i1]0x4F | |
383 | ldxa [%g0 + %i1]0x4F, %i3 !! error is precise | |
384 | cmp %i3, %i2 | |
385 | bne FAIL | |
386 | cmp %i0, %l1 | |
387 | bne FAIL | |
388 | mov %g0, %i0 | |
389 | add %i1, 8, %i1 | |
390 | cmp %i1, 0x38 | |
391 | ble START | |
392 | nop | |
393 | ||
394 | LOOP_001: | |
395 | add %o3, 8, %o3 | |
396 | set SCAU_ERR_EN, %l3 | |
397 | mov %g0, %i1 | |
398 | sll %l2, 1, %l2 | |
399 | or %l3, %l2, %l3 | |
400 | cmp %l2, 0x80 | |
401 | !be,a .+8 | |
402 | !mov %g0, %l1 | |
403 | ble START | |
404 | stxa %l3, [%g0]ASI_ERR_INJ | |
405 | ||
406 | setx user_code_begin_002, %g1, %g2 | |
407 | jmp %g2 | |
408 | ||
409 | ||
410 | FAIL: | |
411 | EXIT_BAD | |
412 | nop | |
413 | ||
414 | attr_data { | |
415 | Name = .My_User_Section_4v001, | |
416 | part_0_ctx_nonzero_tsb_config_1, | |
417 | VA = MY_USER_DATA_VA001, | |
418 | RA = MY_USER_DATA_RA001, | |
419 | PA = ra2pa(MY_USER_DATA_RA001, 0), | |
420 | TTE_Context = PCONTEXT, | |
421 | TTE_V = 1, | |
422 | TTE_NFO = 0, | |
423 | TTE_L = 0, | |
424 | TTE_Soft = 0, | |
425 | TTE_IE = 0, | |
426 | TTE_E = 0, | |
427 | TTE_CP = 1, | |
428 | TTE_CV = 0, | |
429 | TTE_P = 0, | |
430 | TTE_EP = 0, | |
431 | TTE_W = 1, | |
432 | TTE_SW1 = 0, | |
433 | TTE_SW0 = 0, | |
434 | TTE_RSVD1 = 0, | |
435 | TTE_Size = 0, | |
436 | } | |
437 | attr_data { | |
438 | NAME = .My_User_Section_4v001, | |
439 | hypervisor | |
440 | } | |
441 | .data | |
442 | .global user_data_begin_001 | |
443 | user_data_begin_001: | |
444 | .xword 0xe0066361bd9fcb86 | |
445 | .xword 0xfa474991f13e3460 | |
446 | .xword 0x1446415baecf3609 | |
447 | .xword 0xe3215e901114ad4b | |
448 | .xword 0xf91d897e92d1ee95 | |
449 | .xword 0x33458a48805d888b | |
450 | .xword 0x7f5a3ddb7d8e3c23 | |
451 | .xword 0xaa80311fb1e17e79 | |
452 | .xword 0x0f59d0e1ac35dbd4 | |
453 | .xword 0x057c893bc8fc1e7e | |
454 | .xword 0xcfb9e3a29c786cc0 | |
455 | .xword 0x7257becb4609969e | |
456 | .xword 0x4b1896677e83abae | |
457 | .xword 0xc2e35a285574f037 | |
458 | .xword 0x2e42eb5835020e2e | |
459 | .xword 0x90775b99929f43cc | |
460 | .xword 0x9fac4ae85a4ecd4e | |
461 | ||
462 | .word 0x10731 | |
463 | .word 0xd027 | |
464 | .word 0x1350e | |
465 | .word 0x10e9d | |
466 | ||
467 | ||
468 | SECTION .My_User_Section_4v002 TEXT_VA=MY_USER_TEXT_VA002, DATA_VA=MY_USER_DATA_VA002 | |
469 | attr_text { | |
470 | Name = .My_User_Section_4v002, | |
471 | part_0_ctx_nonzero_tsb_config_2, | |
472 | VA = MY_USER_TEXT_VA002, | |
473 | RA = MY_USER_TEXT_RA002, | |
474 | PA = ra2pa(MY_USER_TEXT_RA002, 0), | |
475 | TTE_Context = PCONTEXT, | |
476 | TTE_V = 1, | |
477 | TTE_NFO = 0, | |
478 | TTE_L = 0, | |
479 | TTE_Soft = 0, | |
480 | TTE_IE = 0, | |
481 | TTE_E = 0, | |
482 | TTE_CP = 1, | |
483 | TTE_CV = 0, | |
484 | TTE_P = 0, | |
485 | TTE_EP = 1, | |
486 | TTE_W = 0, | |
487 | TTE_SW1 = 0, | |
488 | TTE_SW0 = 0, | |
489 | TTE_RSVD1 = 0, | |
490 | TTE_Size = 0, | |
491 | } | |
492 | attr_text { | |
493 | NAME = .My_User_Section_4v002, | |
494 | hypervisor | |
495 | } | |
496 | .text | |
497 | .global user_code_begin_002 | |
498 | user_code_begin_002: | |
499 | add %g0, 1, %l2 | |
500 | set SCAU_ERR_EN, %l3 | |
501 | or %l3, %l2, %l3 | |
502 | stxa %l3, [%g0]ASI_ERR_INJ | |
503 | mov %g0, %i1 | |
504 | setx user_data_begin_002, %g1, %l4 | |
505 | add %g0, 1, %l1 | |
506 | mov %g0, %o3 | |
507 | set 0xffffff00, %g1 | |
508 | add %g0, 0x40, %o4 !! asi to clear the err in trap handler | |
509 | ||
510 | ST0: | |
511 | ldx [%l4 + %i1], %i2 !! data to be stored in scratchpad | |
512 | stxa %i2, [%g0 + %i1]0x4F | |
513 | sll %l2, 1, %l2 | |
514 | and %l3, %g1, %l3 | |
515 | or %l3, %l2, %l3 | |
516 | add %i1, 8, %i1 | |
517 | cmp %i1, 0x38 | |
518 | ble ST0 | |
519 | stxa %l3, [%g0]ASI_ERR_INJ | |
520 | ||
521 | mov %g0, %i1 | |
522 | add %g0, 1, %l2 | |
523 | LD0: | |
524 | ldx [%l4 + %i1], %i2 | |
525 | ldxa [%g0 + %i1]0x4F, %i3 !! error is precise | |
526 | cmp %i0, %l1 | |
527 | bne FAIL | |
528 | mov %g0, %i0 | |
529 | sll %l2, 1, %l2 | |
530 | add %o3, 8, %o3 | |
531 | cmp %i1, 0x30 | |
532 | ble LD0 | |
533 | add %i1, 8, %i1 | |
534 | ||
535 | setx user_code_begin_003, %g1, %g2 | |
536 | jmp %g2 | |
537 | nop | |
538 | ||
539 | FAIL: | |
540 | EXIT_BAD | |
541 | nop | |
542 | ||
543 | attr_data { | |
544 | Name = .My_User_Section_4v002, | |
545 | part_0_ctx_nonzero_tsb_config_1, | |
546 | VA = MY_USER_DATA_VA002, | |
547 | RA = MY_USER_DATA_RA002, | |
548 | PA = ra2pa(MY_USER_DATA_RA002, 0), | |
549 | TTE_Context = PCONTEXT, | |
550 | TTE_V = 1, | |
551 | TTE_NFO = 0, | |
552 | TTE_L = 0, | |
553 | TTE_Soft = 0, | |
554 | TTE_IE = 0, | |
555 | TTE_E = 0, | |
556 | TTE_CP = 1, | |
557 | TTE_CV = 0, | |
558 | TTE_P = 0, | |
559 | TTE_EP = 0, | |
560 | TTE_W = 1, | |
561 | TTE_SW1 = 0, | |
562 | TTE_SW0 = 0, | |
563 | TTE_RSVD1 = 0, | |
564 | TTE_Size = 0, | |
565 | } | |
566 | attr_data { | |
567 | NAME = .My_User_Section_4v002, | |
568 | hypervisor | |
569 | } | |
570 | .data | |
571 | .global user_data_begin_002 | |
572 | user_data_begin_002: | |
573 | .xword 0x050a211e918857f3 | |
574 | .xword 0x7980bbbf09b95bba | |
575 | .xword 0x55f410e2b57433f6 | |
576 | .xword 0x106c3aa95e2aa3c3 | |
577 | .xword 0xbcb980bc1bb072d8 | |
578 | .xword 0x63da435c10b717dd | |
579 | .xword 0x375d99be87bef073 | |
580 | .xword 0x03a5206ac6d08fd2 | |
581 | .xword 0xfa474991f13e3460 | |
582 | .xword 0x1446415baecf3609 | |
583 | .xword 0xe3215e901114ad4b | |
584 | .xword 0xf91d897e92d1ee95 | |
585 | .xword 0x33458a48805d888b | |
586 | .xword 0x7f5a3ddb7d8e3c23 | |
587 | .xword 0xaa80311fb1e17e79 | |
588 | .xword 0x0f59d0e1ac35dbd4 | |
589 | ||
590 | .word 0x1eb9 | |
591 | .word 0x43ec | |
592 | .word 0xc619 | |
593 | .word 0x11a06 | |
594 | ||
595 | ||
596 | SECTION .My_User_Section_4v003 TEXT_VA=MY_USER_TEXT_VA003, DATA_VA=MY_USER_DATA_VA003 | |
597 | attr_text { | |
598 | Name = .My_User_Section_4v003, | |
599 | part_0_ctx_nonzero_tsb_config_2, | |
600 | VA = MY_USER_TEXT_VA003, | |
601 | RA = MY_USER_TEXT_RA003, | |
602 | PA = ra2pa(MY_USER_TEXT_RA003, 0), | |
603 | TTE_Context = PCONTEXT, | |
604 | TTE_V = 1, | |
605 | TTE_NFO = 0, | |
606 | TTE_L = 0, | |
607 | TTE_Soft = 0, | |
608 | TTE_IE = 0, | |
609 | TTE_E = 0, | |
610 | TTE_CP = 1, | |
611 | TTE_CV = 0, | |
612 | TTE_P = 0, | |
613 | TTE_EP = 1, | |
614 | TTE_W = 0, | |
615 | TTE_SW1 = 0, | |
616 | TTE_SW0 = 0, | |
617 | TTE_RSVD1 = 0, | |
618 | TTE_Size = 0, | |
619 | } | |
620 | attr_text { | |
621 | NAME = .My_User_Section_4v003, | |
622 | hypervisor | |
623 | } | |
624 | !! Chk that no err is seen on a write. | |
625 | !! Also no err is falgged on a diagnostic read. | |
626 | .text | |
627 | .global user_code_begin_003 | |
628 | user_code_begin_003: | |
629 | add %g0, 1, %l2 | |
630 | set SCAU_ERR_EN, %l3 | |
631 | or %l3, %l2, %l3 | |
632 | stxa %l3, [%g0]ASI_ERR_INJ | |
633 | mov %g0, %i1 | |
634 | mov %g0, %l1 | |
635 | mov %g0, %i3 | |
636 | mov %g0, %i0 | |
637 | setx user_data_begin_003, %g1, %l4 | |
638 | set 0xffffff00, %g1 | |
639 | ||
640 | ST1: | |
641 | ldx [%l4 + %i1], %i2 !! data to be stored in scratchpad | |
642 | stxa %i2, [%g0 + %i1]0x4F | |
643 | sll %l2, 1, %l2 | |
644 | and %l3, %g1, %l3 | |
645 | or %l3, %l2, %l3 | |
646 | add %i1, 8, %i1 | |
647 | cmp %i1, 0x38 | |
648 | ble ST1 | |
649 | stxa %l3, [%g0]ASI_ERR_INJ | |
650 | ||
651 | add %g0, 1, %l2 | |
652 | and %l3, %g1, %l3 | |
653 | or %l3, %l2, %l3 | |
654 | stxa %l3, [%g0]ASI_ERR_INJ | |
655 | mov %g0, %i1 | |
656 | cmp %i3, 0x0 | |
657 | be ST1 | |
658 | add %i3, 1, %i3 | |
659 | ||
660 | brnz %i0, FAIL | |
661 | mov %g0, %i0 | |
662 | ||
663 | !! ALL scratch pad entries have errors. Do a diagnostic read from all entries | |
664 | !!and see that no error is flagged. | |
665 | mov %g0, %i1 | |
666 | mov %g0, %l1 | |
667 | mov %g0, %i3 | |
668 | mov %g0, %i0 | |
669 | ||
670 | LD1: | |
671 | ldxa [%g0 + %i1]0x59, %o3 !! read the ecc | |
672 | add %i1, 0x40, %g1 | |
673 | ldxa [%g1]0x59, %g3 !! read the data | |
674 | brnz %i0, FAIL | |
675 | mov %g0, %i0 | |
676 | cmp %i1, 0x30 | |
677 | ble LD1 | |
678 | add %i1, 8, %i1 | |
679 | ||
680 | setx user_code_begin_004, %g1, %g2 | |
681 | jmp %g2 | |
682 | nop | |
683 | ||
684 | FAIL: | |
685 | EXIT_BAD | |
686 | nop | |
687 | ||
688 | attr_data { | |
689 | Name = .My_User_Section_4v003, | |
690 | part_0_ctx_nonzero_tsb_config_1, | |
691 | VA = MY_USER_DATA_VA003, | |
692 | RA = MY_USER_DATA_RA003, | |
693 | PA = ra2pa(MY_USER_DATA_RA003, 0), | |
694 | TTE_Context = PCONTEXT, | |
695 | TTE_V = 1, | |
696 | TTE_NFO = 0, | |
697 | TTE_L = 0, | |
698 | TTE_Soft = 0, | |
699 | TTE_IE = 0, | |
700 | TTE_E = 0, | |
701 | TTE_CP = 1, | |
702 | TTE_CV = 0, | |
703 | TTE_P = 0, | |
704 | TTE_EP = 0, | |
705 | TTE_W = 1, | |
706 | TTE_SW1 = 0, | |
707 | TTE_SW0 = 0, | |
708 | TTE_RSVD1 = 0, | |
709 | TTE_Size = 0, | |
710 | } | |
711 | attr_data { | |
712 | NAME = .My_User_Section_4v003, | |
713 | hypervisor | |
714 | } | |
715 | .data | |
716 | .global user_data_begin_003 | |
717 | user_data_begin_003: | |
718 | .xword 0xca12fd23b5b1b1d6 | |
719 | .xword 0x3428a18f797bd42a | |
720 | .xword 0x0d0630dd16ca2db5 | |
721 | .xword 0x281c49cf3f51a83f | |
722 | .xword 0x8fc66b8940c55c03 | |
723 | .xword 0xfd6f2a2b60aee94c | |
724 | .xword 0xec72846b0261894e | |
725 | .xword 0xf1bd6c544120f822 | |
726 | ||
727 | .xword 0xefc4e1f1b35853fc | |
728 | .xword 0xe790a0c1689eb683 | |
729 | .xword 0x88c650f170c41710 | |
730 | .xword 0x614126cf9fc8dca3 | |
731 | .xword 0x4be2f60911e465ce | |
732 | .xword 0x4e22352a0c29c95c | |
733 | .xword 0xf18efdf01ce79e24 | |
734 | .xword 0x294aaa56144d7cf1 | |
735 | ||
736 | .word 0xdfaa | |
737 | .word 0x39a9 | |
738 | .word 0xb967 | |
739 | .word 0x280c | |
740 | ||
741 | ||
742 | SECTION .My_User_Section_4v004 TEXT_VA=MY_USER_TEXT_VA004, DATA_VA=MY_USER_DATA_VA004 | |
743 | attr_text { | |
744 | Name = .My_User_Section_4v004, | |
745 | part_0_ctx_nonzero_tsb_config_2, | |
746 | VA = MY_USER_TEXT_VA004, | |
747 | RA = MY_USER_TEXT_RA004, | |
748 | PA = ra2pa(MY_USER_TEXT_RA004, 0), | |
749 | TTE_Context = PCONTEXT, | |
750 | TTE_V = 1, | |
751 | TTE_NFO = 0, | |
752 | TTE_L = 0, | |
753 | TTE_Soft = 0, | |
754 | TTE_IE = 0, | |
755 | TTE_E = 0, | |
756 | TTE_CP = 1, | |
757 | TTE_CV = 0, | |
758 | TTE_P = 0, | |
759 | TTE_EP = 1, | |
760 | TTE_W = 0, | |
761 | TTE_SW1 = 0, | |
762 | TTE_SW0 = 0, | |
763 | TTE_RSVD1 = 0, | |
764 | TTE_Size = 0, | |
765 | } | |
766 | attr_text { | |
767 | NAME = .My_User_Section_4v004, | |
768 | hypervisor | |
769 | } | |
770 | ||
771 | !! check if cerer.scac is clear or ceter.pscce is clear then the error is | |
772 | !! not detected and the sfsr is not updated. | |
773 | !! When we enter this testcase all the scratchpad entries have errors. | |
774 | !! Errors are put by the stxa's in the loop above. | |
775 | ||
776 | .text | |
777 | .global user_code_begin_004 | |
778 | user_code_begin_004: | |
779 | mov %g0, %i1 | |
780 | !! clear CERER.SCAC | |
781 | add %g0, CERER_VA, %g3 | |
782 | stxa %g0, [%g3]ASI_CERER | |
783 | add %g0, SFSR_VA, %g1 | |
784 | add %g0, 0x1000, %o1 | |
785 | mov %g0, %o3 | |
786 | ||
787 | LD4: | |
788 | ldx [%l4 + %i1], %i2 | |
789 | ldxa [%g0 + %i1]0x4F, %i3 | |
790 | cmp %i3, %i2 | |
791 | bne FAIL | |
792 | ldxa [%g1]ASI_DSFSR, %o1 !! read the DSFSR | |
793 | brnz %o1, FAIL | |
794 | brnz %i0, FAIL | |
795 | cmp %i1, 0x30 | |
796 | ble LD4 | |
797 | add %i1, 8, %i1 | |
798 | ||
799 | ||
800 | !! Now set CERER.SCAC, but clear CETER.PSCCE. CHk that no error again. | |
801 | setx 0x40000000, %g4, %o2 !! enable scac errs | |
802 | add %g0, CERER_VA, %g3 !!g3 has cerer va | |
803 | ||
804 | stxa %o2, [%g3]ASI_CERER | |
805 | ||
806 | add %g0, CETER_VA, %g3 | |
807 | stxa %g0, [%g3]ASI_CETER | |
808 | ||
809 | mov %g0, %i1 | |
810 | add %g0, 0x1000, %o1 | |
811 | ||
812 | LD5: | |
813 | ldx [%l4 + %i1], %i2 | |
814 | ldxa [%g0 + %i1]0x4F, %i3 | |
815 | cmp %i3, %i2 | |
816 | bne FAIL | |
817 | ldxa [%g1]ASI_DSFSR, %o1 !! read the DSFSR | |
818 | brnz %o1, FAIL | |
819 | brnz %i0, FAIL | |
820 | cmp %i1, 0x30 | |
821 | ble LD5 | |
822 | add %i1, 8, %i1 | |
823 | ||
824 | ||
825 | !! Now set both CERER.SCAC, and CETER.PSCCE. Chk that error comes. | |
826 | !! set CETER.PSCCE | |
827 | setx CETER_PSCCE, %l0, %o2 | |
828 | add %g0, CETER_VA, %g3 | |
829 | stxa %o2, [%g3]ASI_CETER | |
830 | ||
831 | mov %g0, %i1 | |
832 | add %g0, 1, %l1 | |
833 | add %g0, 1, %l2 | |
834 | ||
835 | LD5_1: | |
836 | ldx [%l4 + %i1], %i2 | |
837 | ldxa [%g0 + %i1]0x4F, %i3 | |
838 | cmp %i3, %i2 | |
839 | bne FAIL | |
840 | cmp %i0, %l1 | |
841 | bne FAIL | |
842 | mov %g0, %i0 | |
843 | sll %l2, 1, %l2 | |
844 | add %o3, 8, %o3 | |
845 | cmp %i1, 0x30 | |
846 | ble LD5_1 | |
847 | add %i1, 8, %i1 | |
848 | ||
849 | ||
850 | !! All errors shd be cleared now and no errors shd be seen | |
851 | ||
852 | mov %g0, %i1 | |
853 | mov %g0, %l1 | |
854 | ||
855 | LD6: | |
856 | ldx [%l4 + %i1], %i2 | |
857 | ldxa [%g0 + %i1]0x4F, %i3 | |
858 | cmp %i3, %i2 | |
859 | bne FAIL | |
860 | brnz %i0, FAIL | |
861 | mov %g0, %i0 | |
862 | cmp %i1, 0x30 | |
863 | ble LD6 | |
864 | add %i1, 8, %i1 | |
865 | ||
866 | setx user_code_begin_005, %g1, %g2 | |
867 | jmp %g2 | |
868 | nop | |
869 | ||
870 | FAIL: EXIT_BAD | |
871 | nop | |
872 | ||
873 | attr_data { | |
874 | Name = .My_User_Section_4v004, | |
875 | part_0_ctx_nonzero_tsb_config_1, | |
876 | VA = MY_USER_DATA_VA004, | |
877 | RA = MY_USER_DATA_RA004, | |
878 | PA = ra2pa(MY_USER_DATA_RA004, 0), | |
879 | TTE_Context = PCONTEXT, | |
880 | TTE_V = 1, | |
881 | TTE_NFO = 0, | |
882 | TTE_L = 0, | |
883 | TTE_Soft = 0, | |
884 | TTE_IE = 0, | |
885 | TTE_E = 0, | |
886 | TTE_CP = 1, | |
887 | TTE_CV = 0, | |
888 | TTE_P = 0, | |
889 | TTE_EP = 0, | |
890 | TTE_W = 1, | |
891 | TTE_SW1 = 0, | |
892 | TTE_SW0 = 0, | |
893 | TTE_RSVD1 = 0, | |
894 | TTE_Size = 0, | |
895 | } | |
896 | attr_data { | |
897 | NAME = .My_User_Section_4v004, | |
898 | hypervisor | |
899 | } | |
900 | .data | |
901 | .global user_data_begin_004 | |
902 | user_data_begin_004: | |
903 | .xword 0xefc4e1f1b35853fc | |
904 | .xword 0xe790a0c1689eb683 | |
905 | .xword 0x88c650f170c41710 | |
906 | .xword 0x614126cf9fc8dca3 | |
907 | .xword 0x4be2f60911e465ce | |
908 | .xword 0x4e22352a0c29c95c | |
909 | .xword 0xf18efdf01ce79e24 | |
910 | .xword 0x294aaa56144d7cf1 | |
911 | .xword 0xe0066361bd9fcb86 | |
912 | .xword 0xea22901c101f6f52 | |
913 | .xword 0x806faa2171350467 | |
914 | .xword 0xff54f2cd06a0d342 | |
915 | .xword 0x566bff718cddb905 | |
916 | .xword 0x6d367bc4d165d37a | |
917 | .xword 0x5efc42b18f920522 | |
918 | .xword 0x584c92dec4bc66de | |
919 | .word 0x4069 | |
920 | .word 0x41ed | |
921 | .word 0x14c07 | |
922 | .word 0x29de | |
923 | ||
924 | ||
925 | SECTION .My_User_Section_4v005 TEXT_VA=MY_USER_TEXT_VA005, DATA_VA=MY_USER_DATA_VA005 | |
926 | attr_text { | |
927 | Name = .My_User_Section_4v005, | |
928 | part_0_ctx_nonzero_tsb_config_3, | |
929 | VA = MY_USER_TEXT_VA005, | |
930 | RA = MY_USER_TEXT_RA005, | |
931 | PA = ra2pa(MY_USER_TEXT_RA005, 0), | |
932 | TTE_Context = PCONTEXT, | |
933 | TTE_V = 1, | |
934 | TTE_NFO = 0, | |
935 | TTE_L = 0, | |
936 | TTE_Soft = 0, | |
937 | TTE_IE = 0, | |
938 | TTE_E = 0, | |
939 | TTE_CP = 1, | |
940 | TTE_CV = 0, | |
941 | TTE_P = 0, | |
942 | TTE_EP = 1, | |
943 | TTE_W = 0, | |
944 | TTE_SW1 = 0, | |
945 | TTE_SW0 = 0, | |
946 | TTE_RSVD1 = 0, | |
947 | TTE_Size = 0, | |
948 | } | |
949 | attr_text { | |
950 | NAME = .My_User_Section_4v005, | |
951 | hypervisor | |
952 | } | |
953 | .text | |
954 | .global user_code_begin_005 | |
955 | user_code_begin_005: | |
956 | !!Now again inject errors in all the entries, but set cerer.scau bit. | |
957 | !! Make sure that error is not flagged. | |
958 | ||
959 | add %g0, 1, %l3 | |
960 | add %g0, 1, %l2 | |
961 | set SCAU_ERR_EN, %l3 | |
962 | or %l3, %l2, %l3 | |
963 | stxa %l3, [%g0]ASI_ERR_INJ | |
964 | ||
965 | !! Set cerer.scau bit | |
966 | setx 0x20000000, %g1, %o2 !! enable scau errs | |
967 | add %g0, CERER_VA, %g3 !!g3 has cerer va | |
968 | stxa %o2, [%g3]ASI_CERER | |
969 | ||
970 | mov %g0, %i1 | |
971 | setx user_data_begin_005, %g1, %l4 | |
972 | set 0xffffff00, %g1 | |
973 | mov %g0, %o3 | |
974 | ST5: | |
975 | ldx [%l4 + %i1], %i2 !! data to be stored in scratchpad | |
976 | stxa %i2, [%g0 + %i1]0x4F | |
977 | sll %l2, 1, %l2 | |
978 | and %l3, %g1, %l3 | |
979 | or %l3, %l2, %l3 | |
980 | add %i1, 8, %i1 | |
981 | cmp %i1, 0x38 | |
982 | ble ST5 | |
983 | stxa %l3, [%g0]ASI_ERR_INJ | |
984 | ||
985 | mov %g0, %l1 | |
986 | mov %g0, %i1 | |
987 | LD7: | |
988 | ldx [%l4 + %i1], %i2 | |
989 | ldxa [%g0 + %i1]0x4F, %i3 | |
990 | cmp %i3, %i2 | |
991 | bne FAIL | |
992 | brnz %i0, FAIL | |
993 | cmp %i1, 0x30 | |
994 | ble LD7 | |
995 | add %i1, 8, %i1 | |
996 | ||
997 | ||
998 | !! Now set CERER.SCAC, and see that the error is flagged. | |
999 | !! Set cerer.scac bit | |
1000 | setx 0x40000000, %g1, %o2 !! enable scac errs | |
1001 | add %g0, CERER_VA, %g3 !!g3 has cerer va | |
1002 | stxa %o2, [%g3]ASI_CERER | |
1003 | ||
1004 | add %g0, 1, %l1 | |
1005 | add %g0, 1, %l2 | |
1006 | mov %g0, %i1 | |
1007 | LD8: | |
1008 | ldx [%l4 + %i1], %i2 | |
1009 | ldxa [%g0 + %i1]0x4F, %i3 | |
1010 | cmp %i3, %i2 | |
1011 | bne FAIL | |
1012 | cmp %i0, %l1 | |
1013 | bne FAIL | |
1014 | mov %g0, %i0 | |
1015 | sll %l2, 1, %l2 | |
1016 | add %o3, 8, %o3 | |
1017 | cmp %i1, 0x30 | |
1018 | ble LD8 | |
1019 | add %i1, 8, %i1 | |
1020 | ||
1021 | EXIT_GOOD | |
1022 | nop | |
1023 | ||
1024 | FAIL: EXIT_BAD | |
1025 | nop | |
1026 | ||
1027 | attr_data { | |
1028 | Name = .My_User_Section_4v005, | |
1029 | part_0_ctx_nonzero_tsb_config_1, | |
1030 | VA = MY_USER_DATA_VA005, | |
1031 | RA = MY_USER_DATA_RA005, | |
1032 | PA = ra2pa(MY_USER_DATA_RA005, 0), | |
1033 | TTE_Context = PCONTEXT, | |
1034 | TTE_V = 1, | |
1035 | TTE_NFO = 0, | |
1036 | TTE_L = 0, | |
1037 | TTE_Soft = 0, | |
1038 | TTE_IE = 0, | |
1039 | TTE_E = 0, | |
1040 | TTE_CP = 1, | |
1041 | TTE_CV = 0, | |
1042 | TTE_P = 0, | |
1043 | TTE_EP = 0, | |
1044 | TTE_W = 1, | |
1045 | TTE_SW1 = 0, | |
1046 | TTE_SW0 = 0, | |
1047 | TTE_RSVD1 = 0, | |
1048 | TTE_Size = 0, | |
1049 | } | |
1050 | attr_data { | |
1051 | NAME = .My_User_Section_4v005, | |
1052 | hypervisor | |
1053 | } | |
1054 | .data | |
1055 | .global user_data_begin_005 | |
1056 | user_data_begin_005: | |
1057 | .xword 0xefc4e1f1b35853fc | |
1058 | .xword 0xe790a0c1689eb683 | |
1059 | .xword 0x88c650f170c41710 | |
1060 | .xword 0x614126cf9fc8dca3 | |
1061 | .xword 0x4be2f60911e465ce | |
1062 | .xword 0x4e22352a0c29c95c | |
1063 | .xword 0xf18efdf01ce79e24 | |
1064 | .xword 0x294aaa56144d7cf1 | |
1065 | .xword 0xe0066361bd9fcb86 | |
1066 | .xword 0xea22901c101f6f52 | |
1067 | .xword 0x806faa2171350467 | |
1068 | .xword 0xff54f2cd06a0d342 | |
1069 | .xword 0x566bff718cddb905 | |
1070 | .xword 0x6d367bc4d165d37a | |
1071 | .xword 0x5efc42b18f920522 | |
1072 | .xword 0x4be2f60911e465ce | |
1073 | .xword 0x4e22352a0c29c95c | |
1074 | .xword 0xf18efdf01ce79e24 | |
1075 | .word 0xf93b | |
1076 | .word 0xe34b | |
1077 | .word 0x127e6 | |
1078 | .word 0xd915 | |
1079 | ||
1080 | .global INT_PROC_ERR_HANDLER | |
1081 | .global INVALID_ASI_HANDLER | |
1082 | ||
1083 | SECTION .HTRAPS | |
1084 | .text | |
1085 | ||
1086 | INT_PROC_ERR_HANDLER: | |
1087 | CHK_ERR_TYP: | |
1088 | setx ecc_syndrome_table, %g1, %g2 | |
1089 | add %g0, SFSR_VA, %g1 | |
1090 | ldxa [%g1]ASI_DSFSR, %o1 !! read the DSFSR | |
1091 | stxa %g0, [%g1]ASI_DSFSR !! clear the dsfsr | |
1092 | and %o1, 0xF, %o1 | |
1093 | cmp %o1, SCAC_ERR_TYPE | |
1094 | bne FAIL | |
1095 | CHK_INDEX: | |
1096 | add %g0, SFAR_VA, %g1 | |
1097 | ldxa [%g1]ASI_SFAR, %o1 !! read the DSFAR | |
1098 | srl %i1, 3, %g6 !! expected value of index | |
1099 | and %o1, 0x7, %o2 | |
1100 | cmp %o2, %g6 | |
1101 | bne FAIL | |
1102 | ||
1103 | !!diagnostic read the bad data and ecc | |
1104 | CHK_SYNDROME: | |
1105 | srl %o1, 3, %o2 !! o2 has the bad syndrome | |
1106 | and %o2, 0x80, %g6 !! look at the overall parity. Shd be 1 for correctable errors. | |
1107 | brz %g6, FAIL | |
1108 | and %o2, 0x7F, %g6 | |
1109 | sllx %l2, 3, %g3 | |
1110 | ldx [%g2 + %o3], %g4 | |
1111 | cmp %g4, %g6 | |
1112 | bne FAIL | |
1113 | ||
1114 | ldxa [%g0 + %i1]0x59, %g6 !! read the ecc | |
1115 | ||
1116 | add %i1, 0x40, %g1 | |
1117 | ldxa [%g1]0x59, %g3 !! read the data | |
1118 | cmp %i2, %g3 !! i2 has the expceted data | |
1119 | bne FAIL | |
1120 | ||
1121 | TURN_OFF_ERR_INJ: | |
1122 | !!turn off error | |
1123 | stxa %g0, [%g0]ASI_ERR_INJ | |
1124 | !! do a normal wr to the scratchpad entry to clear the err | |
1125 | cmp %o4, 0x20 | |
1126 | be,a .+12 | |
1127 | stxa %g3, [%i1]0x20 | |
1128 | stxa %g3, [%i1]0x4f | |
1129 | ||
1130 | CHECK_ERR_INJECT: | |
1131 | !! diag read the ecc | |
1132 | ldxa [%g0 + %i1]0x59, %g4 !! read the ecc | |
1133 | xor %g4, %l2, %g5 | |
1134 | cmp %g5, %g6 | |
1135 | bne FAIL | |
1136 | ||
1137 | ENABLE_ERR_INJ: | |
1138 | ||
1139 | !! enable error injection | |
1140 | setx SCAU_ERR_EN, %l0, %g1 | |
1141 | or %g1, %l2, %g1 ! set mask bit 0 to 1 | |
1142 | stxa %g1, [%g0]ASI_ERR_INJ | |
1143 | add %g0, 1, %i0 | |
1144 | retry | |
1145 | ||
1146 | PASS: EXIT_GOOD | |
1147 | nop | |
1148 | ||
1149 | FAIL: EXIT_BAD | |
1150 | nop | |
1151 | ||
1152 | .data | |
1153 | .align 64 | |
1154 | ecc_syndrome_table: | |
1155 | .xword 0x01 !! C0 | |
1156 | .xword 0x02 !! C1 | |
1157 | .xword 0x04 !! C2 | |
1158 | .xword 0x08 !! C3 | |
1159 | .xword 0x10 !! C4 | |
1160 | .xword 0x20 !! C5 | |
1161 | .xword 0x40 !! C6 | |
1162 | .xword 0x00 !! C7 |