Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_ncu_l2_core_enable.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_NUCLEUS_ALSO | |
39 | #define MAIN_PAGE_HV_ALSO | |
40 | ||
41 | ||
42 | #define DRAM0_ERROR_COUNTER_REG 0x8400000298 | |
43 | #define DRAM1_ERROR_COUNTER_REG 0x8400001298 | |
44 | #define DRAM2_ERROR_COUNTER_REG 0x8400002298 | |
45 | #define DRAM3_ERROR_COUNTER_REG 0x8400003298 | |
46 | ||
47 | #define L2_BANK_ENABLE_REG 0x8000001020 | |
48 | #define CORE_ENABLE_REG 0x9001040020 | |
49 | #define XIR_STEERING_REG 0x9001040030 | |
50 | #define ASI_WMR_VEC_MASK_REG 0x9001140018 | |
51 | ||
52 | #include "hboot.s" | |
53 | #include "asi_s.h" | |
54 | #include "err_defines.h" | |
55 | #include "tcu_defines.h" | |
56 | ||
57 | ||
58 | .text | |
59 | .global main | |
60 | ||
61 | ||
62 | main: | |
63 | ta T_CHANGE_HPRIV | |
64 | ||
65 | ||
66 | L2_Bank_Enable_Reg_all_zeros: | |
67 | setx L2_BANK_ENABLE_REG, %g7, %g1 | |
68 | stx %g0, [%g1] | |
69 | ldx [%g1], %g3 | |
70 | set 0x3, %g2 ! Lowest 2 Banks has to be enabled if all are written to zero; | |
71 | ! To be confirmed from PRM | |
72 | cmp %g2, %g3 | |
73 | bne %xcc, test_failed | |
74 | nop | |
75 | ||
76 | ||
77 | L2_Bank_Enable_Reg_B01_off: | |
78 | set 0xfe, %g2 | |
79 | stx %g2, [%g1] | |
80 | ldx [%g1], %g3 | |
81 | set 0xfe, %g2 ! | |
82 | cmp %g2, %g3 | |
83 | bne %xcc, test_failed | |
84 | nop | |
85 | ||
86 | set 0xfd, %g2 | |
87 | stx %g2, [%g1] | |
88 | ldx [%g1], %g3 | |
89 | set 0xfd, %g2 ! | |
90 | cmp %g2, %g3 | |
91 | bne %xcc, test_failed | |
92 | nop | |
93 | ||
94 | ||
95 | L2_Bank_Enable_Reg_B23_off: | |
96 | set 0xfb, %g2 | |
97 | stx %g2, [%g1] | |
98 | ldx [%g1], %g3 | |
99 | set 0xfb, %g2 ! | |
100 | cmp %g2, %g3 | |
101 | bne %xcc, test_failed | |
102 | nop | |
103 | ||
104 | set 0xf7, %g2 | |
105 | stx %g2, [%g1] | |
106 | ldx [%g1], %g3 | |
107 | set 0xf7, %g2 ! | |
108 | cmp %g2, %g3 | |
109 | bne %xcc, test_failed | |
110 | nop | |
111 | ||
112 | ||
113 | L2_Bank_Enable_Reg_B45_off: | |
114 | set 0xef, %g2 | |
115 | stx %g2, [%g1] | |
116 | ldx [%g1], %g3 | |
117 | set 0xef, %g2 ! | |
118 | cmp %g2, %g3 | |
119 | bne %xcc, test_failed | |
120 | nop | |
121 | ||
122 | set 0xdf, %g2 | |
123 | stx %g2, [%g1] | |
124 | ldx [%g1], %g3 | |
125 | set 0xdf, %g2 ! | |
126 | cmp %g2, %g3 | |
127 | bne %xcc, test_failed | |
128 | nop | |
129 | ||
130 | L2_Bank_Enable_Reg_B67_off: | |
131 | set 0xbf, %g2 | |
132 | stx %g2, [%g1] | |
133 | ldx [%g1], %g3 | |
134 | set 0xbf, %g2 ! | |
135 | cmp %g2, %g3 | |
136 | bne %xcc, test_failed | |
137 | nop | |
138 | ||
139 | set 0x7f, %g2 | |
140 | stx %g2, [%g1] | |
141 | ldx [%g1], %g3 | |
142 | set 0x7f, %g2 ! | |
143 | cmp %g2, %g3 | |
144 | bne %xcc, test_failed | |
145 | nop | |
146 | ||
147 | ||
148 | ||
149 | ||
150 | /*********************************** | |
151 | Core Enable Reg | |
152 | ***********************************/ | |
153 | Core_Enable_Reg_default: | |
154 | setx CORE_ENABLE_REG, %g7, %g1 | |
155 | ldx [%g1], %g3 ! default value | |
156 | ||
157 | Core_Enable_Reg_all_ONEs: | |
158 | setx 0xffffffffffffffff, %g7, %g2 | |
159 | stx %g2, [%g1] | |
160 | ldx [%g1], %g3 | |
161 | ||
162 | ! check that all bits are not Zero | |
163 | Core_Enable_Reg_all_ZEROs: | |
164 | stx %g0, [%g1] | |
165 | ldx [%g1], %g3 | |
166 | set 0xff, %g2 ! Lowest Core to be enabled if all are written to zero; | |
167 | ! To be confirmed from PRM | |
168 | cmp %g2, %g0 | |
169 | be %xcc, test_failed | |
170 | nop | |
171 | ||
172 | ||
173 | /*********************************** | |
174 | XIR Steering Reg | |
175 | ***********************************/ | |
176 | XIR_Steering_Reg_default: | |
177 | setx XIR_STEERING_REG, %g7, %g1 | |
178 | ldx [%g1], %g3 !default value | |
179 | ||
180 | XIR_Steering_Reg_all_ones: | |
181 | setx 0xffffffffffffffff, %g7, %g2 | |
182 | stx %g2, [%g1] | |
183 | ldx [%g1], %g3 | |
184 | ||
185 | XIR_Steering_Reg_all_zeros: | |
186 | stx %g0, [%g1] | |
187 | ldx [%g1], %g3 | |
188 | cmp %g0, %g3 ! All ZEROS | |
189 | bne %xcc, test_failed | |
190 | nop | |
191 | ||
192 | /*********************************** | |
193 | ASI WMR VEC MASK Reg | |
194 | ***********************************/ | |
195 | wmr_vec_Reg_default: | |
196 | setx ASI_WMR_VEC_MASK_REG, %g7, %g1 | |
197 | ldx [%g1], %g3 !default value | |
198 | ||
199 | wmr_vec_one: | |
200 | setx 0xffffffffffffffff, %g7, %g2 | |
201 | stx %g2, [%g1] | |
202 | ldx [%g1], %g3 | |
203 | mov 0x1, %g4 | |
204 | cmp %g4, %g3 | |
205 | bne %xcc, test_failed | |
206 | nop | |
207 | wmr_vec_zero: | |
208 | stx %g0, [%g1] | |
209 | ldx [%g1], %g3 | |
210 | cmp %g0, %g3 | |
211 | bne %xcc, test_failed | |
212 | nop | |
213 | ||
214 | test_passesd: | |
215 | ||
216 | ||
217 | test_passed: | |
218 | EXIT_GOOD | |
219 | ||
220 | test_failed: | |
221 | EXIT_BAD | |
222 | ||
223 | ||
224 |