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