Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_adv_niu_mix_rx_1.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_Hw_Corrected_Error_0x63 My_Corrected_ECC_error_trap | |
39 | #define H_HT0_Sw_Recoverable_Error_0x40 My_Recoverable_Sw_error_trap | |
40 | ||
41 | ||
42 | /* #define MAIN_PAGE_NUCLEUS_ALSO */ /* Access main in priviledge mode */ | |
43 | #define MAIN_PAGE_HV_ALSO | |
44 | ||
45 | #include "hboot.s" | |
46 | #include "niu_defines.h" | |
47 | ||
48 | #define ERR_BITS 0x184800004 | |
49 | ||
50 | /************************************************************************ | |
51 | Test case code start | |
52 | ************************************************************************/ | |
53 | .text | |
54 | .global main | |
55 | .global My_Corrected_ECC_error_trap | |
56 | .global My_Recoverable_Sw_error_trap | |
57 | ||
58 | main: | |
59 | ta T_CHANGE_HPRIV | |
60 | nop | |
61 | ||
62 | !#include "niu_init.h" | |
63 | ! | |
64 | ! Thread 0 Start | |
65 | ! | |
66 | ! | |
67 | !thread_0: | |
68 | nop | |
69 | ||
70 | ||
71 | ||
72 | /************************************ | |
73 | RAS | |
74 | *************************************/ | |
75 | clear_esr_first: | |
76 | setx SOC_ESR_REG, %l7, %i0 | |
77 | stx %g0, [%i0] | |
78 | ||
79 | ||
80 | ||
81 | set_ejr_rdd: | |
82 | setx ERR_BITS, %l7, %g5 | |
83 | ||
84 | setx SOC_EJR_REG, %l7, %i3 | |
85 | stx %g5, [%i3] | |
86 | membar 0x40 | |
87 | ||
88 | ||
89 | /*************************************/ | |
90 | ||
91 | ||
92 | ||
93 | /************************************************************************ | |
94 | First call the Vera, so that values are updated in Memory and | |
95 | then read those values from assembly and program the registers | |
96 | ************************************************************************/ | |
97 | P_NIU_RxInitDma: | |
98 | nop !$EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxInitDma)) -> NIU_InitRxDma(RXDMA_CHNL, RX_DESC_RING_LENGTH, RX_COMPL_RING_LEN, RBR_CONFIG_B_DATA, RX_INITIAL_KICK, NIU_Xlate_On) | |
99 | ||
100 | setx 0x5, %g1, %g4 ! Delay for Vera to complete | |
101 | delay_loop_Rx: | |
102 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
103 | nop | |
104 | nop | |
105 | nop | |
106 | nop | |
107 | dec %g4 | |
108 | brnz %g4, delay_loop_Rx | |
109 | nop | |
110 | ||
111 | nop | |
112 | setx RXDMA_CHNL, %g1, %o0 | |
113 | setx RX_DESC_RING_LENGTH, %g1, %o1 | |
114 | setx RX_COMPL_RING_LEN, %g1, %o2 | |
115 | setx RBR_CONFIG_B_DATA, %g1, %o3 | |
116 | setx RX_INITIAL_KICK, %g1, %o4 | |
117 | call NiuInitRxDma | |
118 | nop | |
119 | ||
120 | P_NIU_RxPkt_Conf: | |
121 | nop !$EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT, MAC_ID) | |
122 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! Just for Delay | |
123 | nop | |
124 | ||
125 | ||
126 | P_NIU_Rx_GenPkt: | |
127 | setx RXMAC_PKTCNT, %g1, %g6 ! Packet count | |
128 | nop | |
129 | Rx_pktcnt_loop: | |
130 | nop !$EV trig_pc_d(1, @VA(.MAIN.Rx_pktcnt_loop)) -> NIU_RxGenPkt(MAC_ID, RXDMA_CHNL, 1, MAC_PKT_LEN, 0x0, RX_NIU_MULTI_DMA, 1) | |
131 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! just for delay | |
132 | nop | |
133 | dec %g6 | |
134 | brnz %g6, Rx_pktcnt_loop | |
135 | nop | |
136 | ||
137 | setx loop_count, %g1, %g4 | |
138 | delay_loop: | |
139 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
140 | nop | |
141 | nop | |
142 | nop | |
143 | nop | |
144 | dec %g4 | |
145 | brnz %g4, delay_loop | |
146 | nop | |
147 | ||
148 | ||
149 | test_passed: | |
150 | nop | |
151 | EXIT_GOOD | |
152 | ||
153 | !.global test_failed | |
154 | test_failed: | |
155 | EXIT_BAD | |
156 | ||
157 | ||
158 | /************************************************************************ | |
159 | RAS | |
160 | Trap Handlers | |
161 | ************************************************************************/ | |
162 | My_Recoverable_Sw_error_trap: | |
163 | ! Signal trap taken | |
164 | setx EXECUTED, %l0, %o6 | |
165 | ! save trap type value | |
166 | rdpr %tt, %o7 | |
167 | ||
168 | inc %i7 | |
169 | ||
170 | check_desr_tt40: | |
171 | ldxa [%g0]0x4c, %g2 | |
172 | nop | |
173 | setx 0xb300000000000000, %l0, %g3 | |
174 | subcc %g2, %g3, %g4 | |
175 | brnz %g4, test_failed | |
176 | nop | |
177 | ||
178 | check_per_tt40: | |
179 | setx SOC_PER_REG, %l7, %i0 | |
180 | ldx [%i0], %i1 | |
181 | setx 0x8000000000000000, %l7, %o3 !valid bit | |
182 | set 0x1, %i2 | |
183 | sllx %i2, ERR_FIELD, %i3 | |
184 | or %i3, %o3, %i4 | |
185 | sub %i1, %i4, %i5 | |
186 | brnz %i5, test_failed | |
187 | nop | |
188 | ||
189 | clear_per_tt40: | |
190 | setx SOC_PER_REG, %l7, %i0 | |
191 | stx %g0, [%i0] | |
192 | nop | |
193 | done | |
194 | nop | |
195 | ||
196 | ||
197 | ||
198 | My_Corrected_ECC_error_trap: | |
199 | ! Signal trap taken | |
200 | setx EXECUTED, %l0, %o6 | |
201 | ! save trap type value | |
202 | rdpr %tt, %o7 | |
203 | ||
204 | inc %i7 | |
205 | ||
206 | check_desr_tt63: | |
207 | ldxa [%g0]0x4c, %g2 | |
208 | nop | |
209 | setx 0x8b00000000000000, %l0, %g3 | |
210 | subcc %g2, %g3, %g4 | |
211 | brnz %g4, test_failed | |
212 | ||
213 | check_per_tt63: | |
214 | setx SOC_PER_REG, %l7, %i0 | |
215 | ldx [%i0], %i1 | |
216 | setx 0x8000000000000000, %l7, %o3 !valid bit | |
217 | set 0x1, %i2 | |
218 | sllx %i2, ERR_FIELD, %i3 | |
219 | or %i3, %o3, %i4 | |
220 | sub %i1, %i4, %i5 | |
221 | brnz %i5, test_failed | |
222 | nop | |
223 | ||
224 | clear_per_tt63: | |
225 | setx SOC_PER_REG, %l7, %i0 | |
226 | stx %g0, [%i0] | |
227 | nop | |
228 | retry | |
229 | nop | |
230 | ||
231 | /************************************************************************ | |
232 | Test case data start | |
233 | ************************************************************************/ | |
234 | /* These initialization is temporary, as there looks some bug in mempli */ | |
235 | ! | |
236 | !SECTION SetRngConfig_init data_va=0x100000000 | |
237 | !attr_data { | |
238 | ! Name = SetRngConfig_init, | |
239 | ! hypervisor, | |
240 | ! compressimage | |
241 | ! } | |
242 | !.data | |
243 | !SetRngConfig_init: | |
244 | ! .xword 0x0060452301000484 | |
245 | /************************************************************************/ | |
246 | ||
247 | SECTION SetRxLogMask1_init data_va=0x200000100 | |
248 | attr_data { | |
249 | Name = SetRxLogMask1_init, | |
250 | hypervisor, | |
251 | compressimage | |
252 | } | |
253 | .data | |
254 | SetRxLogMask1_init: | |
255 | .xword 0x0060452301000484 | |
256 | /************************************************************************/ | |
257 | ||
258 | SECTION SetRxLogVal1_init data_va=0x200000200 | |
259 | attr_data { | |
260 | Name = SetRxLogVal1_init, | |
261 | hypervisor, | |
262 | compressimage | |
263 | } | |
264 | .data | |
265 | SetRxLogVal1_init: | |
266 | .xword 0x0060452301000484 | |
267 | /************************************************************************/ | |
268 | ||
269 | SECTION SetRxLogRelo1_init data_va=0x200000300 | |
270 | attr_data { | |
271 | Name = SetRxLogRelo1_init, | |
272 | hypervisor, | |
273 | compressimage | |
274 | } | |
275 | .data | |
276 | SetRxLogRelo1_init: | |
277 | .xword 0x0060452301000484 | |
278 | /************************************************************************/ | |
279 | ||
280 | SECTION SetRxLogPgVld_init data_va=0x200000400 | |
281 | attr_data { | |
282 | Name = SetRxLogPgVld_init, | |
283 | hypervisor, | |
284 | compressimage | |
285 | } | |
286 | .data | |
287 | SetRxLogPgVld_init: | |
288 | .xword 0x0060452301000484 | |
289 | /************************************************************************/ | |
290 | SECTION SetRbrConfig_A_init data_va=0x200000500 | |
291 | attr_data { | |
292 | Name = SetRbrConfig_A_init, | |
293 | hypervisor, | |
294 | compressimage | |
295 | } | |
296 | .data | |
297 | SetRbrConfig_A_init: | |
298 | .xword 0x0060452301000484 | |
299 | /************************************************************************/ | |
300 | SECTION SetRbrConfig_B_init data_va=0x200000600 | |
301 | attr_data { | |
302 | Name = SetRbrConfig_B_init, | |
303 | hypervisor, | |
304 | compressimage | |
305 | } | |
306 | .data | |
307 | SetRbrConfig_B_init: | |
308 | .xword 0x0060452301000484 | |
309 | /************************************************************************/ | |
310 | SECTION SetRcrConfig_A_init data_va=0x200000700 | |
311 | attr_data { | |
312 | Name = SetRcrConfig_A_init, | |
313 | hypervisor, | |
314 | compressimage | |
315 | } | |
316 | .data | |
317 | SetRcrConfig_A_init: | |
318 | .xword 0x0060452301000484 | |
319 | /************************************************************************/ | |
320 | SECTION SetRxDmaCfig_1_0_init data_va=0x200000800 | |
321 | attr_data { | |
322 | Name = SetRxDmaCfig_1_0_init, | |
323 | hypervisor, | |
324 | compressimage | |
325 | } | |
326 | .data | |
327 | SetRxDmaCfig_1_0_init: | |
328 | .xword 0x0060452301000484 | |
329 | /************************************************************************/ | |
330 | SECTION SetRxdmaCfig2Start_init data_va=0x200000900 | |
331 | attr_data { | |
332 | Name = SetRxdmaCfig2Start_init, | |
333 | hypervisor, | |
334 | compressimage | |
335 | } | |
336 | .data | |
337 | SetRxdmaCfig2Start_init: | |
338 | .xword 0x0060452301000484 | |
339 | /************************************************************************/ | |
340 | SECTION SetRxDmaCfig_1_1_init data_va=0x200000a00 | |
341 | attr_data { | |
342 | Name = SetRxDmaCfig_1_1_init, | |
343 | hypervisor, | |
344 | compressimage | |
345 | } | |
346 | .data | |
347 | SetRxDmaCfig_1_1_init: | |
348 | .xword 0x0060452301000484 | |
349 | ||
350 | /************************************************************************/ | |
351 | ||
352 | SECTION SetRxRingKick_init data_va=0x200000b00 | |
353 | attr_data { | |
354 | Name = SetRxRingKick_init, | |
355 | hypervisor, | |
356 | compressimage | |
357 | } | |
358 | .data | |
359 | SetRxRingKick_init: | |
360 | .xword 0x0060452301000484 | |
361 | /************************************************************************/ | |
362 | ||
363 | SECTION SetRxLogMask2_init data_va=0x200000c00 | |
364 | attr_data { | |
365 | Name = SetRxLogMask2_init, | |
366 | hypervisor, | |
367 | compressimage | |
368 | } | |
369 | .data | |
370 | SetRxLogMask2_init: | |
371 | .xword 0x0060452301000484 | |
372 | /************************************************************************/ | |
373 | ||
374 | SECTION SetRxLogVal2_init data_va=0x200000d00 | |
375 | attr_data { | |
376 | Name = SetRxLogVal2_init, | |
377 | hypervisor, | |
378 | compressimage | |
379 | } | |
380 | .data | |
381 | SetRxLogVal2_init: | |
382 | .xword 0x0060452301000484 | |
383 | /************************************************************************/ | |
384 | ||
385 | SECTION SetRxLogRelo2_init data_va=0x200000e00 | |
386 | attr_data { | |
387 | Name = SetRxLogRelo2_init, | |
388 | hypervisor, | |
389 | compressimage | |
390 | } | |
391 | .data | |
392 | SetRxLogRelo2_init: | |
393 | .xword 0x0060452301000484 | |
394 | ||
395 | /************************************************************************/ |