Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / prm / tso / tso_directed / tso_n2_ncrdwr1.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: tso_n2_ncrdwr1.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 ASI_NUCLEUS 0x40
40#define ASI_NUCLEUS_LITTLE 0xc0
41#define ASI_BLK_P 0xf0
42#define ASI_BLK_S 0xf1
43#define ASI_BLK_PL 0xf8
44#define ASI_BLK_SL 0xf9
45#define ASI_BLK_INIT_ST_QUAD_LDD_P 0xe2
46#define ASI_BLK_INIT_ST_QUAD_LDD_P 0xe3
47#define ASI_NUCLEUS_QUAD_LDD 0x24
48#define ENABLE_PCIE_LINK_TRAINING
49#include "hboot.s"
50
51.text
52.global main
53main:
54 ta T_CHANGE_HPRIV
55 nop
56
57/************************************
58 set up pointers
59*************************************/
60setx 0xdeadbeefdeadbeef, %g1, %g2
61setx 0xc100beef00, %g1, %g3 ! MEM32 address space
62/************************************
63 Start doing non cacheable access
64 RW's are done to the DMUPIO space
65 starting from 0xC1
66*************************************/
67!=====================
68! Now some NC writes and reads
69!=====================
70mov %g0, %g4
71set 0x1, %g2
72set 0x10, %g5
73
74stloop1:
75stx %g2, [%g3 + %g4]
76inc %g2
77add 0x8, %g4, %g4
78deccc %g5
79bne stloop1
80nop
81
82mov 0x78, %g4
83set 0x10, %g2
84set 0x10, %g5
85
86ldloop1:
87ldx [%g3 + %g4], %g1
88subcc %g2, %g1, %g0
89bne h_bad_end
90nop
91dec %g2
92sub %g4, 0x8, %g4
93deccc %g5
94bne ldloop1
95nop
96
97!========================
98mov %g0, %g4
99set 0x1, %g2
100set 0x10, %g5
101
102stloop2:
103st %g2, [%g3 + %g4]
104inc %g2
105add 0x4, %g4, %g4
106deccc %g5
107bne stloop2
108nop
109
110mov 0x3c, %g4
111set 0x10, %g2
112set 0x10, %g5
113
114ldloop2:
115ld [%g3 + %g4], %g1
116subcc %g2, %g1, %g0
117bne h_bad_end
118nop
119dec %g2
120sub %g4, 0x4, %g4
121deccc %g5
122bne ldloop2
123nop
124
125!=============================
126
127mov %g0, %g4
128set 0x1, %g2
129set 0x10, %g5
130
131stloop3:
132sth %g2, [%g3 + %g4]
133inc %g2
134add 0x2, %g4, %g4
135deccc %g5
136bne stloop3
137nop
138
139mov 0x1e, %g4
140set 0x10, %g2
141set 0x10, %g5
142
143ldloop3:
144lduh [%g3 + %g4], %g1
145subcc %g2, %g1, %g0
146bne h_bad_end
147nop
148dec %g2
149sub %g4, 0x2, %g4
150deccc %g5
151bne ldloop3
152nop
153
154!=============================
155mov %g0, %g4
156set 0x1, %g2
157set 0x10, %g5
158
159stloop4:
160stb %g2, [%g3 + %g4]
161inc %g2
162add 0x1, %g4, %g4
163deccc %g5
164bne stloop4
165nop
166
167mov 0xf, %g4
168set 0x10, %g2
169set 0x10, %g5
170
171ldloop4:
172ldub [%g3 + %g4], %g1
173subcc %g2, %g1, %g0
174bne h_bad_end
175nop
176dec %g2
177sub %g4, 0x1, %g4
178deccc %g5
179bne ldloop4
180nop
181
182normal_end:
183ta T_GOOD_TRAP
184nop
185
186h_bad_end:
187ta T_BAD_TRAP
188nop
189
190/*
191* Data section
192*/
193
194 .data
195 user_data_start:
196 .word 0xD6B3479D
197 .word 0xDB28926C
198 .end