Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n2_ncrdwr3.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n2_ncrdwr3.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#define ENABLE_PCIE_LINK_TRAINING
40#include "hboot.s"
41
42.text
43.global main
44main:
45 ta T_CHANGE_HPRIV
46 nop
47
48 wr %g0, 0x4, %fprs /* make sure fef is 1 */
49
50 setx 0xc100beef00, %g1, %g3 ! MEM32 address space
51
52 setx user_data_start, %l0, %o0 ! user_data_start
53
54!=====================
55! Now some NC writes and reads mixed with cacheable writes and reads
56!=====================
57mov %g0, %g4
58set 0x1, %g2
59set 0x10, %g5
60
61stloop0:
62 stx %g2, [%g3 + %g4] ! NonCacheable
63 stx %g2, [%o0 + %g4] ! Cacheable
64 inc %g2
65 add 0x8, %g4, %g4
66 deccc %g5
67bne stloop0
68nop
69
70mov 0x78, %g4
71set 0x10, %g2
72set 0x10, %g5
73
74ldloop0:
75 ldx [%o0 + %g4], %g1 ! Cacheable
76 ldx [%g3 + %g4], %g1 ! NonCacheable
77 subcc %g2, %g1, %g0
78 bne h_bad_end
79 nop
80 dec %g2
81 sub %g4, 0x8, %g4
82 deccc %g5
83bne ldloop0
84nop
85
86!================================
87ldda [%o0]ASI_BLK_P, %f0
88add %g3, 0x40, %g3
89ldd [%g3], %f16
90
91std %f0, [%g3]
92sub %g3, 0x40, %g3
93stda %f16, [%o0]ASI_BLK_P
94membar 0x40
95!================================
96
97!================================
98add %g3, 0x40, %g3
99ldd [%g3], %f0
100add %g3, 0x40, %g3
101ldd [%g3], %f16
102std %f0, [%g3]
103stda %f0, [%o0]ASI_BLK_PL
104add %g3, 8, %g3
105std %f0, [%g3]
106stda %f0, [%o0]ASI_BLK_PL
107add %g3, 8, %g3
108std %f0, [%g3]
109stda %f0, [%o0]ASI_BLK_P
110add %g3, 8, %g3
111std %f0, [%g3]
112stda %f0, [%o0]ASI_BLK_P
113stda %f0, [%o0]ASI_BLK_P
114stda %f0, [%o0]ASI_BLK_PL
115add %g3, 8, %g3
116std %f0, [%g3]
117add %g3, 8, %g3
118std %f0, [%g3]
119sub %g3, 0x40, %g3
120std %f16, [%g3]
121!================================
122
123set 0x10, %g5
124mov %g3, %g4
125mov %o0, %o1
126
127loop6:
128 ldx [%g4], %l0
129 inc %l0
130 inc %l1
131 add %g4, 0x8, %g4
132 add %o1, 0x8, %o1
133 stx %l0, [%g4]
134 add %g4, 0x8, %g4
135 stx %l1, [%g4]
136 stxa %l0, [%o1]ASI_BLK_INIT_ST_QUAD_LDD_P
137 add %o1, 0x8, %o1
138 stxa %l1, [%o1]ASI_BLK_INIT_ST_QUAD_LDD_P
139
140 deccc %g5
141bne loop6
142nop
143
144!================================
145set 0x10, %g5
146mov %g3, %g4
147mov %o0, %o1
148
149loop8:
150 ldx [%g4], %l0
151 inc %l0
152 inc %l1
153 add %g4, 0x8, %g4
154 add %o1, 0x8, %o1
155 stx %l0, [%g4]
156 add %g4, 0x8, %g4
157 stx %l1, [%g4]
158 stxa %l0, [%o1]ASI_BLK_INIT_ST_QUAD_LDD_P_LITTLE
159 add %o1, 0x8, %o1
160 stxa %l1, [%o1]ASI_BLK_INIT_ST_QUAD_LDD_P_LITTLE
161
162 deccc %g5
163bne loop8
164nop
165
166!================================
167set 0x10, %g5
168mov %g3, %g4
169mov %o0, %o1
170
171loop11:
172 ldx [%g4], %l0
173 inc %l0
174 inc %l1
175 add %g4, 0x8, %g4
176 add %o1, 0x8, %o1
177 stx %l0, [%g4]
178 add %g4, 0x8, %g4
179 stx %l1, [%g4]
180 stxa %l0, [%o1]ASI_BLK_INIT_ST_QUAD_LDD_P
181 add %o1, 0x8, %o1
182 stxa %l1, [%o1]ASI_BLK_INIT_ST_QUAD_LDD_P
183
184 deccc %g5
185bne loop11
186nop
187
188normal_end:
189 ta T_GOOD_TRAP
190h_bad_end:
191 ta T_BAD_TRAP
192
193
194/******************************************************************/
195/*
196* Data section
197*/
198
199 .data
200 user_data_start:
201 .word 0xD6B3479D
202 .word 0xDB28926C
203 .end
204