Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_l2_LDAU_uecc.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 MAIN_PAGE_HV_ALSO | |
39 | ||
40 | ||
41 | #define L2_ENTRY_PA 0xa000000000 | |
42 | #define TEST_DATA1 0x5555555555555555 | |
43 | #define L2_ENTRY_PA0 0x2020000008 | |
44 | #define L2_ES_W1C_VALUE 0xc03ffff800000000 | |
45 | ||
46 | #include "hboot.s" | |
47 | #include "asi_s.h" | |
48 | #include "err_defines.h" | |
49 | ||
50 | .text | |
51 | .global main | |
52 | ||
53 | main: | |
54 | ||
55 | ||
56 | ! Boot code does not provide TLB translation for IO address space | |
57 | ta T_CHANGE_HPRIV | |
58 | ||
59 | disable_l1_DCache: | |
60 | ldxa [%g0] ASI_LSU_CONTROL, %l0 | |
61 | ! Remove bit 2 | |
62 | andn %l0, 0x2, %l0 | |
63 | stxa %l0, [%g0] ASI_LSU_CONTROL | |
64 | ||
65 | ||
66 | clear_l2_ESR: | |
67 | setx L2_ES_W1C_VALUE, %l0, %l1 | |
68 | setx L2ES_PA0, %l6, %g1 | |
69 | stx %l1, [%g1] | |
70 | ||
71 | ||
72 | set_L2_Directly_Mapped_Mode: | |
73 | setx L2CS_PA0, %l6, %g1 | |
74 | mov 0x2, %l0 | |
75 | stx %l0, [%g1] | |
76 | ||
77 | store_to_L2: | |
78 | setx TEST_DATA1, %l0, %g5 | |
79 | ||
80 | store_to_L2_way0: | |
81 | setx 0x202000aa00, %l0, %g2 | |
82 | stx %g5, [%g2] | |
83 | stx %g5, [%g2+8] | |
84 | membar #Sync | |
85 | ||
86 | clr %l6 | |
87 | set 0x7, %l5 | |
88 | loop: | |
89 | inc %l6 | |
90 | cmp %l6,%l5 | |
91 | bne loop | |
92 | nop | |
93 | ||
94 | ||
95 | L2_diag_load: | |
96 | setx 0x3ffff8, %l0, %l2 ! Mask for extracting [21:3] | |
97 | setx L2_ENTRY_PA, %l0, %g4 | |
98 | and %g2, %l2, %g5 | |
99 | or %g5, %g4, %g5 | |
100 | ldx [%g5], %g6 | |
101 | membar #Sync | |
102 | ||
103 | ! Flip two bits | |
104 | xor %g6, 0x600, %g6 | |
105 | stx %g6, [%g5] | |
106 | membar #Sync | |
107 | ||
108 | reading_back_0: | |
109 | setx 0x202000aa00, %l0, %g2 | |
110 | ldx [%g2], %l6 | |
111 | membar #Sync | |
112 | ||
113 | compute_error: | |
114 | mov 0x1, %l1 | |
115 | sllx %l1, L2ES_LDAU, %l7 | |
116 | sllx %l1, L2ES_VEU, %l3 | |
117 | or %l7, %l3, %l7 | |
118 | !mov 0x46, %l1 ! 7-bit Syndrome | |
119 | !sllx %l1, 21, %l3 ! Syndrome for [127:96] at [27:21] | |
120 | !or %l7, %l3, %l7 | |
121 | !sllx %g4, L2ES_TID, %l3 ! ID of thread that encountered error | |
122 | !or %l7, %l3, %l7 ! %l7 has expected value | |
123 | membar #Sync | |
124 | ||
125 | ||
126 | check_l2_ESR: | |
127 | setx L2ES_PA0, %l6, %g1 | |
128 | ldx [%g1], %l4 | |
129 | membar #Sync | |
130 | ||
131 | ! Not Checking SYND in this test | |
132 | set 0xffffffff, %l3 | |
133 | andn %l4, %l3, %l4 | |
134 | cmp %l7, %l4 | |
135 | bne test_fail | |
136 | nop | |
137 | nop | |
138 | ||
139 | ||
140 | check_l2_EAR: | |
141 | setx L2EA_PA0, %l6, %l3 | |
142 | ldx [%l3], %l4 | |
143 | membar #Sync | |
144 | setx 0x202000aa00, %l0, %g2 | |
145 | cmp %g2,%l4 | |
146 | bne test_fail | |
147 | nop | |
148 | ||
149 | reading_back_1: ! For MEU | |
150 | setx 0x202000aa00, %l0, %g2 | |
151 | ldx [%g2], %l6 | |
152 | membar #Sync | |
153 | ||
154 | ||
155 | ||
156 | enable_l1_DCache: | |
157 | ldxa [%g0] ASI_LSU_CONTROL, %l0 | |
158 | or %l0, 0x2, %l0 | |
159 | stxa %l0, [%g0] ASI_LSU_CONTROL | |
160 | ||
161 | compute_error_meu: | |
162 | mov 0x1, %l1 | |
163 | sllx %l1, L2ES_LDAU, %l7 | |
164 | sllx %l1, L2ES_VEU, %l3 | |
165 | or %l7, %l3, %l7 | |
166 | sllx %l1, L2ES_MEU, %l3 | |
167 | or %l7, %l3, %l7 | |
168 | !mov 0x46, %l1 ! 7-bit Syndrome | |
169 | !sllx %l1, 21, %l3 ! Syndrome for [127:96] at [27:21] | |
170 | !or %l7, %l3, %l7 | |
171 | !sllx %g4, L2ES_TID, %l3 ! ID of thread that encountered error | |
172 | !or %l7, %l3, %l7 ! %l7 has expected value | |
173 | membar #Sync | |
174 | ||
175 | ||
176 | check_l2_ESR_meu: | |
177 | setx L2ES_PA0, %l6, %g1 | |
178 | ldx [%g1], %l4 | |
179 | membar #Sync | |
180 | ||
181 | ! Not Checking SYND in this test | |
182 | set 0xffffffff, %l3 | |
183 | andn %l4, %l3, %l4 | |
184 | cmp %l7, %l4 | |
185 | bne test_fail | |
186 | nop | |
187 | nop | |
188 | ||
189 | ||
190 | check_l2_EAR_meu: | |
191 | setx L2EA_PA0, %l6, %l3 | |
192 | ldx [%l3], %l4 | |
193 | membar #Sync | |
194 | setx 0x202000aa00, %l0, %g2 | |
195 | cmp %g2,%l4 | |
196 | bne test_fail | |
197 | nop | |
198 | ||
199 | ||
200 | ba test_pass | |
201 | nop | |
202 | ||
203 | ||
204 | ||
205 | /******************************************************* | |
206 | * Exit code | |
207 | *******************************************************/ | |
208 | ||
209 | test_pass: | |
210 | ta T_GOOD_TRAP | |
211 | ||
212 | test_fail: | |
213 | ta T_BAD_TRAP | |
214 |