Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / niu / NIU_Rx / rx_p0_MULTI_3DMA_rand_07.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: rx_p0_MULTI_3DMA_rand_07.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"rx_p0p1_MULTI_2DMA_rand_0C.s
41#include "niu_defines.h"
42#define FAIR_PKT_COUNT ((RXMAC_PKTCNT) - (RXMAC_PKTCNT%8))
43
44.text
45.global main
46
47main:
48 ta T_CHANGE_HPRIV
49 nop
50# 94 "diag.j.pp"
51!
52! Thread 0 Start
53!
54!
55!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
56! Init DMA Channel 0 @@@@@@@@@@@@@@@@@@@@@@@@@@@@
57!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
58
59P_NIU_RxInitDma_0:
60 setx TX_CS, %g1, %g2
61 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxInitDma_0)) -> NIU_InitRxDma(0, RX_DESC_RING_LENGTH, RX_COMPL_RING_LEN, RBR_CONFIG_B_DATA, RX_INITIAL_KICK, 0x0, NIU_RX_MULTI_DMA)
62 setx 0x5, %g1, %g4
63delay_loop_Rx_0:
64 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
65 nop
66 nop
67 nop
68 nop
69 dec %g4
70 brnz %g4, delay_loop_Rx_0
71 nop
72
73 nop
74 setx 0x0, %g1, %o0
75 setx 0x0, %g1, %o1
76 setx RX_DESC_RING_LENGTH, %g1, %o2
77 setx RX_COMPL_RING_LEN, %g1, %o3
78 setx RBR_CONFIG_B_DATA, %g1, %o4
79 setx RX_INITIAL_KICK, %g1, %o5
80 call NiuInitRxDma
81 nop
82!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
83! Init DMA Channel 1 @@@@@@@@@@@@@@@@@@@@@@@@@@@@
84!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
85
86P_NIU_RxInitDma_1:
87 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxInitDma_1)) -> NIU_InitRxDma(1, RX_DESC_RING_LENGTH, RX_COMPL_RING_LEN, RBR_CONFIG_B_DATA, RX_INITIAL_KICK, 0x0, NIU_RX_MULTI_DMA)
88 setx 0x5, %g1, %g4
89delay_loop_Rx_1:
90 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
91 nop
92 nop
93 nop
94 nop
95 dec %g4
96 brnz %g4, delay_loop_Rx_1
97 nop
98
99 nop
100 setx 0x1, %g1, %o0
101 setx 0x1, %g1, %l2
102 setx RX_DESC_RING_LENGTH, %g1, %o2
103 setx RX_COMPL_RING_LEN, %g1, %o3
104 setx RBR_CONFIG_B_DATA, %g1, %o4
105 setx RX_INITIAL_KICK, %g1, %o5
106 setx NIU_RX_MULTI_DMA, %g1, %o6
107 call NiuInitRxDma
108 nop
109!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
110! Init DMA Channel 2 @@@@@@@@@@@@@@@@@@@@@@@@@@@@
111!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
112
113P_NIU_RxInitDma_2:
114 nop ! $EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxInitDma_2)) -> NIU_InitRxDma(2, RX_DESC_RING_LENGTH, RX_COMPL_RING_LEN, RBR_CONFIG_B_DATA, RX_INITIAL_KICK, 0x0, NIU_RX_MULTI_DMA)
115 setx 0x5, %g1, %g4
116delay_loop_Rx_2:
117 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
118 nop
119 nop
120 nop
121 nop
122 dec %g4
123 brnz %g4, delay_loop_Rx_2
124 nop
125
126 nop
127 setx 0x2, %g1, %o0
128 setx RX_DESC_RING_LENGTH, %g1, %o2
129 setx RX_COMPL_RING_LEN, %g1, %o3
130 setx RBR_CONFIG_B_DATA, %g1, %o4
131 setx RX_INITIAL_KICK, %g1, %o5
132 setx NIU_RX_MULTI_DMA, %g1, %o6
133 call NiuInitRxDma
134 nop
135P0_NIU_RxPkt_Conf:
136 nop ! $EV trig_pc_d(1, @VA(.MAIN.P0_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT,0)
137 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
138 nop
139P1_NIU_RxPkt_Conf:
140 nop ! $EV trig_pc_d(1, @VA(.MAIN.P1_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT,1)
141 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
142 nop
143P_NIU_Rx_GenPkt:
144 setx RXMAC_PKTCNT, %g1, %g6
145 nop
146Rx_pktcnt_loop:
147 nop ! $EV trig_pc_d(1, @VA(.MAIN.Rx_pktcnt_loop)) -> NIU_RxGenPkt(MAC_ID, 0, RXMAC_PKTCNT, 0x50,0x0, NIU_RX_MULTI_DMA, 1)
148 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
149 nop
150 nop
151 nop
152 nop
153
154delay_loop0:
155 mulx %o1, 0x200, %g4
156 setx RCR_STAT_A, %g7, %g2
157 add %g2, %g4, %g2
158 ldxa [%g2]ASI_PRIMARY_LITTLE, %g4
159
160 mulx %l2, 0x200, %g5
161 setx RCR_STAT_A, %g7, %g2
162 add %g2, %g5, %g2
163 ldxa [%g2]ASI_PRIMARY_LITTLE, %g3
164
165 mulx %o0, 0x200, %g5
166 setx RCR_STAT_A, %g7, %g2
167 add %g2, %g5, %g2
168 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
169
170 add %g5, %g4, %g5
171 add %g5, %g3, %g5
172 cmp %g5, FAIR_PKT_COUNT
173 bne delay_loop0
174 nop
175
176
177test_passed:
178 nop
179 EXIT_GOOD
180# 218 "diag.j.pp"
181
182/************************************************************************
183 Test case data start
184************************************************************************/
185!SECTION SetRngConfig_init data_va=0x100000000
186!attr_data {
187! Name = SetRngConfig_init,
188! hypervisor,
189! compressimage
190! }
191!.data
192!SetRngConfig_init:
193! .xword 0x0060452301000484
194
195SECTION SetRxLogMask1_init data_va=0x200000100
196attr_data {
197 Name = SetRxLogMask1_init,
198 hypervisor,
199 compressimage
200 }
201.data
202SetRxLogMask1_init:
203 .xword 0x0060452301000484
204
205SECTION SetRxLogVal1_init data_va=0x200000200
206attr_data {
207 Name = SetRxLogVal1_init,
208 hypervisor,
209 compressimage
210 }
211.data
212SetRxLogVal1_init:
213 .xword 0x0060452301000484
214
215SECTION SetRxLogRelo1_init data_va=0x200000300
216attr_data {
217 Name = SetRxLogRelo1_init,
218 hypervisor,
219 compressimage
220 }
221.data
222SetRxLogRelo1_init:
223 .xword 0x0060452301000484
224
225SECTION SetRxLogPgVld_init data_va=0x200000400
226attr_data {
227 Name = SetRxLogPgVld_init,
228 hypervisor,
229 compressimage
230 }
231.data
232SetRxLogPgVld_init:
233 .xword 0x0060452301000484
234SECTION SetRbrConfig_A_init data_va=0x200000500
235attr_data {
236 Name = SetRbrConfig_A_init,
237 hypervisor,
238 compressimage
239 }
240.data
241SetRbrConfig_A_init:
242 .xword 0x0060452301000484
243SECTION SetRbrConfig_B_init data_va=0x200000600
244attr_data {
245 Name = SetRbrConfig_B_init,
246 hypervisor,
247 compressimage
248 }
249.data
250SetRbrConfig_B_init:
251 .xword 0x0060452301000484
252SECTION SetRcrConfig_A_init data_va=0x200000700
253attr_data {
254 Name = SetRcrConfig_A_init,
255 hypervisor,
256 compressimage
257 }
258.data
259SetRcrConfig_A_init:
260 .xword 0x0060452301000484
261SECTION SetRxDmaCfig_1_0_init data_va=0x200000800
262attr_data {
263 Name = SetRxDmaCfig_1_0_init,
264 hypervisor,
265 compressimage
266 }
267.data
268SetRxDmaCfig_1_0_init:
269 .xword 0x0060452301000484
270SECTION SetRxdmaCfig2Start_init data_va=0x200000900
271attr_data {
272 Name = SetRxdmaCfig2Start_init,
273 hypervisor,
274 compressimage
275 }
276.data
277SetRxdmaCfig2Start_init:
278 .xword 0x0060452301000484
279SECTION SetRxDmaCfig_1_1_init data_va=0x200000a00
280attr_data {
281 Name = SetRxDmaCfig_1_1_init,
282 hypervisor,
283 compressimage
284 }
285.data
286SetRxDmaCfig_1_1_init:
287 .xword 0x0060452301000484
288# 331 "diag.j.pp"
289SECTION SetRxRingKick_init data_va=0x200000b00
290attr_data {
291 Name = SetRxRingKick_init,
292 hypervisor,
293 compressimage
294 }
295.data
296SetRxRingKick_init:
297 .xword 0x0060452301000484
298
299SECTION SetRxLogMask2_init data_va=0x200000c00
300attr_data {
301 Name = SetRxLogMask2_init,
302 hypervisor,
303 compressimage
304 }
305.data
306SetRxLogMask2_init:
307 .xword 0x0060452301000484
308
309SECTION SetRxLogVal2_init data_va=0x200000d00
310attr_data {
311 Name = SetRxLogVal2_init,
312 hypervisor,
313 compressimage
314 }
315.data
316SetRxLogVal2_init:
317 .xword 0x0060452301000484
318
319SECTION SetRxLogRelo2_init data_va=0x200000e00
320attr_data {
321 Name = SetRxLogRelo2_init,
322 hypervisor,
323 compressimage
324 }
325.data
326SetRxLogRelo2_init:
327 .xword 0x0060452301000484
328# 374 "diag.j.pp"
329
330#if 0
331#endif