2 * Copyright 2013 Red Hat Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
22 * Authors: Ben Skeggs <bskeggs@redhat.com>
27 static struct nvc0_graph_init
28 nvc8_grctx_init_icmd[] = {
29 { 0x001000, 1, 0x01, 0x00000004 },
30 { 0x0000a9, 1, 0x01, 0x0000ffff },
31 { 0x000038, 1, 0x01, 0x0fac6881 },
32 { 0x00003d, 1, 0x01, 0x00000001 },
33 { 0x0000e8, 8, 0x01, 0x00000400 },
34 { 0x000078, 8, 0x01, 0x00000300 },
35 { 0x000050, 1, 0x01, 0x00000011 },
36 { 0x000058, 8, 0x01, 0x00000008 },
37 { 0x000208, 8, 0x01, 0x00000001 },
38 { 0x000081, 1, 0x01, 0x00000001 },
39 { 0x000085, 1, 0x01, 0x00000004 },
40 { 0x000088, 1, 0x01, 0x00000400 },
41 { 0x000090, 1, 0x01, 0x00000300 },
42 { 0x000098, 1, 0x01, 0x00001001 },
43 { 0x0000e3, 1, 0x01, 0x00000001 },
44 { 0x0000da, 1, 0x01, 0x00000001 },
45 { 0x0000f8, 1, 0x01, 0x00000003 },
46 { 0x0000fa, 1, 0x01, 0x00000001 },
47 { 0x00009f, 4, 0x01, 0x0000ffff },
48 { 0x0000b1, 1, 0x01, 0x00000001 },
49 { 0x0000b2, 40, 0x01, 0x00000000 },
50 { 0x000210, 8, 0x01, 0x00000040 },
51 { 0x000218, 8, 0x01, 0x0000c080 },
52 { 0x0000ad, 1, 0x01, 0x0000013e },
53 { 0x0000e1, 1, 0x01, 0x00000010 },
54 { 0x000290, 16, 0x01, 0x00000000 },
55 { 0x0003b0, 16, 0x01, 0x00000000 },
56 { 0x0002a0, 16, 0x01, 0x00000000 },
57 { 0x000420, 16, 0x01, 0x00000000 },
58 { 0x0002b0, 16, 0x01, 0x00000000 },
59 { 0x000430, 16, 0x01, 0x00000000 },
60 { 0x0002c0, 16, 0x01, 0x00000000 },
61 { 0x0004d0, 16, 0x01, 0x00000000 },
62 { 0x000720, 16, 0x01, 0x00000000 },
63 { 0x0008c0, 16, 0x01, 0x00000000 },
64 { 0x000890, 16, 0x01, 0x00000000 },
65 { 0x0008e0, 16, 0x01, 0x00000000 },
66 { 0x0008a0, 16, 0x01, 0x00000000 },
67 { 0x0008f0, 16, 0x01, 0x00000000 },
68 { 0x00094c, 1, 0x01, 0x000000ff },
69 { 0x00094d, 1, 0x01, 0xffffffff },
70 { 0x00094e, 1, 0x01, 0x00000002 },
71 { 0x0002ec, 1, 0x01, 0x00000001 },
72 { 0x000303, 1, 0x01, 0x00000001 },
73 { 0x0002e6, 1, 0x01, 0x00000001 },
74 { 0x000466, 1, 0x01, 0x00000052 },
75 { 0x000301, 1, 0x01, 0x3f800000 },
76 { 0x000304, 1, 0x01, 0x30201000 },
77 { 0x000305, 1, 0x01, 0x70605040 },
78 { 0x000306, 1, 0x01, 0xb8a89888 },
79 { 0x000307, 1, 0x01, 0xf8e8d8c8 },
80 { 0x00030a, 1, 0x01, 0x00ffff00 },
81 { 0x00030b, 1, 0x01, 0x0000001a },
82 { 0x00030c, 1, 0x01, 0x00000001 },
83 { 0x000318, 1, 0x01, 0x00000001 },
84 { 0x000340, 1, 0x01, 0x00000000 },
85 { 0x000375, 1, 0x01, 0x00000001 },
86 { 0x000351, 1, 0x01, 0x00000100 },
87 { 0x00037d, 1, 0x01, 0x00000006 },
88 { 0x0003a0, 1, 0x01, 0x00000002 },
89 { 0x0003aa, 1, 0x01, 0x00000001 },
90 { 0x0003a9, 1, 0x01, 0x00000001 },
91 { 0x000380, 1, 0x01, 0x00000001 },
92 { 0x000360, 1, 0x01, 0x00000040 },
93 { 0x000366, 2, 0x01, 0x00000000 },
94 { 0x000368, 1, 0x01, 0x00001fff },
95 { 0x000370, 2, 0x01, 0x00000000 },
96 { 0x000372, 1, 0x01, 0x003fffff },
97 { 0x00037a, 1, 0x01, 0x00000012 },
98 { 0x0005e0, 5, 0x01, 0x00000022 },
99 { 0x000619, 1, 0x01, 0x00000003 },
100 { 0x000811, 1, 0x01, 0x00000003 },
101 { 0x000812, 1, 0x01, 0x00000004 },
102 { 0x000813, 1, 0x01, 0x00000006 },
103 { 0x000814, 1, 0x01, 0x00000008 },
104 { 0x000815, 1, 0x01, 0x0000000b },
105 { 0x000800, 6, 0x01, 0x00000001 },
106 { 0x000632, 1, 0x01, 0x00000001 },
107 { 0x000633, 1, 0x01, 0x00000002 },
108 { 0x000634, 1, 0x01, 0x00000003 },
109 { 0x000635, 1, 0x01, 0x00000004 },
110 { 0x000654, 1, 0x01, 0x3f800000 },
111 { 0x000657, 1, 0x01, 0x3f800000 },
112 { 0x000655, 2, 0x01, 0x3f800000 },
113 { 0x0006cd, 1, 0x01, 0x3f800000 },
114 { 0x0007f5, 1, 0x01, 0x3f800000 },
115 { 0x0007dc, 1, 0x01, 0x39291909 },
116 { 0x0007dd, 1, 0x01, 0x79695949 },
117 { 0x0007de, 1, 0x01, 0xb9a99989 },
118 { 0x0007df, 1, 0x01, 0xf9e9d9c9 },
119 { 0x0007e8, 1, 0x01, 0x00003210 },
120 { 0x0007e9, 1, 0x01, 0x00007654 },
121 { 0x0007ea, 1, 0x01, 0x00000098 },
122 { 0x0007ec, 1, 0x01, 0x39291909 },
123 { 0x0007ed, 1, 0x01, 0x79695949 },
124 { 0x0007ee, 1, 0x01, 0xb9a99989 },
125 { 0x0007ef, 1, 0x01, 0xf9e9d9c9 },
126 { 0x0007f0, 1, 0x01, 0x00003210 },
127 { 0x0007f1, 1, 0x01, 0x00007654 },
128 { 0x0007f2, 1, 0x01, 0x00000098 },
129 { 0x0005a5, 1, 0x01, 0x00000001 },
130 { 0x000980, 128, 0x01, 0x00000000 },
131 { 0x000468, 1, 0x01, 0x00000004 },
132 { 0x00046c, 1, 0x01, 0x00000001 },
133 { 0x000470, 96, 0x01, 0x00000000 },
134 { 0x000510, 16, 0x01, 0x3f800000 },
135 { 0x000520, 1, 0x01, 0x000002b6 },
136 { 0x000529, 1, 0x01, 0x00000001 },
137 { 0x000530, 16, 0x01, 0xffff0000 },
138 { 0x000585, 1, 0x01, 0x0000003f },
139 { 0x000576, 1, 0x01, 0x00000003 },
140 { 0x00057b, 1, 0x01, 0x00000059 },
141 { 0x000586, 1, 0x01, 0x00000040 },
142 { 0x000582, 2, 0x01, 0x00000080 },
143 { 0x0005c2, 1, 0x01, 0x00000001 },
144 { 0x000638, 1, 0x01, 0x00000001 },
145 { 0x000639, 1, 0x01, 0x00000001 },
146 { 0x00063a, 1, 0x01, 0x00000002 },
147 { 0x00063b, 2, 0x01, 0x00000001 },
148 { 0x00063d, 1, 0x01, 0x00000002 },
149 { 0x00063e, 1, 0x01, 0x00000001 },
150 { 0x0008b8, 8, 0x01, 0x00000001 },
151 { 0x000900, 8, 0x01, 0x00000001 },
152 { 0x000908, 8, 0x01, 0x00000002 },
153 { 0x000910, 16, 0x01, 0x00000001 },
154 { 0x000920, 8, 0x01, 0x00000002 },
155 { 0x000928, 8, 0x01, 0x00000001 },
156 { 0x000648, 9, 0x01, 0x00000001 },
157 { 0x000658, 1, 0x01, 0x0000000f },
158 { 0x0007ff, 1, 0x01, 0x0000000a },
159 { 0x00066a, 1, 0x01, 0x40000000 },
160 { 0x00066b, 1, 0x01, 0x10000000 },
161 { 0x00066c, 2, 0x01, 0xffff0000 },
162 { 0x0007af, 2, 0x01, 0x00000008 },
163 { 0x0007f6, 1, 0x01, 0x00000001 },
164 { 0x0006b2, 1, 0x01, 0x00000055 },
165 { 0x0007ad, 1, 0x01, 0x00000003 },
166 { 0x000937, 1, 0x01, 0x00000001 },
167 { 0x000971, 1, 0x01, 0x00000008 },
168 { 0x000972, 1, 0x01, 0x00000040 },
169 { 0x000973, 1, 0x01, 0x0000012c },
170 { 0x00097c, 1, 0x01, 0x00000040 },
171 { 0x000979, 1, 0x01, 0x00000003 },
172 { 0x000975, 1, 0x01, 0x00000020 },
173 { 0x000976, 1, 0x01, 0x00000001 },
174 { 0x000977, 1, 0x01, 0x00000020 },
175 { 0x000978, 1, 0x01, 0x00000001 },
176 { 0x000957, 1, 0x01, 0x00000003 },
177 { 0x00095e, 1, 0x01, 0x20164010 },
178 { 0x00095f, 1, 0x01, 0x00000020 },
179 { 0x00097d, 1, 0x01, 0x00000020 },
180 { 0x000683, 1, 0x01, 0x00000006 },
181 { 0x000685, 1, 0x01, 0x003fffff },
182 { 0x000687, 1, 0x01, 0x00000c48 },
183 { 0x0006a0, 1, 0x01, 0x00000005 },
184 { 0x000840, 1, 0x01, 0x00300008 },
185 { 0x000841, 1, 0x01, 0x04000080 },
186 { 0x000842, 1, 0x01, 0x00300008 },
187 { 0x000843, 1, 0x01, 0x04000080 },
188 { 0x000818, 8, 0x01, 0x00000000 },
189 { 0x000848, 16, 0x01, 0x00000000 },
190 { 0x000738, 1, 0x01, 0x00000000 },
191 { 0x0006aa, 1, 0x01, 0x00000001 },
192 { 0x0006ab, 1, 0x01, 0x00000002 },
193 { 0x0006ac, 1, 0x01, 0x00000080 },
194 { 0x0006ad, 2, 0x01, 0x00000100 },
195 { 0x0006b1, 1, 0x01, 0x00000011 },
196 { 0x0006bb, 1, 0x01, 0x000000cf },
197 { 0x0006ce, 1, 0x01, 0x2a712488 },
198 { 0x000739, 1, 0x01, 0x4085c000 },
199 { 0x00073a, 1, 0x01, 0x00000080 },
200 { 0x000786, 1, 0x01, 0x80000100 },
201 { 0x00073c, 1, 0x01, 0x00010100 },
202 { 0x00073d, 1, 0x01, 0x02800000 },
203 { 0x000787, 1, 0x01, 0x000000cf },
204 { 0x00078c, 1, 0x01, 0x00000008 },
205 { 0x000792, 1, 0x01, 0x00000001 },
206 { 0x000794, 1, 0x01, 0x00000001 },
207 { 0x000795, 2, 0x01, 0x00000001 },
208 { 0x000797, 1, 0x01, 0x000000cf },
209 { 0x000836, 1, 0x01, 0x00000001 },
210 { 0x00079a, 1, 0x01, 0x00000002 },
211 { 0x000833, 1, 0x01, 0x04444480 },
212 { 0x0007a1, 1, 0x01, 0x00000001 },
213 { 0x0007a3, 1, 0x01, 0x00000001 },
214 { 0x0007a4, 2, 0x01, 0x00000001 },
215 { 0x000831, 1, 0x01, 0x00000004 },
216 { 0x00080c, 1, 0x01, 0x00000002 },
217 { 0x00080d, 2, 0x01, 0x00000100 },
218 { 0x00080f, 1, 0x01, 0x00000001 },
219 { 0x000823, 1, 0x01, 0x00000002 },
220 { 0x000824, 2, 0x01, 0x00000100 },
221 { 0x000826, 1, 0x01, 0x00000001 },
222 { 0x00095d, 1, 0x01, 0x00000001 },
223 { 0x00082b, 1, 0x01, 0x00000004 },
224 { 0x000942, 1, 0x01, 0x00010001 },
225 { 0x000943, 1, 0x01, 0x00000001 },
226 { 0x000944, 1, 0x01, 0x00000022 },
227 { 0x0007c5, 1, 0x01, 0x00010001 },
228 { 0x000834, 1, 0x01, 0x00000001 },
229 { 0x0007c7, 1, 0x01, 0x00000001 },
230 { 0x00c1b0, 8, 0x01, 0x0000000f },
231 { 0x00c1b8, 1, 0x01, 0x0fac6881 },
232 { 0x00c1b9, 1, 0x01, 0x00fac688 },
233 { 0x01e100, 1, 0x01, 0x00000001 },
234 { 0x001000, 1, 0x01, 0x00000002 },
235 { 0x0006aa, 1, 0x01, 0x00000001 },
236 { 0x0006ad, 2, 0x01, 0x00000100 },
237 { 0x0006b1, 1, 0x01, 0x00000011 },
238 { 0x00078c, 1, 0x01, 0x00000008 },
239 { 0x000792, 1, 0x01, 0x00000001 },
240 { 0x000794, 1, 0x01, 0x00000001 },
241 { 0x000795, 2, 0x01, 0x00000001 },
242 { 0x000797, 1, 0x01, 0x000000cf },
243 { 0x00079a, 1, 0x01, 0x00000002 },
244 { 0x000833, 1, 0x01, 0x04444480 },
245 { 0x0007a1, 1, 0x01, 0x00000001 },
246 { 0x0007a3, 1, 0x01, 0x00000001 },
247 { 0x0007a4, 2, 0x01, 0x00000001 },
248 { 0x000831, 1, 0x01, 0x00000004 },
249 { 0x01e100, 1, 0x01, 0x00000001 },
250 { 0x001000, 1, 0x01, 0x00000014 },
251 { 0x000351, 1, 0x01, 0x00000100 },
252 { 0x000957, 1, 0x01, 0x00000003 },
253 { 0x00095d, 1, 0x01, 0x00000001 },
254 { 0x00082b, 1, 0x01, 0x00000004 },
255 { 0x000942, 1, 0x01, 0x00010001 },
256 { 0x000943, 1, 0x01, 0x00000001 },
257 { 0x0007c5, 1, 0x01, 0x00010001 },
258 { 0x000834, 1, 0x01, 0x00000001 },
259 { 0x0007c7, 1, 0x01, 0x00000001 },
260 { 0x01e100, 1, 0x01, 0x00000001 },
261 { 0x001000, 1, 0x01, 0x00000001 },
262 { 0x00080c, 1, 0x01, 0x00000002 },
263 { 0x00080d, 2, 0x01, 0x00000100 },
264 { 0x00080f, 1, 0x01, 0x00000001 },
265 { 0x000823, 1, 0x01, 0x00000002 },
266 { 0x000824, 2, 0x01, 0x00000100 },
267 { 0x000826, 1, 0x01, 0x00000001 },
268 { 0x01e100, 1, 0x01, 0x00000001 },
272 static struct nvc0_graph_init
273 nvc8_grctx_init_tpc[] = {
274 { 0x419818, 1, 0x04, 0x00000000 },
275 { 0x41983c, 1, 0x04, 0x00038bc7 },
276 { 0x419848, 1, 0x04, 0x00000000 },
277 { 0x419864, 1, 0x04, 0x0000012a },
278 { 0x419888, 1, 0x04, 0x00000000 },
279 { 0x419a00, 1, 0x04, 0x000001f0 },
280 { 0x419a04, 1, 0x04, 0x00000001 },
281 { 0x419a08, 1, 0x04, 0x00000023 },
282 { 0x419a0c, 1, 0x04, 0x00020000 },
283 { 0x419a10, 1, 0x04, 0x00000000 },
284 { 0x419a14, 1, 0x04, 0x00000200 },
285 { 0x419a1c, 1, 0x04, 0x00000000 },
286 { 0x419a20, 1, 0x04, 0x00000800 },
287 { 0x419b00, 1, 0x04, 0x0a418820 },
288 { 0x419b04, 1, 0x04, 0x062080e6 },
289 { 0x419b08, 1, 0x04, 0x020398a4 },
290 { 0x419b0c, 1, 0x04, 0x0e629062 },
291 { 0x419b10, 1, 0x04, 0x0a418820 },
292 { 0x419b14, 1, 0x04, 0x000000e6 },
293 { 0x419bd0, 1, 0x04, 0x00900103 },
294 { 0x419be0, 1, 0x04, 0x00000001 },
295 { 0x419be4, 1, 0x04, 0x00000000 },
296 { 0x419c00, 1, 0x04, 0x00000002 },
297 { 0x419c04, 1, 0x04, 0x00000006 },
298 { 0x419c08, 1, 0x04, 0x00000002 },
299 { 0x419c20, 1, 0x04, 0x00000000 },
300 { 0x419cb0, 1, 0x04, 0x00060048 },
301 { 0x419ce8, 1, 0x04, 0x00000000 },
302 { 0x419cf4, 1, 0x04, 0x00000183 },
303 { 0x419d20, 1, 0x04, 0x02180000 },
304 { 0x419d24, 1, 0x04, 0x00001fff },
305 { 0x419e04, 3, 0x04, 0x00000000 },
306 { 0x419e10, 1, 0x04, 0x00000002 },
307 { 0x419e44, 1, 0x04, 0x001beff2 },
308 { 0x419e48, 1, 0x04, 0x00000000 },
309 { 0x419e4c, 1, 0x04, 0x0000000f },
310 { 0x419e50, 17, 0x04, 0x00000000 },
311 { 0x419e98, 1, 0x04, 0x00000000 },
312 { 0x419f50, 2, 0x04, 0x00000000 },
316 struct nvc0_graph_init
317 nvc8_grctx_init_9197[] = {
318 { 0x0002e4, 1, 0x04, 0x0000b001 },
322 struct nvc0_graph_init
323 nvc8_grctx_init_9297[] = {
324 { 0x003400, 128, 0x04, 0x00000000 },
325 { 0x00036c, 2, 0x04, 0x00000000 },
326 { 0x0007a4, 2, 0x04, 0x00000000 },
327 { 0x000374, 1, 0x04, 0x00000000 },
328 { 0x000378, 1, 0x04, 0x00000020 },
332 static struct nvc0_graph_mthd
333 nvc8_grctx_init_mthd[] = {
334 { 0x9097, nvc1_grctx_init_9097, },
335 { 0x9197, nvc8_grctx_init_9197, },
336 { 0x9297, nvc8_grctx_init_9297, },
337 { 0x902d, nvc0_grctx_init_902d, },
338 { 0x9039, nvc0_grctx_init_9039, },
339 { 0x90c0, nvc0_grctx_init_90c0, },
340 { 0x902d, nvc0_grctx_init_mthd_magic, },
344 static struct nvc0_graph_init *
345 nvc8_grctx_init_gpc[] = {
346 nvc0_grctx_init_gpc_0,
347 nvc0_grctx_init_gpc_1,
352 struct nouveau_oclass *
353 nvc8_grctx_oclass = &(struct nvc0_grctx_oclass) {
354 .base.handle = NV_ENGCTX(GR, 0xc8),
355 .base.ofuncs = &(struct nouveau_ofuncs) {
356 .ctor = nvc0_graph_context_ctor,
357 .dtor = nvc0_graph_context_dtor,
358 .init = _nouveau_graph_context_init,
359 .fini = _nouveau_graph_context_fini,
360 .rd32 = _nouveau_graph_context_rd32,
361 .wr32 = _nouveau_graph_context_wr32,
363 .main = nvc0_grctx_generate_main,
364 .mods = nvc0_grctx_generate_mods,
365 .unkn = nvc0_grctx_generate_unkn,
366 .hub = nvc0_grctx_init_hub,
367 .gpc = nvc8_grctx_init_gpc,
368 .icmd = nvc8_grctx_init_icmd,
369 .mthd = nvc8_grctx_init_mthd,