Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / error / siu / n2_err_siu_niu_tx_uev.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: n2_err_siu_niu_tx_uev.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 Test case code start
46 ************************************************************************/
47.text
48.global main
49
50main:
51 ta T_CHANGE_HPRIV
52 nop
53
54! #include "niu_init.h"
55!
56! Thread 0 Start
57!
58!
59! thread_0:
60
61Init_flow:
62 nop ! $EV trig_pc_d(1, @VA(.MAIN.Init_flow)) -> pktGenConfig(MAC_ID, FRAME_TYPE, FRAME_CLASS,TX_PKT_LEN)
63
64P_TxDMAActivate:
65 setx MAC_ID, %g1, %o0 ! 1st Parameter
66 setx SetTxDMAActive_list, %g1, %o1 ! 2st parameter
67 call SetTxDMAActive
68 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_TxDMAActivate)) -> NIU_TxDMAActivate (MAC_ID, TxDmaActive_list)
69
70P_AddTxChannels :
71 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_AddTxChannels)) -> NIU_AddTxChannels(MAC_ID, NIU_TxDmaNoUE)
72
73 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! Just for delay
74 nop
75
76P_SetTxMaxBurst :
77 setx NIU_TxDmaNo, %g1, %o0 ! 1st parameter :
78 setx SetTxMaxBurst_Data, %g1, %o1 ! 2nd parameter
79 call SetTxMaxBurst
80 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_SetTxMaxBurst)) -> NIU_SetTxMaxBurst (MAC_ID, NIU_TxDmaNoUE, TxMaxBurst_Data)
81
82 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! Just for delay
83 nop
84
85P_InitTxDma:
86 setx NIU_TxDmaNo, %g1, %o0 ! 1st parameter :
87 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_InitTxDma)) -> NIU_InitTxDma (MAC_ID, NIU_TxDmaNoUE, NIU_Xlate_On)
88 call InitTxDma
89 nop
90
91 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! Just for delay
92 nop
93
94
95 /************************************
96 RAS
97 *************************************/
98inj_err:
99 nop !$EV trig_pc_d(0,@VA(.MAIN.inj_err)) ->IosErrInj(NIUSII_CCE, 00, 3456000)
100
101Gen_Packet:
102 nop ! $EV trig_pc_d(1, @VA(.MAIN.Gen_Packet)) -> TxPktGen(MAC_ID, NIU_TxDmaNoUE,NIU_TX_PKT_CNT, 0, 0)
103 nop
104
105 setx 0x5, %g1, %g4
106delay_loop_tmp:
107 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
108 nop
109 nop
110 nop
111 nop
112 dec %g4
113 brnz %g4, delay_loop_tmp
114 nop
115
116
117SetTxRingKick:
118 setx NIU_PKTGEN_CSR_EV2A_TX_RNG_KICK, %g1, %g2 ! $EV trig_pc_d(1, @VA(.MAIN.SetTxRingKick)) -> NIU_SetTxRingKick(MAC_ID, NIU_TxDmaNoUE)
119 setx NIU_TxDmaNo, %g1, %o0
120 ldx [%g2], %g3
121 nop
122 mulx %o0, 0x200, %g5
123 setx TX_RING_KICK_Addr, %g1, %g2
124 add %g2, %g5, %g2
125 stxa %g3, [%g2]ASI_PRIMARY_LITTLE
126 nop
127
128SetTxCs :
129 setx NIU_TxDmaNo, %g1, %o0
130 setx TX_CS_Data, %g1, %g3
131 mulx %o0, 0x200, %g5
132 setx TX_CS_Addr, %g1, %g2
133 add %g2, %g5, %g2
134 stxa %g3, [%g2]ASI_PRIMARY_LITTLE
135 nop
136
137
138#ifdef JUMBO_FRAME_EN /* Extra Delay for Jumbo packets to go out */
139 setx loop_count, %g1, %g4
140delay_loop:
141 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
142 nop
143 nop
144 nop
145 nop
146 dec %g4
147 brnz %g4, delay_loop
148 nop
149#endif
150
151/*
152#ifdef CE
153NIUTx_Pkt_Cnt_Chk:
154 setx MAC_ID, %g1, %o0
155 setx NIU_TX_PKT_CNT, %g1, %o1
156 call NiuTx_check_pkt_cnt
157 nop
158
159 setx loop_count, %g1, %g4
160delay_loop_end:
161 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
162 nop
163 nop
164 nop
165 nop
166 dec %g4
167 brnz %g4, delay_loop_end
168 nop
169#endif
170*/
171
172 setx 0x80, %g1, %g4
173delay_ras:
174 setx 0x2000000, %g1, %g2
175 ldx [%g2], %g3
176 nop
177 nop
178 dec %g4
179 brnz %g4, delay_ras
180 nop
181
182 /************************************
183 RAS
184 *************************************/
185read_esr:
186 setx SOC_ESR_REG, %l7, %i0
187 ldx [%i0], %i1
188 nop
189
190 setx 0x8000000000000000, %l7, %o3 !valid bit
191 set 0x1, %i2
192 sllx %i2, ERR_FIELD, %i3
193 or %i3, %o3, %i4
194 sub %i1, %i4, %i5
195 brnz %i5, test_fail
196 nop
197 /*************************************/
198
199test_passed:
200/*
201#ifdef CE
202 nop ! $EV trig_pc_d(1, @VA(.MAIN.test_passed)) -> NIU_EXIT_chk(MAC_ID)
203#endif
204*/
205
206 EXIT_GOOD
207
208!.global test_failed
209!test_failed:
210! EXIT_BAD
211
212test_fail:
213 EXIT_BAD
214
215
216/************************************************************************
217 Test case data start
218 ************************************************************************/
219/* These initialization is temporary, as there looks some bug in mempli */
220
221SECTION SetRngConfig_init data_va=0x100000000
222attr_data {
223 Name = SetRngConfig_init,
224 hypervisor,
225 compressimage
226 }
227.data
228SetRngConfig_init:
229 .xword 0x0060452301000484
230/************************************************************************/
231
232SECTION SetTxRingKick_init data_va=0x100000100
233attr_data {
234 Name = SetTxRingKick_init,
235 hypervisor,
236 compressimage
237 }
238.data
239SetTxRingKick_init:
240 .xword 0x0060452301000484
241/************************************************************************/
242
243SECTION SetTxLPMask1_init data_va=0x100000200
244attr_data {
245 Name = SetTxLPMask1_init,
246 hypervisor,
247 compressimage
248 }
249.data
250SetTxLPMask1_init:
251 .xword 0x0060452301000484
252/************************************************************************/
253
254SECTION SetTxLPValue1_init data_va=0x100000300
255attr_data {
256 Name = SetTxLPValue1_init,
257 hypervisor,
258 compressimage
259 }
260.data
261SetTxLPValue1_init:
262 .xword 0x0060452301000484
263/************************************************************************/
264
265SECTION SetTxLPRELOC1_init data_va=0x100000400
266attr_data {
267 Name = SetTxLPRELOC1_init,
268 hypervisor,
269 compressimage
270 }
271.data
272SetTxLPRELOC1_init:
273 .xword 0x0060452301000484
274/************************************************************************/
275SECTION SetTxLPMask2_init data_va=0x100000500
276attr_data {
277 Name = SetTxLPMask2_init,
278 hypervisor,
279 compressimage
280 }
281.data
282SetTxLPMask2_init:
283 .xword 0x0060452301000484
284/************************************************************************/
285SECTION SetTxLPValue2_init data_va=0x100000600
286attr_data {
287 Name = SetTxLPValue2_init,
288 hypervisor,
289 compressimage
290 }
291.data
292SetTxLPValue2_init:
293 .xword 0x0060452301000484
294
295/************************************************************************/
296SECTION SetTxLPRELOC2_init data_va=0x100000700
297attr_data {
298 Name = SetTxLPRELOC2_init,
299 hypervisor,
300 compressimage
301 }
302.data
303SetTxLPRELOC2_init:
304 .xword 0x0060452301000484
305
306/************************************************************************/
307SECTION SetTxLPValid_init data_va=0x100000800
308attr_data {
309 Name = SetTxLPValid_init,
310 hypervisor,
311 compressimage
312 }
313.data
314SetTxLPValid_init:
315 .xword 0x0060452301000484
316
317/************************************************************************/
318