Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / peu / PCIeCFG1AllBMsk.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: PCIeCFG1AllBMsk.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 ENABLE_PCIE_LINK_TRAINING
39#define MAIN_PAGE_NUCLEUS_ALSO
40#define MAIN_PAGE_HV_ALSO
41
42#include "hboot.s"
43#include "peu_defines.h"
44#include "asi_s.h"
45
46#define CFG0_RD_ADDR N2_PCIE_BASE_ADDR
47#define CFG1_RD_ADDR mpeval(CFG0_RD_ADDR + CFG1_ACCESS_PA)
48
49/************************************************************************
50 Test case code start
51 ************************************************************************/
52
53.text
54.global main
55
56main:
57 ta T_CHANGE_HPRIV
58 nop
59
60 setx CFG1_RD_ADDR, %g1, %g2
61 mov %g2, %g3
62
63 ! Do 32 VIS stores to create all possible byte masks that result in 1 DW writes
64
65 mov %g0, %g7 ! Byte mask to use == 0
66
67 setx test_data, %g1, %g4
68 ldd [%g4], %f0 ! data to be stored
69
70 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x00
71 lduw [%g3], %i0
72 lduw [%g3 + 4], %i1
73
74 add %g7, 1, %g7
75 add %g3, 8, %g3
76 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x01
77 lduw [%g3], %i2
78 lduw [%g3 + 4], %i3
79
80 add %g7, 1, %g7
81 add %g3, 8, %g3
82 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x02
83 lduw [%g3], %i4
84 lduw [%g3 + 4], %i5
85
86 add %g7, 1, %g7
87 add %g3, 8, %g3
88 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x03
89 lduw [%g3], %i6
90 lduw [%g3 + 4], %i7
91
92 add %g7, 1, %g7
93 add %g3, 8, %g3
94 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x04
95 lduw [%g3], %i0
96 lduw [%g3 + 4], %i1
97
98 add %g7, 1, %g7
99 add %g3, 8, %g3
100 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x05
101 lduw [%g3], %i2
102 lduw [%g3 + 4], %i3
103
104 add %g7, 1, %g7
105 add %g3, 8, %g3
106 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x06
107 lduw [%g3], %i4
108 lduw [%g3 + 4], %i5
109
110 add %g7, 1, %g7
111 add %g3, 8, %g3
112 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x07
113 lduw [%g3], %i6
114 lduw [%g3 + 4], %i7
115
116 add %g7, 1, %g7
117 add %g3, 8, %g3
118 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x08
119 lduw [%g3], %i0
120 lduw [%g3 + 4], %i1
121
122 add %g7, 1, %g7
123 add %g3, 8, %g3
124 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x09
125 lduw [%g3], %i2
126 lduw [%g3 + 4], %i3
127
128 add %g7, 1, %g7
129 add %g3, 8, %g3
130 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x0a
131 lduw [%g3], %i4
132 lduw [%g3 + 4], %i5
133
134 add %g7, 1, %g7
135 add %g3, 8, %g3
136 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x0b
137 lduw [%g3], %i6
138 lduw [%g3 + 4], %i7
139
140 add %g7, 1, %g7
141 add %g3, 8, %g3
142 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x0c
143 lduw [%g3], %i0
144 lduw [%g3 + 4], %i1
145
146 add %g7, 1, %g7
147 add %g3, 8, %g3
148 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x0d
149 lduw [%g3], %i2
150 lduw [%g3 + 4], %i3
151
152 add %g7, 1, %g7
153 add %g3, 8, %g3
154 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x0e
155 lduw [%g3], %i4
156 lduw [%g3 + 4], %i5
157
158 add %g7, 1, %g7
159 add %g3, 8, %g3
160 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x0f
161 lduw [%g3], %i6
162 lduw [%g3 + 4], %i7
163
164 set 0x10, %g7
165 add %g3, 8, %g3
166 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x10
167 lduw [%g3], %i0
168 lduw [%g3 + 4], %i1
169
170 add %g7, 0x10, %g7
171 add %g3, 8, %g3
172 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x20
173 lduw [%g3], %i2
174 lduw [%g3 + 4], %i3
175
176 add %g7, 0x10, %g7
177 add %g3, 8, %g3
178 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x30
179 lduw [%g3], %i4
180 lduw [%g3 + 4], %i5
181
182 add %g7, 0x10, %g7
183 add %g3, 8, %g3
184 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x40
185 lduw [%g3], %i6
186 lduw [%g3 + 4], %i7
187
188 add %g7, 0x10, %g7
189 add %g3, 8, %g3
190 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x50
191 lduw [%g3], %i0
192 lduw [%g3 + 4], %i1
193
194 add %g7, 0x10, %g7
195 add %g3, 8, %g3
196 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x60
197 lduw [%g3], %i2
198 lduw [%g3 + 4], %i3
199
200 add %g7, 0x10, %g7
201 add %g3, 8, %g3
202 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x70
203 lduw [%g3], %i4
204 lduw [%g3 + 4], %i5
205
206 add %g7, 0x10, %g7
207 add %g3, 8, %g3
208 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x80
209 lduw [%g3], %i6
210 lduw [%g3 + 4], %i7
211
212 add %g7, 0x10, %g7
213 add %g3, 8, %g3
214 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0x90
215 lduw [%g3], %i0
216 lduw [%g3 + 4], %i1
217
218 add %g7, 0x10, %g7
219 add %g3, 8, %g3
220 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0xa0
221 lduw [%g3], %i2
222 lduw [%g3 + 4], %i3
223
224 add %g7, 0x10, %g7
225 add %g3, 8, %g3
226 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0xb0
227 lduw [%g3], %i4
228 lduw [%g3 + 4], %i5
229
230 add %g7, 0x10, %g7
231 add %g3, 8, %g3
232 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0xc0
233 lduw [%g3], %i6
234 lduw [%g3 + 4], %i7
235
236 add %g7, 0x10, %g7
237 add %g3, 8, %g3
238 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0xd0
239 lduw [%g3], %i0
240 lduw [%g3 + 4], %i1
241
242 add %g7, 0x10, %g7
243 add %g3, 8, %g3
244 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0xe0
245 lduw [%g3], %i2
246 lduw [%g3 + 4], %i3
247
248 add %g7, 0x10, %g7
249 add %g3, 8, %g3
250 stda %f0, [%g3+%g7]ASI_PST8_PRIMARY ! store with mask = 0xf0
251 lduw [%g3], %i4
252 lduw [%g3 + 4], %i5
253
254test_passed:
255 EXIT_GOOD
256
257test_failed:
258 EXIT_BAD
259
260 .align 16
261test_data:
262 .xword 0x0123456789abcdef !!! original data
263
264
265/************************************************************************
266 Test case data start
267 ************************************************************************/
268
269SECTION .DATA DATA_VA=CFG1_RD_ADDR
270attr_data {
271 Name = .DATA,
272 hypervisor,
273 compressimage
274}
275
276.data
277 .xword 0x0000000000000000 !!! store area
278 .xword 0x0000000000000000
279 .xword 0x0000000000000000
280 .xword 0x0000000000000000
281 .xword 0x0000000000000000
282 .xword 0x0000000000000000
283 .xword 0x0000000000000000
284 .xword 0x0000000000000000
285 .xword 0x0000000000000000
286 .xword 0x0000000000000000
287 .xword 0x0000000000000000
288 .xword 0x0000000000000000
289 .xword 0x0000000000000000
290 .xword 0x0000000000000000
291 .xword 0x0000000000000000
292 .xword 0x0000000000000000
293 .xword 0x0000000000000000
294 .xword 0x0000000000000000
295 .xword 0x0000000000000000
296 .xword 0x0000000000000000
297 .xword 0x0000000000000000
298 .xword 0x0000000000000000
299 .xword 0x0000000000000000
300 .xword 0x0000000000000000
301 .xword 0x0000000000000000
302 .xword 0x0000000000000000
303 .xword 0x0000000000000000
304 .xword 0x0000000000000000
305 .xword 0x0000000000000000
306 .xword 0x0000000000000000
307 .xword 0x0000000000000000
308 .xword 0x0000000000000000
309 .xword 0x0000000000000000
310 .xword 0x0000000000000000
311 .xword 0x0000000000000000
312 .xword 0x0000000000000000
313 .xword 0x0000000000000000
314 .xword 0x0000000000000000
315 .xword 0x0000000000000000
316 .xword 0x0000000000000000
317 .xword 0x0000000000000000
318 .xword 0x0000000000000000
319 .xword 0x0000000000000000
320 .xword 0x0000000000000000
321 .xword 0x0000000000000000
322 .xword 0x0000000000000000
323 .xword 0x0000000000000000
324 .xword 0x0000000000000000
325 .xword 0x0000000000000000
326 .xword 0x0000000000000000
327 .xword 0x0000000000000000
328 .xword 0x0000000000000000
329 .xword 0x0000000000000000
330 .xword 0x0000000000000000
331 .xword 0x0000000000000000
332 .xword 0x0000000000000000
333 .xword 0x0000000000000000
334 .xword 0x0000000000000000
335 .xword 0x0000000000000000
336 .xword 0x0000000000000000
337 .xword 0x0000000000000000
338 .xword 0x0000000000000000
339 .xword 0x0000000000000000
340 .xword 0x0000000000000000
341 .xword 0x0000000000000000
342 .xword 0x0000000000000000
343 .xword 0x0000000000000000
344 .xword 0x0000000000000000
345 .xword 0x0000000000000000
346 .xword 0x0000000000000000
347 .xword 0x0000000000000000
348 .xword 0x0000000000000000
349 .xword 0x0000000000000000
350 .xword 0x0000000000000000
351 .xword 0x0000000000000000
352 .xword 0x0000000000000000
353 .xword 0x0000000000000000
354 .xword 0x0000000000000000
355 .xword 0x0000000000000000
356 .xword 0x0000000000000000
357 .xword 0x0000000000000000
358 .xword 0x0000000000000000
359 .xword 0x0000000000000000
360 .xword 0x0000000000000000
361 .xword 0x0000000000000000
362 .xword 0x0000000000000000
363 .xword 0x0000000000000000
364 .xword 0x0000000000000000
365 .xword 0x0000000000000000
366 .xword 0x0000000000000000
367 .xword 0x0000000000000000
368 .xword 0x0000000000000000
369 .xword 0x0000000000000000
370 .xword 0x0000000000000000
371 .xword 0x0000000000000000
372 .xword 0x0000000000000000
373 .xword 0x0000000000000000
374 .xword 0x0000000000000000
375 .xword 0x0000000000000000
376 .xword 0x0000000000000000
377 .xword 0x0000000000000000
378 .xword 0x0000000000000000
379 .xword 0x0000000000000000
380 .xword 0x0000000000000000
381 .xword 0x0000000000000000
382 .xword 0x0000000000000000
383 .xword 0x0000000000000000
384 .xword 0x0000000000000000
385 .xword 0x0000000000000000
386 .xword 0x0000000000000000
387 .xword 0x0000000000000000
388 .xword 0x0000000000000000
389 .xword 0x0000000000000000
390 .xword 0x0000000000000000
391 .xword 0x0000000000000000
392 .xword 0x0000000000000000
393 .xword 0x0000000000000000
394 .xword 0x0000000000000000
395 .xword 0x0000000000000000
396 .xword 0x0000000000000000
397 .xword 0x0000000000000000
398 .xword 0x0000000000000000
399 .xword 0x0000000000000000
400 .xword 0x0000000000000000
401 .xword 0x0000000000000000
402 .xword 0x0000000000000000
403 .xword 0x0000000000000000
404 .xword 0x0000000000000000
405
406.end:
407
408
409