Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: dcacheOvL.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 | #define DMMU_SKIP_IF_NO_TTE | |
41 | #define CREGS_PIL 0x0 | |
42 | #define PCONTEXT0 0xF | |
43 | ||
44 | #include "mmu_custom_intr_handlers.s" | |
45 | #include "hboot.s" | |
46 | ||
47 | .text | |
48 | .global main | |
49 | ||
50 | main: | |
51 | nop;nop;nop;nop;nop;nop;nop;nop | |
52 | ||
53 | ta T_CHANGE_HPRIV | |
54 | ||
55 | ! Setup counter | |
56 | set 0x1810C0BE, %l0 ! count D-Cache Misses | |
57 | ||
58 | ! Set a high pic value | |
59 | setx 0xFFFFFF00FFFFFFEC, %i4, %i5 | |
60 | !mov %g0, %i5 | |
61 | ||
62 | wr %l0, %g0, %pcr ! count D-Cache Misses | |
63 | wr %i5, %g0, %pic ! zero out the counter | |
64 | ||
65 | ||
66 | !Create the address | |
67 | setx 0xfffffffff1004000, %o1, %o2 | |
68 | ||
69 | ! Setup a TLB Entry | |
70 | setx 0xfffffffff100400F, %g5, %g6 ! Data for Tag Access | |
71 | setx 0x800000FFF0100000, %g5, %g7 ! Data for Data-Access | |
72 | ||
73 | add 0x30, %g0, %o0 | |
74 | stxa %g6, [%o0] 0x50 ! Write tag access | |
75 | stxa %g7, [%g0] 0x55 | |
76 | ||
77 | ! Setup a TLB Entry | |
78 | setx 0xfffffffff010600F, %g5, %g6 ! Data for Tag Access | |
79 | setx 0x800000FFF0106000, %g5, %g7 ! Data for Data-Access | |
80 | ||
81 | add 0x30, %g0, %o0 | |
82 | add 0x10, %g0, %o1 | |
83 | ||
84 | stxa %g6, [%o0] 0x50 ! Write tag access | |
85 | stxa %g7, [%o1] 0x55 | |
86 | ||
87 | ||
88 | ! Setup a DTLB Entry | |
89 | setx 0x10044, %g5, %g6 ! Data for Tag Access | |
90 | setx 0x8000003FF0010440, %g5, %g7 ! Data for Data-Access | |
91 | ||
92 | add 0x30, %g0, %o0 | |
93 | add 0x10, %g0, %i0 | |
94 | stxa %g6, [%o0] 0x58 ! Write tag access | |
95 | stxa %g7, [%i0] 0x5D | |
96 | ||
97 | ! Setup a DTLB Entry | |
98 | setx 0x20044, %g5, %g6 ! Data for Tag Access | |
99 | setx 0x8000004FF0010440, %g5, %g7 ! Data for Data-Access | |
100 | ||
101 | add 0x30, %g0, %o0 | |
102 | add 0x20, %g0, %i0 | |
103 | stxa %g6, [%o0] 0x58 ! Write tag access | |
104 | stxa %g7, [%i0] 0x5D | |
105 | ||
106 | ! Setup a DTLB Entry | |
107 | setx 0x30044, %g5, %g6 ! Data for Tag Access | |
108 | setx 0x8000005FF0010440, %g5, %g7 ! Data for Data-Access | |
109 | ||
110 | add 0x30, %g0, %o0 | |
111 | add 0x30, %g0, %i0 | |
112 | stxa %g6, [%o0] 0x58 ! Write tag access | |
113 | stxa %g7, [%i0] 0x5D | |
114 | ||
115 | ! Setup a DTLB Entry | |
116 | setx 0x40044, %g5, %g6 ! Data for Tag Access | |
117 | setx 0x8000006FF0010440, %g5, %g7 ! Data for Data-Access | |
118 | ||
119 | add 0x30, %g0, %o0 | |
120 | add 0x40, %g0, %i0 | |
121 | stxa %g6, [%o0] 0x58 ! Write tag access | |
122 | stxa %g7, [%i0] 0x5D | |
123 | ||
124 | ! Setup a DTLB Entry | |
125 | setx 0x50044, %g5, %g6 ! Data for Tag Access | |
126 | setx 0x8000007FF0010440, %g5, %g7 ! Data for Data-Access | |
127 | ||
128 | add 0x30, %g0, %o0 | |
129 | add 0x50, %g0, %i0 | |
130 | stxa %g6, [%o0] 0x58 ! Write tag access | |
131 | stxa %g7, [%i0] 0x5D | |
132 | ||
133 | ||
134 | ta T_CHANGE_NONHPRIV | |
135 | setx 0x10000, %g4, %g3 | |
136 | ldx [%g3], %g2 | |
137 | setx 0x20000, %g4, %g3 | |
138 | ldx [%g3], %g2 | |
139 | setx 0x30000, %g4, %g3 | |
140 | ldx [%g3], %g2 | |
141 | setx 0x40000, %g4, %g3 | |
142 | ldx [%g3], %g2 | |
143 | setx 0x50000, %g4, %g3 | |
144 | ldx [%g3], %g2 | |
145 | ||
146 | ||
147 | ta T_CHANGE_PRIV | |
148 | ! rdhpr %hpstate, %g1 | |
149 | ! andn %g1, 0x4, %g2 | |
150 | setx 0x500000005, %g4, %g5 | |
151 | rd %pic, %g2 ! load the current pic value into %g2 | |
152 | xor %g2, %g5, %g6 | |
153 | brnz %g6, bad_trap | |
154 | nop | |
155 | ||
156 | ||
157 | !good_trap: | |
158 | ! ba good_trap | |
159 | ||
160 | bad_trap: | |
161 | ba bad_trap | |
162 | nop | |
163 | nop | |
164 | ||
165 | .data | |
166 | user_data_start: | |
167 | .word 0xFFFF2e2d | |
168 |