Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_rx_uev_rand_l2siocce.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 | #include "err_defines.h" | |
41 | #include "hboot.s" | |
42 | #include "niu_defines.h" | |
43 | ||
44 | ||
45 | /************************************************************************ | |
46 | Test case code start | |
47 | ************************************************************************/ | |
48 | .text | |
49 | .global main | |
50 | ||
51 | main: | |
52 | ta T_CHANGE_HPRIV | |
53 | nop | |
54 | ||
55 | ||
56 | /****************************** | |
57 | RAS | |
58 | Error Injection | |
59 | ******************************/ | |
60 | clear_esr_first: | |
61 | setx SOC_ESR_REG, %l7, %i0 | |
62 | stx %g0, [%i0] | |
63 | ||
64 | inj_err: | |
65 | nop !$EV trig_pc_d(0,@VA(.MAIN.inj_err)) ->IosRandErrInj(L2SIO_CCE, 10, 10) | |
66 | nop | |
67 | ||
68 | /************************************************************************ | |
69 | First call the Vera, so that values are updated in Memory and | |
70 | then read those values from assembly and program the registers | |
71 | ************************************************************************/ | |
72 | P_NIU_RxInitDma: | |
73 | 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) | |
74 | ||
75 | setx 0x5, %g1, %g4 ! Delay for Vera to complete | |
76 | delay_loop_Rx: | |
77 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
78 | nop | |
79 | nop | |
80 | nop | |
81 | nop | |
82 | dec %g4 | |
83 | brnz %g4, delay_loop_Rx | |
84 | nop | |
85 | ||
86 | nop | |
87 | setx RXDMA_CHNL, %g1, %o0 | |
88 | setx RX_DESC_RING_LENGTH, %g1, %o1 | |
89 | setx RX_COMPL_RING_LEN, %g1, %o2 | |
90 | setx RBR_CONFIG_B_DATA, %g1, %o3 | |
91 | setx RX_INITIAL_KICK, %g1, %o4 | |
92 | call NiuInitRxDma | |
93 | nop | |
94 | ||
95 | P_NIU_RxPkt_Conf: | |
96 | nop !$EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT) | |
97 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! Just for Delay | |
98 | nop | |
99 | ||
100 | ||
101 | P_NIU_Rx_GenPkt: | |
102 | setx RXMAC_PKTCNT, %g1, %g6 ! Packet count | |
103 | nop | |
104 | Rx_pktcnt_loop: | |
105 | nop !$EV trig_pc_d(1, @VA(.MAIN.Rx_pktcnt_loop)) -> NIU_RxGenPkt(MAC_ID, RXDMA_CHNL, 1, MAC_PKT_LEN, 1) | |
106 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! just for delay | |
107 | nop | |
108 | dec %g6 | |
109 | brnz %g6, Rx_pktcnt_loop | |
110 | nop | |
111 | ||
112 | setx loop_count, %g1, %g4 | |
113 | delay_loop: | |
114 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
115 | nop | |
116 | nop | |
117 | nop | |
118 | nop | |
119 | dec %g4 | |
120 | brnz %g4, delay_loop | |
121 | nop | |
122 | ||
123 | ||
124 | /****************************** | |
125 | Error Check | |
126 | ******************************/ | |
127 | read_esr: | |
128 | setx SOC_ESR_REG, %l7, %i0 | |
129 | ldx [%i0], %i1 | |
130 | nop | |
131 | ||
132 | setx 0x8000000000000000, %l7, %o3 !valid bit | |
133 | set 0x1, %i2 | |
134 | sllx %i2, ERR_FIELD, %i3 | |
135 | or %i3, %o3, %i4 | |
136 | sub %i1, %i4, %i5 | |
137 | brnz %i5, test_fail | |
138 | nop | |
139 | /********************************/ | |
140 | ||
141 | test_passed: | |
142 | nop | |
143 | EXIT_GOOD | |
144 | ||
145 | !.global test_failed | |
146 | !test_failed: | |
147 | ! EXIT_BAD | |
148 | ||
149 | test_fail: | |
150 | EXIT_BAD | |
151 | nop | |
152 | ||
153 | ||
154 | /************************************************************************ | |
155 | Test case data start | |
156 | ************************************************************************/ | |
157 | /* These initialization is temporary, as there looks some bug in mempli */ | |
158 | ! | |
159 | !SECTION SetRngConfig_init data_va=0x100000000 | |
160 | !attr_data { | |
161 | ! Name = SetRngConfig_init, | |
162 | ! hypervisor, | |
163 | ! compressimage | |
164 | ! } | |
165 | !.data | |
166 | !SetRngConfig_init: | |
167 | ! .xword 0x0060452301000484 | |
168 | /************************************************************************/ | |
169 | ||
170 | SECTION SetRxLogMask1_init data_va=0x200000100 | |
171 | attr_data { | |
172 | Name = SetRxLogMask1_init, | |
173 | hypervisor, | |
174 | compressimage | |
175 | } | |
176 | .data | |
177 | SetRxLogMask1_init: | |
178 | .xword 0x0060452301000484 | |
179 | /************************************************************************/ | |
180 | ||
181 | SECTION SetRxLogVal1_init data_va=0x200000200 | |
182 | attr_data { | |
183 | Name = SetRxLogVal1_init, | |
184 | hypervisor, | |
185 | compressimage | |
186 | } | |
187 | .data | |
188 | SetRxLogVal1_init: | |
189 | .xword 0x0060452301000484 | |
190 | /************************************************************************/ | |
191 | ||
192 | SECTION SetRxLogRelo1_init data_va=0x200000300 | |
193 | attr_data { | |
194 | Name = SetRxLogRelo1_init, | |
195 | hypervisor, | |
196 | compressimage | |
197 | } | |
198 | .data | |
199 | SetRxLogRelo1_init: | |
200 | .xword 0x0060452301000484 | |
201 | /************************************************************************/ | |
202 | ||
203 | SECTION SetRxLogPgVld_init data_va=0x200000400 | |
204 | attr_data { | |
205 | Name = SetRxLogPgVld_init, | |
206 | hypervisor, | |
207 | compressimage | |
208 | } | |
209 | .data | |
210 | SetRxLogPgVld_init: | |
211 | .xword 0x0060452301000484 | |
212 | /************************************************************************/ | |
213 | SECTION SetRbrConfig_A_init data_va=0x200000500 | |
214 | attr_data { | |
215 | Name = SetRbrConfig_A_init, | |
216 | hypervisor, | |
217 | compressimage | |
218 | } | |
219 | .data | |
220 | SetRbrConfig_A_init: | |
221 | .xword 0x0060452301000484 | |
222 | /************************************************************************/ | |
223 | SECTION SetRbrConfig_B_init data_va=0x200000600 | |
224 | attr_data { | |
225 | Name = SetRbrConfig_B_init, | |
226 | hypervisor, | |
227 | compressimage | |
228 | } | |
229 | .data | |
230 | SetRbrConfig_B_init: | |
231 | .xword 0x0060452301000484 | |
232 | /************************************************************************/ | |
233 | SECTION SetRcrConfig_A_init data_va=0x200000700 | |
234 | attr_data { | |
235 | Name = SetRcrConfig_A_init, | |
236 | hypervisor, | |
237 | compressimage | |
238 | } | |
239 | .data | |
240 | SetRcrConfig_A_init: | |
241 | .xword 0x0060452301000484 | |
242 | /************************************************************************/ | |
243 | SECTION SetRxDmaCfig_1_0_init data_va=0x200000800 | |
244 | attr_data { | |
245 | Name = SetRxDmaCfig_1_0_init, | |
246 | hypervisor, | |
247 | compressimage | |
248 | } | |
249 | .data | |
250 | SetRxDmaCfig_1_0_init: | |
251 | .xword 0x0060452301000484 | |
252 | /************************************************************************/ | |
253 | SECTION SetRxdmaCfig2Start_init data_va=0x200000900 | |
254 | attr_data { | |
255 | Name = SetRxdmaCfig2Start_init, | |
256 | hypervisor, | |
257 | compressimage | |
258 | } | |
259 | .data | |
260 | SetRxdmaCfig2Start_init: | |
261 | .xword 0x0060452301000484 | |
262 | /************************************************************************/ | |
263 | SECTION SetRxDmaCfig_1_1_init data_va=0x200000a00 | |
264 | attr_data { | |
265 | Name = SetRxDmaCfig_1_1_init, | |
266 | hypervisor, | |
267 | compressimage | |
268 | } | |
269 | .data | |
270 | SetRxDmaCfig_1_1_init: | |
271 | .xword 0x0060452301000484 | |
272 | ||
273 | /************************************************************************/ | |
274 | ||
275 | SECTION SetRxRingKick_init data_va=0x200000b00 | |
276 | attr_data { | |
277 | Name = SetRxRingKick_init, | |
278 | hypervisor, | |
279 | compressimage | |
280 | } | |
281 | .data | |
282 | SetRxRingKick_init: | |
283 | .xword 0x0060452301000484 | |
284 | /************************************************************************/ | |
285 | ||
286 | SECTION SetRxLogMask2_init data_va=0x200000c00 | |
287 | attr_data { | |
288 | Name = SetRxLogMask2_init, | |
289 | hypervisor, | |
290 | compressimage | |
291 | } | |
292 | .data | |
293 | SetRxLogMask2_init: | |
294 | .xword 0x0060452301000484 | |
295 | /************************************************************************/ | |
296 | ||
297 | SECTION SetRxLogVal2_init data_va=0x200000d00 | |
298 | attr_data { | |
299 | Name = SetRxLogVal2_init, | |
300 | hypervisor, | |
301 | compressimage | |
302 | } | |
303 | .data | |
304 | SetRxLogVal2_init: | |
305 | .xword 0x0060452301000484 | |
306 | /************************************************************************/ | |
307 | ||
308 | SECTION SetRxLogRelo2_init data_va=0x200000e00 | |
309 | attr_data { | |
310 | Name = SetRxLogRelo2_init, | |
311 | hypervisor, | |
312 | compressimage | |
313 | } | |
314 | .data | |
315 | SetRxLogRelo2_init: | |
316 | .xword 0x0060452301000484 | |
317 | ||
318 | /************************************************************************/ |