Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_l2_LDAU_uecc_trap.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 | .global My_Precise_data_access_error_trap | |
53 | ||
54 | main: | |
55 | ||
56 | ||
57 | ! Boot code does not provide TLB translation for IO address space | |
58 | ta T_CHANGE_HPRIV | |
59 | ||
60 | disable_l1_DCache: | |
61 | ldxa [%g0] ASI_LSU_CONTROL, %l0 | |
62 | ! Remove bit 2 | |
63 | andn %l0, 0x2, %l0 | |
64 | stxa %l0, [%g0] ASI_LSU_CONTROL | |
65 | ||
66 | enable_err_reporting: | |
67 | setx L2EE_PA0, %l0, %l1 | |
68 | ldx [%l1], %l2 | |
69 | mov 0x3, %l0 | |
70 | or %l2, %l0, %l2 | |
71 | stx %l2, [%l1] | |
72 | ||
73 | clear_l2_ESR: | |
74 | setx L2_ES_W1C_VALUE, %l0, %l1 | |
75 | setx L2ES_PA0, %l6, %g1 | |
76 | stx %l1, [%g1] | |
77 | ||
78 | ||
79 | set_L2_Directly_Mapped_Mode: | |
80 | setx L2CS_PA0, %l6, %g1 | |
81 | mov 0x2, %l0 | |
82 | stx %l0, [%g1] | |
83 | ||
84 | store_to_L2: | |
85 | setx TEST_DATA1, %l0, %g5 | |
86 | ||
87 | store_to_L2_way0: | |
88 | setx 0x202000aa00, %l0, %g2 | |
89 | stx %g5, [%g2] | |
90 | stx %g5, [%g2+8] | |
91 | membar #Sync | |
92 | ||
93 | L2_diag_load: | |
94 | setx 0x3ffff8, %l0, %l2 ! Mask for extracting [21:3] | |
95 | setx L2_ENTRY_PA, %l0, %g4 | |
96 | and %g2, %l2, %g5 | |
97 | or %g5, %g4, %g5 | |
98 | ldx [%g5], %g6 | |
99 | membar #Sync | |
100 | ||
101 | ! Flip two bits | |
102 | xor %g6, 0x600, %g6 | |
103 | stx %g6, [%g5] | |
104 | membar #Sync | |
105 | ||
106 | reading_back_0: | |
107 | setx 0x202000aa00, %l0, %g2 | |
108 | ldx [%g2], %l6 | |
109 | membar #Sync | |
110 | ||
111 | check_sw_err_trap: | |
112 | ! Check if a Software Recoverable Error Trap happened | |
113 | set EXECUTED, %l0 | |
114 | cmp %o0, %l0 | |
115 | bne test_fail | |
116 | nop | |
117 | mov TT_Data_Access_Error, %l0 | |
118 | cmp %o1, %l0 | |
119 | bne test_fail | |
120 | nop | |
121 | ||
122 | ||
123 | enable_l1_DCache: | |
124 | ldxa [%g0] ASI_LSU_CONTROL, %l0 | |
125 | or %l0, 0x2, %l0 | |
126 | stxa %l0, [%g0] ASI_LSU_CONTROL | |
127 | ||
128 | compute_error: | |
129 | mov 0x1, %l1 | |
130 | sllx %l1, L2ES_LDAU, %l7 | |
131 | sllx %l1, L2ES_VEU, %l3 | |
132 | or %l7, %l3, %l7 | |
133 | !mov 0x46, %l1 ! 7-bit Syndrome | |
134 | !sllx %l1, 21, %l3 ! Syndrome for [127:96] at [27:21] | |
135 | !or %l7, %l3, %l7 | |
136 | !sllx %g4, L2ES_TID, %l3 ! ID of thread that encountered error | |
137 | !or %l7, %l3, %l7 ! %l7 has expected value | |
138 | membar #Sync | |
139 | ||
140 | ||
141 | check_l2_ESR: | |
142 | setx L2ES_PA0, %l6, %g1 | |
143 | ldx [%g1], %l4 | |
144 | membar #Sync | |
145 | ||
146 | ! Not Checking SYND in this test | |
147 | set 0xffffffff, %l3 | |
148 | andn %l4, %l3, %l4 | |
149 | cmp %l7, %l4 | |
150 | bne test_fail | |
151 | nop | |
152 | nop | |
153 | ||
154 | ||
155 | check_l2_EAR: | |
156 | setx L2EA_PA0, %l6, %l3 | |
157 | ldx [%l3], %l4 | |
158 | membar #Sync | |
159 | ||
160 | ||
161 | !load_DESR_L2C: | |
162 | ! set 0x18, %g3 | |
163 | ! ldxa [%g3] 0x58, %g2 | |
164 | ||
165 | !verify_DESR: | |
166 | ! set 0xf, %l1 | |
167 | ! and %g2, %l1, %l3 | |
168 | ! mov 0x1, %l5 | |
169 | ! cmp %l5, %l3 | |
170 | ! bne test_fail | |
171 | ! nop | |
172 | ||
173 | ||
174 | ba test_pass | |
175 | nop | |
176 | ||
177 | My_Precise_data_access_error_trap: | |
178 | ! Signal trap taken | |
179 | setx EXECUTED, %l0, %o0 | |
180 | ! save trap type value | |
181 | rdpr %tt, %o1 | |
182 | ba check_sw_err_trap | |
183 | nop | |
184 | ||
185 | ||
186 | ||
187 | /******************************************************* | |
188 | * Exit code | |
189 | *******************************************************/ | |
190 | ||
191 | test_pass: | |
192 | ta T_GOOD_TRAP | |
193 | ||
194 | test_fail: | |
195 | ta T_BAD_TRAP | |
196 |