Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: isa3_mmu_htw_3.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 PART0_Z_HWTEN_0 1 | |
39 | #define PART0_Z_HWTEN_1 1 | |
40 | #define PART0_Z_HWTEN_2 1 | |
41 | #define PART0_Z_HWTEN_3 1 | |
42 | #define PART0_NZ_HWTEN_0 1 | |
43 | #define PART0_NZ_HWTEN_1 1 | |
44 | #define PART0_NZ_HWTEN_2 1 | |
45 | #define PART0_NZ_HWTEN_3 1 | |
46 | ||
47 | !!! RANOTPA = 1, so RA -> PA translation enabled | |
48 | #define PART0_Z_RANOTPA_0 1 | |
49 | #define PART0_Z_RANOTPA_1 1 | |
50 | #define PART0_Z_RANOTPA_2 1 | |
51 | #define PART0_Z_RANOTPA_3 1 | |
52 | #define PART0_NZ_RANOTPA_0 1 | |
53 | #define PART0_NZ_RANOTPA_1 1 | |
54 | #define PART0_NZ_RANOTPA_2 1 | |
55 | #define PART0_NZ_RANOTPA_3 1 | |
56 | #include "hboot.s" | |
57 | ||
58 | /************************************************************************ | |
59 | Test case code start | |
60 | ************************************************************************/ | |
61 | ||
62 | .text | |
63 | .global main | |
64 | ||
65 | main: /* test begin */ | |
66 | ||
67 | ||
68 | ||
69 | !# Execute Main Diag .. | |
70 | ||
71 | ||
72 | ! Set translation for miss handler | |
73 | ! | |
74 | !setx DIAG_DATA_AREA, %l1, %i4 | |
75 | !!setx HTBA, %l1, %i4 | |
76 | !! Zero out lower 13 bits | |
77 | !srlx %i4, 13, %i0 | |
78 | !sllx %i0, 13, %i0 | |
79 | !! Write it to dtlb_tag_access register | |
80 | !! ASI 0x58, addr 0x30 | |
81 | !setx 0x30, %l1, %i1 | |
82 | !stxa %i0, [%i1 + %g0] 0x58 | |
83 | !! Create tte_data in %i2 | |
84 | !! sun4v format | |
85 | !! Field V NFO L PA IE E CP P W Size | |
86 | !! Bit 63 62 61 39:13 12 11 10 8 6 2:0 | |
87 | !! | |
88 | !! First set valid and locked bits | |
89 | !setx 0xA000000000000000, %l1, %i2 | |
90 | !! Now set up PA | |
91 | !setx 0x000000FFFFFFE000, %l1, %i5 | |
92 | !and %i4, %i5, %i5 | |
93 | !! Now merge them | |
94 | !or %i2, %i5, %i2 | |
95 | !! Write it to dtlb_data_in register | |
96 | !! ASI 0x5C, address with bit 10 set (for sun4v) | |
97 | !setx 0x400, %l1, %i3 | |
98 | !stxa %i2, [%i3 + %g0] 0x5C | |
99 | ||
100 | ||
101 | !! Create tte_tag in %i0 | |
102 | !! Field Context VA | |
103 | !! 60:48 41:0 | |
104 | !! Assume context of 0 for now | |
105 | !! | |
106 | !! First get PC | |
107 | !rd %pc, %i4 | |
108 | !! Zero out lower 13 bits | |
109 | !srlx %i4, 13, %i0 | |
110 | !sllx %i0, 13, %i0 | |
111 | ! | |
112 | !! Write it to itlb_tag_access register | |
113 | !! ASI 0x50, addr 0x30 | |
114 | !setx 0x30, %l1, %i1 | |
115 | !stxa %i0, [%i1 + %g0] 0x50 | |
116 | ! | |
117 | !! Create tte_data in %i2 | |
118 | !! sun4v format | |
119 | !! Field V NFO L PA IE E CP P W Size | |
120 | !! Bit 63 62 61 39:13 12 11 10 8 6 2:0 | |
121 | !! | |
122 | !! First set valid bit | |
123 | !setx 0x8000000000000000, %l1, %i2 | |
124 | !! Now set up PA | |
125 | !setx 0x000000FFFFFFE000, %l1, %i5 | |
126 | !and %i4, %i5, %i5 | |
127 | !! Now merge them | |
128 | !or %i2, %i5, %i2 | |
129 | ! | |
130 | ! | |
131 | !! Write it to itlb_data_in register | |
132 | !! ASI 0x54, address with bit 10 set (for sun4v) | |
133 | !setx 0x400, %l1, %i3 | |
134 | !stxa %i2, [%i3 + %g0] 0x54 | |
135 | ||
136 | ! Now activate translation | |
137 | ! Reset HPSTATE.ENB (bit 11) | |
138 | !rdhpr %hpstate, %i7 | |
139 | !and %i7, 0x17FF, %i7 | |
140 | !wrhpr %i7, %hpstate | |
141 | !! Set lsu_control_reg.dm (bit 3 in ASI 0x45, VA 0x0) | |
142 | !setx 0x8, %l1, %i6 | |
143 | !stxa %i6, [%g0 + %g0] 0x45 | |
144 | ||
145 | ! Fetch and execute some stuff... | |
146 | ||
147 | add %i1, %i2, %o1 | |
148 | add %i2, %i3, %o2 | |
149 | add %i3, %i4, %o3 | |
150 | add %i4, %i5, %o4 | |
151 | add %i5, %i6, %o5 | |
152 | ||
153 | setx 1, %l1, %l5 | |
154 | ||
155 | setx MAIN_BASE_DATA_VA, %i1, %l7 | |
156 | ldx [%l7+0], %l5 | |
157 | ||
158 | setx 8192, %i1, %l6 | |
159 | add %l5, 1, %l5 | |
160 | stx %l5, [%l7 + %l6] | |
161 | ||
162 | ||
163 | ||
164 | ||
165 | ||
166 | ||
167 | ||
168 | ||
169 | ||
170 | EXIT_GOOD /* test finish */ | |
171 | ||
172 | /************************************************************************ | |
173 | Test case data start | |
174 | ************************************************************************/ | |
175 | .data | |
176 | user_data_start: | |
177 | scratch_area: | |
178 | page0: | |
179 | .word 0x04BAEE04 | |
180 | .word 0xA26211E7 | |
181 | .word 0xC46CE935 | |
182 | .word 0xD086C0FA | |
183 | .word 0x95181468 | |
184 | .word 0xA561DA01 | |
185 | .word 0x66B600B3 | |
186 | .word 0x3DDF304B | |
187 | .align 8192 | |
188 | page1: | |
189 | .word 0xD59B63E9 | |
190 | .word 0x69CD7744 | |
191 | .word 0x93D976FD | |
192 | .word 0x632A2A09 | |
193 | .word 0xD21BB7C3 | |
194 | .word 0x6D4AA3F7 | |
195 | .word 0x1FB493C2 | |
196 | .word 0xA8132A6B | |
197 | .word 0x5D211FF0 | |
198 | .word 0x819A5EF5 | |
199 | .word 0x73B3D78A | |
200 | .word 0x979BCD1A | |
201 | .word 0x88730AC3 | |
202 | .word 0xBD87189E | |
203 | .word 0x372CA055 | |
204 | .word 0x87AD6A47 | |
205 | .word 0x1EC56408 | |
206 | .word 0x19156A2C | |
207 | .word 0x188A924A | |
208 | .word 0xE21AB83D | |
209 | .word 0xAC4488B1 | |
210 | .word 0x34AF2861 | |
211 | .word 0x90E27A07 | |
212 | .word 0x7ECBAD34 | |
213 | .word 0x0D0C9AD8 | |
214 | .word 0xCD68A2C2 | |
215 | .word 0x744F3CF8 | |
216 | .word 0x8BF0C9D3 | |
217 | .word 0xB6232F4D | |
218 | .word 0x16EEB7FF | |
219 | .word 0x2CE4DC96 | |
220 | .word 0x086BC9ED | |
221 | .word 0x87757CAE | |
222 | .word 0xF207ACCA | |
223 | .word 0xE25E65DB | |
224 | .word 0x8189486F | |
225 | .word 0x00156704 | |
226 | .word 0x0E78970C | |
227 | .word 0x00B22AFF | |
228 | .word 0x5EA3DBAD | |
229 | .word 0x091EEE20 | |
230 | .word 0x067AF9AB | |
231 | .word 0x68CC189A | |
232 | .word 0xAEE0946E | |
233 | .word 0x24E3D750 | |
234 | .word 0x704AC16A | |
235 | .word 0xA3F11926 | |
236 | .word 0xE63276D1 | |
237 | .word 0xDD91CC43 | |
238 | .word 0x87772648 | |
239 | .word 0x2983F7D2 | |
240 | .word 0xD99DB0E4 | |
241 | .word 0x96D7B61B | |
242 | .word 0x29F098FC | |
243 | .word 0xCA413B16 | |
244 | .word 0x506B0706 | |
245 | .end |