Commit | Line | Data |
---|---|---|
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 | ||
49 | main: | |
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 | Init_flow: | |
61 | nop ! $EV trig_pc_d(1, @VA(.MAIN.Init_flow)) -> pktGenConfig(MAC_ID, FRAME_TYPE, FRAME_CLASS,TX_PKT_LEN) | |
62 | ||
63 | P_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 | ||
69 | P_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 | ||
75 | P_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 | ||
84 | P_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 | ||
93 | Gen_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 | |
98 | delay_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 | ||
109 | SetTxRingKick: | |
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 | ||
120 | SetTxCs : | |
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 | |
132 | delay_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 | ||
143 | NIUTx_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 | |
150 | delay_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 | ||
160 | test_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 | ||
174 | SECTION SetRngConfig_init data_va=0x100000000 | |
175 | attr_data { | |
176 | Name = SetRngConfig_init, | |
177 | hypervisor, | |
178 | compressimage | |
179 | } | |
180 | .data | |
181 | SetRngConfig_init: | |
182 | .xword 0x0060452301000484 | |
183 | /************************************************************************/ | |
184 | ||
185 | SECTION SetTxRingKick_init data_va=0x100000100 | |
186 | attr_data { | |
187 | Name = SetTxRingKick_init, | |
188 | hypervisor, | |
189 | compressimage | |
190 | } | |
191 | .data | |
192 | SetTxRingKick_init: | |
193 | .xword 0x0060452301000484 | |
194 | /************************************************************************/ | |
195 | ||
196 | SECTION SetTxLPMask1_init data_va=0x100000200 | |
197 | attr_data { | |
198 | Name = SetTxLPMask1_init, | |
199 | hypervisor, | |
200 | compressimage | |
201 | } | |
202 | .data | |
203 | SetTxLPMask1_init: | |
204 | .xword 0x0060452301000484 | |
205 | /************************************************************************/ | |
206 | ||
207 | SECTION SetTxLPValue1_init data_va=0x100000300 | |
208 | attr_data { | |
209 | Name = SetTxLPValue1_init, | |
210 | hypervisor, | |
211 | compressimage | |
212 | } | |
213 | .data | |
214 | SetTxLPValue1_init: | |
215 | .xword 0x0060452301000484 | |
216 | /************************************************************************/ | |
217 | ||
218 | SECTION SetTxLPRELOC1_init data_va=0x100000400 | |
219 | attr_data { | |
220 | Name = SetTxLPRELOC1_init, | |
221 | hypervisor, | |
222 | compressimage | |
223 | } | |
224 | .data | |
225 | SetTxLPRELOC1_init: | |
226 | .xword 0x0060452301000484 | |
227 | /************************************************************************/ | |
228 | SECTION SetTxLPMask2_init data_va=0x100000500 | |
229 | attr_data { | |
230 | Name = SetTxLPMask2_init, | |
231 | hypervisor, | |
232 | compressimage | |
233 | } | |
234 | .data | |
235 | SetTxLPMask2_init: | |
236 | .xword 0x0060452301000484 | |
237 | /************************************************************************/ | |
238 | SECTION SetTxLPValue2_init data_va=0x100000600 | |
239 | attr_data { | |
240 | Name = SetTxLPValue2_init, | |
241 | hypervisor, | |
242 | compressimage | |
243 | } | |
244 | .data | |
245 | SetTxLPValue2_init: | |
246 | .xword 0x0060452301000484 | |
247 | ||
248 | /************************************************************************/ | |
249 | SECTION SetTxLPRELOC2_init data_va=0x100000700 | |
250 | attr_data { | |
251 | Name = SetTxLPRELOC2_init, | |
252 | hypervisor, | |
253 | compressimage | |
254 | } | |
255 | .data | |
256 | SetTxLPRELOC2_init: | |
257 | .xword 0x0060452301000484 | |
258 | ||
259 | /************************************************************************/ | |
260 | SECTION SetTxLPValid_init data_va=0x100000800 | |
261 | attr_data { | |
262 | Name = SetTxLPValid_init, | |
263 | hypervisor, | |
264 | compressimage | |
265 | } | |
266 | .data | |
267 | SetTxLPValid_init: | |
268 | .xword 0x0060452301000484 | |
269 | ||
270 | /************************************************************************/ | |
271 |