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