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