Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_NcuPcxData.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 H_HT0_Sw_Recoverable_Error_0x40 My_Recoverable_Sw_error_trap | |
39 | ||
40 | ||
41 | /* #define MAIN_PAGE_NUCLEUS_ALSO */ /* Access main in priviledge mode */ | |
42 | #define MAIN_PAGE_HV_ALSO | |
43 | ||
44 | ||
45 | #define SOC_ESR_REG 0x8000003000 | |
46 | #define SOC_ELE_REG 0x8000003008 | |
47 | #define SOC_EIE_REG 0x8000003010 | |
48 | #define SOC_EJR_REG 0x8000003018 | |
49 | #define SOC_FEE_REG 0x8000003020 | |
50 | #define SOC_PER_REG 0x8000003028 | |
51 | #define SOC_SII_SYN_REG 0x8000003030 | |
52 | #define SOC_NCU_SYN_REG 0x8000003038 | |
53 | ||
54 | #define NcuPcxData 18 | |
55 | #define TT_Sw_Correctable_ECC 0x40 | |
56 | ||
57 | //#include "defines.h" | |
58 | //#include "nmacros.h" | |
59 | #include "hboot.s" | |
60 | #include "asi_s.h" | |
61 | #include "err_defines.h" | |
62 | ||
63 | /************************************************************************ | |
64 | Test case code start | |
65 | ************************************************************************/ | |
66 | .text | |
67 | .global main | |
68 | .global My_Recoverable_Sw_error_trap | |
69 | ||
70 | main: | |
71 | ta T_CHANGE_HPRIV | |
72 | nop | |
73 | ||
74 | setx 0x8000000000000000, %l7, %g7 !valid bit | |
75 | ||
76 | soc_err_stat_reg: | |
77 | set 0x1, %g1 | |
78 | sllx %g1, NcuPcxData, %g2 ! %g2 has NcuPcxData ON | |
79 | setx SOC_EJR_REG, %l7, %g3 | |
80 | ||
81 | set_ejr: | |
82 | stx %g2, [%g3] | |
83 | membar 0x40 | |
84 | ||
85 | read_esr: | |
86 | setx SOC_ESR_REG, %l7, %g5 | |
87 | ldx [%g5], %i1 | |
88 | nop | |
89 | ||
90 | /* | |
91 | or %g7, %g2, %i3 ! %g7->Valid bit; %g2->NcuPcxData bit | |
92 | sub %i1, %i3, %i4 | |
93 | brnz %i4, test_fail | |
94 | nop | |
95 | ||
96 | read_synd: | |
97 | setx SOC_NCU_SYN_REG, %l7, %g6 | |
98 | ldx [%g5], %i1 | |
99 | brz %i1, test_fail | |
100 | nop | |
101 | */ | |
102 | ||
103 | ||
104 | /* To be enabled | |
105 | set 0x10, %g4 | |
106 | loop_wait0: | |
107 | nop; nop; nop | |
108 | nop; nop; nop | |
109 | dec %g4 | |
110 | brnz %g4, loop_wait0 | |
111 | ||
112 | read_synd1: | |
113 | ldx [%g6], %i1 | |
114 | ||
115 | set_eie: | |
116 | setx SOC_EIE_REG, %l7, %g1 | |
117 | stx %g2, [%g1] | |
118 | membar 0x40 | |
119 | ||
120 | read_synd2: | |
121 | ldx [%g6], %i1 | |
122 | ||
123 | set 0x20, %g4 | |
124 | loop_wait: | |
125 | nop; nop; nop | |
126 | nop; nop; nop | |
127 | dec %g4 | |
128 | brnz %g4, loop_wait | |
129 | nop | |
130 | ||
131 | ||
132 | check_error_trap: | |
133 | setx EXECUTED, %l1, %l0 | |
134 | cmp %o0, %l0 | |
135 | bne test_fail | |
136 | nop | |
137 | ||
138 | mov TT_Sw_Correctable_ECC, %l0 | |
139 | cmp %o1, %l0 | |
140 | bne test_fail | |
141 | nop | |
142 | */ | |
143 | ||
144 | ba test_pass | |
145 | nop | |
146 | ||
147 | ||
148 | /*********** | |
149 | Done | |
150 | ***********/ | |
151 | test_pass: | |
152 | EXIT_GOOD | |
153 | ||
154 | test_fail: | |
155 | EXIT_BAD | |
156 | ||
157 | /**************** | |
158 | Trap Handler | |
159 | ****************/ | |
160 | My_Recoverable_Sw_error_trap: | |
161 | setx EXECUTED, %l0, %o0 ! Signal trap taken | |
162 | rdpr %tt, %o1 ! save trap type value | |
163 | ||
164 | chk_per: | |
165 | setx 0x8000000000000000, %g5, %g7 !valid bit | |
166 | set 0x1, %g1 | |
167 | sllx %g1, NcuPcxData, %g2 ! %g2 has NcuPcxData ON | |
168 | or %g7, %g2, %i3 ! %g7->Valid bit; %g2->NcuPcxData bit | |
169 | ||
170 | setx SOC_PER_REG, %l7, %g6 | |
171 | ldx [%g6], %i1 | |
172 | ||
173 | sub %i1, %i3, %i4 | |
174 | brnz %i4, test_fail | |
175 | nop | |
176 | ||
177 | /* | |
178 | chk_esr: | |
179 | setx SOC_ESR_REG, %l7, %g5 | |
180 | ldx [%g5], %i1 | |
181 | brnz %i1, test_fail | |
182 | nop | |
183 | */ | |
184 | ||
185 | chk_synd: | |
186 | setx SOC_NCU_SYN_REG, %l7, %g5 | |
187 | ldx [%g5], %i1 | |
188 | brz %i1, test_fail | |
189 | nop | |
190 | ||
191 | retry | |
192 | nop | |
193 | ||
194 | /************************************************************************ | |
195 | Test case data start | |
196 | ************************************************************************/ | |
197 | .data | |
198 | user_data_start: | |
199 | .xword 0x0000000000000000 | |
200 | .xword 0xffffffffffffffff | |
201 | .xword 0xa55a5aa5a55a5aa5 | |
202 | .xword 0x5aa5a55a5aa5a55a | |
203 | .end | |
204 | ||
205 | ||
206 | ||
207 |