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