Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_L2_LDWU_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 | set 0x2000aa00, %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 | store_for_wb: | |
109 | set 0x55555555,%l6 | |
110 | set 0x3000aa00, %g2 | |
111 | stx %l6, [%g2] | |
112 | membar #Sync | |
113 | ||
114 | store_to_L2_way0_meu: | |
115 | set 0x55555555,%g5 | |
116 | set 0x2020aa00, %g2 | |
117 | stx %g5, [%g2] | |
118 | stx %g5, [%g2+8] | |
119 | membar #Sync | |
120 | ||
121 | clr %l6 | |
122 | set 0x7, %l5 | |
123 | loop_meu: | |
124 | inc %l6 | |
125 | cmp %l6,%l5 | |
126 | bne loop_meu | |
127 | nop | |
128 | ||
129 | ||
130 | L2_diag_load_meu: | |
131 | setx 0x3ffff8, %l0, %l2 ! Mask for extracting [21:3] | |
132 | setx L2_ENTRY_PA, %l0, %g4 | |
133 | and %g2, %l2, %g5 | |
134 | or %g5, %g4, %g5 | |
135 | ldx [%g5], %g6 | |
136 | membar #Sync | |
137 | ||
138 | ! Flip two bits | |
139 | xor %g6, 0x600, %g6 | |
140 | stx %g6, [%g5] | |
141 | membar #Sync | |
142 | ||
143 | store_for_wb_meu: | |
144 | set 0x55555555,%l6 | |
145 | set 0x3020aa00, %g2 | |
146 | stx %l6, [%g2] | |
147 | membar #Sync | |
148 | ||
149 | ||
150 | compute_error: | |
151 | mov 0x1, %l1 | |
152 | sllx %l1, L2ES_LDWU, %l7 | |
153 | sllx %l1, L2ES_VEU, %l3 | |
154 | or %l7, %l3, %l7 | |
155 | sllx %l1, L2ES_MEU, %l3 | |
156 | or %l7, %l3, %l7 | |
157 | ||
158 | !mov 0x46, %l1 ! 7-bit Syndrome | |
159 | !sllx %l1, 21, %l3 ! Syndrome for [127:96] at [27:21] | |
160 | !or %l7, %l3, %l7 | |
161 | !sllx %g4, L2ES_TID, %l3 ! ID of thread that encountered error | |
162 | !or %l7, %l3, %l7 ! %l7 has expected value | |
163 | membar #Sync | |
164 | ||
165 | ||
166 | check_l2_ESR: | |
167 | setx L2ES_PA0, %l6, %g1 | |
168 | ldx [%g1], %l4 | |
169 | membar #Sync | |
170 | ||
171 | ! Not Checking SYND in this test | |
172 | set 0xffffffff, %l3 | |
173 | andn %l4, %l3, %l4 | |
174 | cmp %l7, %l4 | |
175 | !bne test_fail | |
176 | nop | |
177 | nop | |
178 | ||
179 | ||
180 | check_l2_EAR: | |
181 | setx L2EA_PA0, %l6, %l3 | |
182 | ldx [%l3], %l4 | |
183 | membar #Sync | |
184 | set 0x2020aa00, %g2 | |
185 | cmp %g2,%l4 | |
186 | !bne test_fail | |
187 | nop | |
188 | ||
189 | reading_back_1: ! For MEU | |
190 | setx 0x202000aa00, %l0, %g2 | |
191 | ldx [%g2], %l6 | |
192 | membar #Sync | |
193 | ||
194 | ||
195 | ||
196 | enable_l1_DCache: | |
197 | ldxa [%g0] ASI_LSU_CONTROL, %l0 | |
198 | or %l0, 0x2, %l0 | |
199 | stxa %l0, [%g0] ASI_LSU_CONTROL | |
200 | ||
201 | compute_error_meu: | |
202 | mov 0x1, %l1 | |
203 | sllx %l1, L2ES_LDAU, %l7 | |
204 | sllx %l1, L2ES_VEU, %l3 | |
205 | or %l7, %l3, %l7 | |
206 | sllx %l1, L2ES_MEU, %l3 | |
207 | or %l7, %l3, %l7 | |
208 | !mov 0x46, %l1 ! 7-bit Syndrome | |
209 | !sllx %l1, 21, %l3 ! Syndrome for [127:96] at [27:21] | |
210 | !or %l7, %l3, %l7 | |
211 | !sllx %g4, L2ES_TID, %l3 ! ID of thread that encountered error | |
212 | !or %l7, %l3, %l7 ! %l7 has expected value | |
213 | membar #Sync | |
214 | ||
215 | ||
216 | check_l2_ESR_meu: | |
217 | setx L2ES_PA0, %l6, %g1 | |
218 | ldx [%g1], %l4 | |
219 | membar #Sync | |
220 | ||
221 | ! Not Checking SYND in this test | |
222 | set 0xffffffff, %l3 | |
223 | andn %l4, %l3, %l4 | |
224 | cmp %l7, %l4 | |
225 | bne test_fail | |
226 | nop | |
227 | nop | |
228 | ||
229 | ||
230 | check_l2_EAR_meu: | |
231 | setx L2EA_PA0, %l6, %l3 | |
232 | ldx [%l3], %l4 | |
233 | membar #Sync | |
234 | setx 0x202000aa00, %l0, %g2 | |
235 | cmp %g2,%l4 | |
236 | bne test_fail | |
237 | nop | |
238 | ||
239 | ||
240 | ba test_pass | |
241 | nop | |
242 | ||
243 | ||
244 | ||
245 | /******************************************************* | |
246 | * Exit code | |
247 | *******************************************************/ | |
248 | ||
249 | test_pass: | |
250 | ta T_GOOD_TRAP | |
251 | ||
252 | test_fail: | |
253 | ta T_BAD_TRAP | |
254 | ||
255 | ||
256 |