Commit | Line | Data |
---|---|---|
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 | |
46 | main: | |
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 | !===================== | |
62 | mov %g0, %g4 | |
63 | set 0x1, %g2 | |
64 | set 0x10, %g5 | |
65 | ||
66 | stloop0: | |
67 | stx %g2, [%g3 + %g4] | |
68 | stx %g2, [%o0 + %g4] | |
69 | inc %g2 | |
70 | add 0x8, %g4, %g4 | |
71 | deccc %g5 | |
72 | bne stloop0 | |
73 | nop | |
74 | ||
75 | mov 0x78, %g4 | |
76 | set 0x10, %g2 | |
77 | set 0x10, %g5 | |
78 | ||
79 | ldloop0: | |
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 | |
88 | bne ldloop0 | |
89 | nop | |
90 | ||
91 | !================================ | |
92 | ldd [%g3], %f0 | |
93 | add %g3, 0x40, %g3 | |
94 | ldd [%g3], %f16 | |
95 | std %f0, [%g3] | |
96 | sub %g3, 0x40, %g3 | |
97 | std %f16, [%g3] | |
98 | membar 0x40 | |
99 | !================================ | |
100 | ||
101 | !================================ | |
102 | ldd [%g3], %f0 | |
103 | add %g3, 0x40, %g3 | |
104 | ldd [%g3], %f16 | |
105 | std %f0, [%g3] | |
106 | stda %f0, [%o0]ASI_BLK_PL | |
107 | add %g3, 0x8, %g3 | |
108 | std %f0, [%g3] | |
109 | stda %f0, [%o0]ASI_BLK_PL | |
110 | add %g3, 0x8, %g3 | |
111 | std %f0, [%g3] | |
112 | stda %f0, [%o0]ASI_BLK_P | |
113 | add %g3, 0x8, %g3 | |
114 | std %f0, [%g3] | |
115 | stda %f0, [%o0]ASI_BLK_P | |
116 | stda %f0, [%o0]ASI_BLK_P | |
117 | stda %f0, [%o0]ASI_BLK_PL | |
118 | add %g3, 0x8, %g3 | |
119 | std %f0, [%g3] | |
120 | add %g3, 0x8, %g3 | |
121 | std %f0, [%g3] | |
122 | add %g3, 0x8, %g3 | |
123 | std %f16, [%g3] | |
124 | !================================ | |
125 | ||
126 | set 0x10, %g5 | |
127 | mov %g3, %g4 | |
128 | mov %o0, %o1 | |
129 | ||
130 | loop6: | |
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 | |
144 | bne loop6 | |
145 | nop | |
146 | ||
147 | !================================ | |
148 | set 0x10, %g5 | |
149 | mov %g3, %g4 | |
150 | mov %o0, %o1 | |
151 | ||
152 | loop8: | |
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 | |
166 | bne loop8 | |
167 | nop | |
168 | ||
169 | !================================ | |
170 | set 0x10, %g5 | |
171 | mov %g3, %g4 | |
172 | mov %o0, %o1 | |
173 | ||
174 | loop11: | |
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 | |
188 | bne loop11 | |
189 | nop | |
190 | ||
191 | normal_end: | |
192 | ta T_GOOD_TRAP | |
193 | h_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 | ||
208 | SECTION .NCDATA DATA_VA=0x00d01ee000 | |
209 | ||
210 | attr_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 | |
223 | ncdata_base: | |
224 | .skip 1000 | |
225 |