Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: rx_p0p1_MULTI_2DMA_rand_11.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 | #define FAIR_PKT_COUNT ((RXMAC_PKTCNT) - (RXMAC_PKTCNT%8)) | |
43 | ||
44 | .text | |
45 | .global main | |
46 | ||
47 | main: | |
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 | ||
59 | P_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 | |
63 | delay_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 | ||
86 | P_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 | |
89 | delay_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 RX_DESC_RING_LENGTH, %g1, %o2 | |
102 | setx RX_COMPL_RING_LEN, %g1, %o3 | |
103 | setx RBR_CONFIG_B_DATA, %g1, %o4 | |
104 | setx RX_INITIAL_KICK, %g1, %o5 | |
105 | setx NIU_RX_MULTI_DMA, %g1, %o6 | |
106 | call NiuInitRxDma | |
107 | nop | |
108 | P0_NIU_RxPkt_Conf: | |
109 | nop ! $EV trig_pc_d(1, @VA(.MAIN.P0_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT,0) | |
110 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
111 | nop | |
112 | P1_NIU_RxPkt_Conf: | |
113 | nop ! $EV trig_pc_d(1, @VA(.MAIN.P1_NIU_RxPkt_Conf)) -> NIU_RxPktConf(RXMAC_PKTCNT,1) | |
114 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
115 | nop | |
116 | P_NIU_Rx_GenPkt: | |
117 | setx RXMAC_PKTCNT, %g1, %g6 | |
118 | nop | |
119 | Rx_pktcnt_loop: | |
120 | nop ! $EV trig_pc_d(1, @VA(.MAIN.Rx_pktcnt_loop)) -> NIU_RxGenPkt(MAC_ID, 0, RXMAC_PKTCNT, 0x41,0x1, NIU_RX_MULTI_DMA, 1) | |
121 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
122 | nop | |
123 | nop | |
124 | nop | |
125 | nop | |
126 | ||
127 | delay_loop0: | |
128 | mulx %o1, 0x200, %g4 | |
129 | setx RCR_STAT_A, %g7, %g2 | |
130 | add %g2, %g4, %g2 | |
131 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g4 | |
132 | ||
133 | mulx %o0, 0x200, %g5 | |
134 | setx RCR_STAT_A, %g7, %g2 | |
135 | add %g2, %g5, %g2 | |
136 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 | |
137 | ||
138 | add %g5, %g4, %g5 | |
139 | cmp %g5, FAIR_PKT_COUNT | |
140 | bne delay_loop0 | |
141 | nop | |
142 | ||
143 | ||
144 | test_passed: | |
145 | nop | |
146 | EXIT_GOOD | |
147 | # 218 "diag.j.pp" | |
148 | ||
149 | /************************************************************************ | |
150 | Test case data start | |
151 | ************************************************************************/ | |
152 | !SECTION SetRngConfig_init data_va=0x100000000 | |
153 | !attr_data { | |
154 | ! Name = SetRngConfig_init, | |
155 | ! hypervisor, | |
156 | ! compressimage | |
157 | ! } | |
158 | !.data | |
159 | !SetRngConfig_init: | |
160 | ! .xword 0x0060452301000484 | |
161 | ||
162 | SECTION SetRxLogMask1_init data_va=0x200000100 | |
163 | attr_data { | |
164 | Name = SetRxLogMask1_init, | |
165 | hypervisor, | |
166 | compressimage | |
167 | } | |
168 | .data | |
169 | SetRxLogMask1_init: | |
170 | .xword 0x0060452301000484 | |
171 | ||
172 | SECTION SetRxLogVal1_init data_va=0x200000200 | |
173 | attr_data { | |
174 | Name = SetRxLogVal1_init, | |
175 | hypervisor, | |
176 | compressimage | |
177 | } | |
178 | .data | |
179 | SetRxLogVal1_init: | |
180 | .xword 0x0060452301000484 | |
181 | ||
182 | SECTION SetRxLogRelo1_init data_va=0x200000300 | |
183 | attr_data { | |
184 | Name = SetRxLogRelo1_init, | |
185 | hypervisor, | |
186 | compressimage | |
187 | } | |
188 | .data | |
189 | SetRxLogRelo1_init: | |
190 | .xword 0x0060452301000484 | |
191 | ||
192 | SECTION SetRxLogPgVld_init data_va=0x200000400 | |
193 | attr_data { | |
194 | Name = SetRxLogPgVld_init, | |
195 | hypervisor, | |
196 | compressimage | |
197 | } | |
198 | .data | |
199 | SetRxLogPgVld_init: | |
200 | .xword 0x0060452301000484 | |
201 | SECTION SetRbrConfig_A_init data_va=0x200000500 | |
202 | attr_data { | |
203 | Name = SetRbrConfig_A_init, | |
204 | hypervisor, | |
205 | compressimage | |
206 | } | |
207 | .data | |
208 | SetRbrConfig_A_init: | |
209 | .xword 0x0060452301000484 | |
210 | SECTION SetRbrConfig_B_init data_va=0x200000600 | |
211 | attr_data { | |
212 | Name = SetRbrConfig_B_init, | |
213 | hypervisor, | |
214 | compressimage | |
215 | } | |
216 | .data | |
217 | SetRbrConfig_B_init: | |
218 | .xword 0x0060452301000484 | |
219 | SECTION SetRcrConfig_A_init data_va=0x200000700 | |
220 | attr_data { | |
221 | Name = SetRcrConfig_A_init, | |
222 | hypervisor, | |
223 | compressimage | |
224 | } | |
225 | .data | |
226 | SetRcrConfig_A_init: | |
227 | .xword 0x0060452301000484 | |
228 | SECTION SetRxDmaCfig_1_0_init data_va=0x200000800 | |
229 | attr_data { | |
230 | Name = SetRxDmaCfig_1_0_init, | |
231 | hypervisor, | |
232 | compressimage | |
233 | } | |
234 | .data | |
235 | SetRxDmaCfig_1_0_init: | |
236 | .xword 0x0060452301000484 | |
237 | SECTION SetRxdmaCfig2Start_init data_va=0x200000900 | |
238 | attr_data { | |
239 | Name = SetRxdmaCfig2Start_init, | |
240 | hypervisor, | |
241 | compressimage | |
242 | } | |
243 | .data | |
244 | SetRxdmaCfig2Start_init: | |
245 | .xword 0x0060452301000484 | |
246 | SECTION SetRxDmaCfig_1_1_init data_va=0x200000a00 | |
247 | attr_data { | |
248 | Name = SetRxDmaCfig_1_1_init, | |
249 | hypervisor, | |
250 | compressimage | |
251 | } | |
252 | .data | |
253 | SetRxDmaCfig_1_1_init: | |
254 | .xword 0x0060452301000484 | |
255 | # 331 "diag.j.pp" | |
256 | SECTION SetRxRingKick_init data_va=0x200000b00 | |
257 | attr_data { | |
258 | Name = SetRxRingKick_init, | |
259 | hypervisor, | |
260 | compressimage | |
261 | } | |
262 | .data | |
263 | SetRxRingKick_init: | |
264 | .xword 0x0060452301000484 | |
265 | ||
266 | SECTION SetRxLogMask2_init data_va=0x200000c00 | |
267 | attr_data { | |
268 | Name = SetRxLogMask2_init, | |
269 | hypervisor, | |
270 | compressimage | |
271 | } | |
272 | .data | |
273 | SetRxLogMask2_init: | |
274 | .xword 0x0060452301000484 | |
275 | ||
276 | SECTION SetRxLogVal2_init data_va=0x200000d00 | |
277 | attr_data { | |
278 | Name = SetRxLogVal2_init, | |
279 | hypervisor, | |
280 | compressimage | |
281 | } | |
282 | .data | |
283 | SetRxLogVal2_init: | |
284 | .xword 0x0060452301000484 | |
285 | ||
286 | SECTION SetRxLogRelo2_init data_va=0x200000e00 | |
287 | attr_data { | |
288 | Name = SetRxLogRelo2_init, | |
289 | hypervisor, | |
290 | compressimage | |
291 | } | |
292 | .data | |
293 | SetRxLogRelo2_init: | |
294 | .xword 0x0060452301000484 | |
295 | # 374 "diag.j.pp" | |
296 | ||
297 | #if 0 | |
298 | #endif |