Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / niu / NIU_Rx / FcNiuBasicRx_sweep1.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: FcNiuBasicRx_sweep1.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
60/************************************************************************
61 First call the Vera, so that values are updated in Memory and
62 then read those values from assembly and program the registers
63 ************************************************************************/
64P_NIU_RxInitDma:
65 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)
66
67 setx 0x5, %g1, %g4 ! Delay for Vera to complete
68delay_loop_Rx:
69 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
70 nop
71 nop
72 nop
73 nop
74 dec %g4
75 brnz %g4, delay_loop_Rx
76 nop
77
78 nop
79 setx RXDMA_CHNL, %g1, %o0
80 setx RX_DESC_RING_LENGTH, %g1, %o1
81 setx RX_COMPL_RING_LEN, %g1, %o2
82 setx RBR_CONFIG_B_DATA, %g1, %o3
83 setx RX_INITIAL_KICK, %g1, %o4
84 call NiuInitRxDma
85 nop
86
87P_NIU_RxPkt_Conf:
88 nop !$EV trig_pc_d(1, @VA(.MAIN.P_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT, MAC_ID)
89 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! Just for Delay
90 nop
91
92
93P_NIU_Rx_GenPkt:
94 setx RXMAC_PKTCNT, %g1, %g6 ! Packet count
95 nop
96Rx_pktcnt_loop:
97 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)
98 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 ! just for delay
99 nop
100 dec %g6
101 brnz %g6, Rx_pktcnt_loop
102 nop
103
104 setx loop_count, %g1, %g4
105delay_loop:
106 ldxa [%g2]ASI_PRIMARY_LITTLE, %g5
107 nop
108 nop
109 nop
110 nop
111 dec %g4
112 brnz %g4, delay_loop
113 nop
114
115
116test_passed:
117 nop
118 EXIT_GOOD
119
120!.global test_failed
121!test_failed:
122! EXIT_BAD
123
124
125/************************************************************************
126 Test case data start
127 ************************************************************************/
128/* These initialization is temporary, as there looks some bug in mempli */
129!
130!SECTION SetRngConfig_init data_va=0x100000000
131!attr_data {
132! Name = SetRngConfig_init,
133! hypervisor,
134! compressimage
135! }
136!.data
137!SetRngConfig_init:
138! .xword 0x0060452301000484
139/************************************************************************/
140
141SECTION SetRxLogMask1_init data_va=0x200000100
142attr_data {
143 Name = SetRxLogMask1_init,
144 hypervisor,
145 compressimage
146 }
147.data
148SetRxLogMask1_init:
149 .xword 0x0060452301000484
150/************************************************************************/
151
152SECTION SetRxLogVal1_init data_va=0x200000200
153attr_data {
154 Name = SetRxLogVal1_init,
155 hypervisor,
156 compressimage
157 }
158.data
159SetRxLogVal1_init:
160 .xword 0x0060452301000484
161/************************************************************************/
162
163SECTION SetRxLogRelo1_init data_va=0x200000300
164attr_data {
165 Name = SetRxLogRelo1_init,
166 hypervisor,
167 compressimage
168 }
169.data
170SetRxLogRelo1_init:
171 .xword 0x0060452301000484
172/************************************************************************/
173
174SECTION SetRxLogPgVld_init data_va=0x200000400
175attr_data {
176 Name = SetRxLogPgVld_init,
177 hypervisor,
178 compressimage
179 }
180.data
181SetRxLogPgVld_init:
182 .xword 0x0060452301000484
183/************************************************************************/
184SECTION SetRbrConfig_A_init data_va=0x200000500
185attr_data {
186 Name = SetRbrConfig_A_init,
187 hypervisor,
188 compressimage
189 }
190.data
191SetRbrConfig_A_init:
192 .xword 0x0060452301000484
193/************************************************************************/
194SECTION SetRbrConfig_B_init data_va=0x200000600
195attr_data {
196 Name = SetRbrConfig_B_init,
197 hypervisor,
198 compressimage
199 }
200.data
201SetRbrConfig_B_init:
202 .xword 0x0060452301000484
203/************************************************************************/
204SECTION SetRcrConfig_A_init data_va=0x200000700
205attr_data {
206 Name = SetRcrConfig_A_init,
207 hypervisor,
208 compressimage
209 }
210.data
211SetRcrConfig_A_init:
212 .xword 0x0060452301000484
213/************************************************************************/
214SECTION SetRxDmaCfig_1_0_init data_va=0x200000800
215attr_data {
216 Name = SetRxDmaCfig_1_0_init,
217 hypervisor,
218 compressimage
219 }
220.data
221SetRxDmaCfig_1_0_init:
222 .xword 0x0060452301000484
223/************************************************************************/
224SECTION SetRxdmaCfig2Start_init data_va=0x200000900
225attr_data {
226 Name = SetRxdmaCfig2Start_init,
227 hypervisor,
228 compressimage
229 }
230.data
231SetRxdmaCfig2Start_init:
232 .xword 0x0060452301000484
233/************************************************************************/
234SECTION SetRxDmaCfig_1_1_init data_va=0x200000a00
235attr_data {
236 Name = SetRxDmaCfig_1_1_init,
237 hypervisor,
238 compressimage
239 }
240.data
241SetRxDmaCfig_1_1_init:
242 .xword 0x0060452301000484
243
244/************************************************************************/
245
246SECTION SetRxRingKick_init data_va=0x200000b00
247attr_data {
248 Name = SetRxRingKick_init,
249 hypervisor,
250 compressimage
251 }
252.data
253SetRxRingKick_init:
254 .xword 0x0060452301000484
255/************************************************************************/
256
257SECTION SetRxLogMask2_init data_va=0x200000c00
258attr_data {
259 Name = SetRxLogMask2_init,
260 hypervisor,
261 compressimage
262 }
263.data
264SetRxLogMask2_init:
265 .xword 0x0060452301000484
266/************************************************************************/
267
268SECTION SetRxLogVal2_init data_va=0x200000d00
269attr_data {
270 Name = SetRxLogVal2_init,
271 hypervisor,
272 compressimage
273 }
274.data
275SetRxLogVal2_init:
276 .xword 0x0060452301000484
277/************************************************************************/
278
279SECTION SetRxLogRelo2_init data_va=0x200000e00
280attr_data {
281 Name = SetRxLogRelo2_init,
282 hypervisor,
283 compressimage
284 }
285.data
286SetRxLogRelo2_init:
287 .xword 0x0060452301000484
288
289/************************************************************************/