2 * Copyright 2012 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.
25 #include <core/client.h>
26 #include <core/handle.h>
27 #include <core/namedb.h>
28 #include <core/gpuobj.h>
29 #include <core/engctx.h>
30 #include <core/event.h>
31 #include <core/class.h>
32 #include <core/math.h>
33 #include <core/enum.h>
35 #include <subdev/timer.h>
36 #include <subdev/bar.h>
37 #include <subdev/vm.h>
39 #include <engine/dmaobj.h>
40 #include <engine/fifo.h>
42 struct nvc0_fifo_priv {
43 struct nouveau_fifo base;
44 struct nouveau_gpuobj *playlist[2];
47 struct nouveau_gpuobj *mem;
48 struct nouveau_vma bar;
53 struct nvc0_fifo_base {
54 struct nouveau_fifo_base base;
55 struct nouveau_gpuobj *pgd;
56 struct nouveau_vm *vm;
59 struct nvc0_fifo_chan {
60 struct nouveau_fifo_chan base;
63 /*******************************************************************************
64 * FIFO channel objects
65 ******************************************************************************/
68 nvc0_fifo_playlist_update(struct nvc0_fifo_priv *priv)
70 struct nouveau_bar *bar = nouveau_bar(priv);
71 struct nouveau_gpuobj *cur;
74 mutex_lock(&nv_subdev(priv)->mutex);
75 cur = priv->playlist[priv->cur_playlist];
76 priv->cur_playlist = !priv->cur_playlist;
78 for (i = 0, p = 0; i < 128; i++) {
79 if (!(nv_rd32(priv, 0x003004 + (i * 8)) & 1))
81 nv_wo32(cur, p + 0, i);
82 nv_wo32(cur, p + 4, 0x00000004);
87 nv_wr32(priv, 0x002270, cur->addr >> 12);
88 nv_wr32(priv, 0x002274, 0x01f00000 | (p >> 3));
89 if (!nv_wait(priv, 0x00227c, 0x00100000, 0x00000000))
90 nv_error(priv, "playlist update failed\n");
91 mutex_unlock(&nv_subdev(priv)->mutex);
95 nvc0_fifo_context_attach(struct nouveau_object *parent,
96 struct nouveau_object *object)
98 struct nouveau_bar *bar = nouveau_bar(parent);
99 struct nvc0_fifo_base *base = (void *)parent->parent;
100 struct nouveau_engctx *ectx = (void *)object;
104 switch (nv_engidx(object->engine)) {
105 case NVDEV_ENGINE_SW : return 0;
106 case NVDEV_ENGINE_GR : addr = 0x0210; break;
107 case NVDEV_ENGINE_COPY0: addr = 0x0230; break;
108 case NVDEV_ENGINE_COPY1: addr = 0x0240; break;
109 case NVDEV_ENGINE_BSP : addr = 0x0270; break;
110 case NVDEV_ENGINE_VP : addr = 0x0250; break;
111 case NVDEV_ENGINE_PPP : addr = 0x0260; break;
116 if (!ectx->vma.node) {
117 ret = nouveau_gpuobj_map_vm(nv_gpuobj(ectx), base->vm,
118 NV_MEM_ACCESS_RW, &ectx->vma);
122 nv_engctx(ectx)->addr = nv_gpuobj(base)->addr >> 12;
125 nv_wo32(base, addr + 0x00, lower_32_bits(ectx->vma.offset) | 4);
126 nv_wo32(base, addr + 0x04, upper_32_bits(ectx->vma.offset));
132 nvc0_fifo_context_detach(struct nouveau_object *parent, bool suspend,
133 struct nouveau_object *object)
135 struct nouveau_bar *bar = nouveau_bar(parent);
136 struct nvc0_fifo_priv *priv = (void *)parent->engine;
137 struct nvc0_fifo_base *base = (void *)parent->parent;
138 struct nvc0_fifo_chan *chan = (void *)parent;
141 switch (nv_engidx(object->engine)) {
142 case NVDEV_ENGINE_SW : return 0;
143 case NVDEV_ENGINE_GR : addr = 0x0210; break;
144 case NVDEV_ENGINE_COPY0: addr = 0x0230; break;
145 case NVDEV_ENGINE_COPY1: addr = 0x0240; break;
146 case NVDEV_ENGINE_BSP : addr = 0x0270; break;
147 case NVDEV_ENGINE_VP : addr = 0x0250; break;
148 case NVDEV_ENGINE_PPP : addr = 0x0260; break;
153 nv_wr32(priv, 0x002634, chan->base.chid);
154 if (!nv_wait(priv, 0x002634, 0xffffffff, chan->base.chid)) {
155 nv_error(priv, "channel %d [%s] kick timeout\n",
156 chan->base.chid, nouveau_client_name(chan));
161 nv_wo32(base, addr + 0x00, 0x00000000);
162 nv_wo32(base, addr + 0x04, 0x00000000);
168 nvc0_fifo_chan_ctor(struct nouveau_object *parent,
169 struct nouveau_object *engine,
170 struct nouveau_oclass *oclass, void *data, u32 size,
171 struct nouveau_object **pobject)
173 struct nouveau_bar *bar = nouveau_bar(parent);
174 struct nvc0_fifo_priv *priv = (void *)engine;
175 struct nvc0_fifo_base *base = (void *)parent;
176 struct nvc0_fifo_chan *chan;
177 struct nv50_channel_ind_class *args = data;
178 u64 usermem, ioffset, ilength;
181 if (size < sizeof(*args))
184 ret = nouveau_fifo_channel_create(parent, engine, oclass, 1,
185 priv->user.bar.offset, 0x1000,
187 (1ULL << NVDEV_ENGINE_SW) |
188 (1ULL << NVDEV_ENGINE_GR) |
189 (1ULL << NVDEV_ENGINE_COPY0) |
190 (1ULL << NVDEV_ENGINE_COPY1) |
191 (1ULL << NVDEV_ENGINE_BSP) |
192 (1ULL << NVDEV_ENGINE_VP) |
193 (1ULL << NVDEV_ENGINE_PPP), &chan);
194 *pobject = nv_object(chan);
198 nv_parent(chan)->context_attach = nvc0_fifo_context_attach;
199 nv_parent(chan)->context_detach = nvc0_fifo_context_detach;
201 usermem = chan->base.chid * 0x1000;
202 ioffset = args->ioffset;
203 ilength = log2i(args->ilength / 8);
205 for (i = 0; i < 0x1000; i += 4)
206 nv_wo32(priv->user.mem, usermem + i, 0x00000000);
208 nv_wo32(base, 0x08, lower_32_bits(priv->user.mem->addr + usermem));
209 nv_wo32(base, 0x0c, upper_32_bits(priv->user.mem->addr + usermem));
210 nv_wo32(base, 0x10, 0x0000face);
211 nv_wo32(base, 0x30, 0xfffff902);
212 nv_wo32(base, 0x48, lower_32_bits(ioffset));
213 nv_wo32(base, 0x4c, upper_32_bits(ioffset) | (ilength << 16));
214 nv_wo32(base, 0x54, 0x00000002);
215 nv_wo32(base, 0x84, 0x20400000);
216 nv_wo32(base, 0x94, 0x30000001);
217 nv_wo32(base, 0x9c, 0x00000100);
218 nv_wo32(base, 0xa4, 0x1f1f1f1f);
219 nv_wo32(base, 0xa8, 0x1f1f1f1f);
220 nv_wo32(base, 0xac, 0x0000001f);
221 nv_wo32(base, 0xb8, 0xf8000000);
222 nv_wo32(base, 0xf8, 0x10003080); /* 0x002310 */
223 nv_wo32(base, 0xfc, 0x10000010); /* 0x002350 */
229 nvc0_fifo_chan_init(struct nouveau_object *object)
231 struct nouveau_gpuobj *base = nv_gpuobj(object->parent);
232 struct nvc0_fifo_priv *priv = (void *)object->engine;
233 struct nvc0_fifo_chan *chan = (void *)object;
234 u32 chid = chan->base.chid;
237 ret = nouveau_fifo_channel_init(&chan->base);
241 nv_wr32(priv, 0x003000 + (chid * 8), 0xc0000000 | base->addr >> 12);
242 nv_wr32(priv, 0x003004 + (chid * 8), 0x001f0001);
243 nvc0_fifo_playlist_update(priv);
248 nvc0_fifo_chan_fini(struct nouveau_object *object, bool suspend)
250 struct nvc0_fifo_priv *priv = (void *)object->engine;
251 struct nvc0_fifo_chan *chan = (void *)object;
252 u32 chid = chan->base.chid;
255 nv_mask(priv, 0x003004 + (chid * 8), 0x00000001, 0x00000000);
256 nvc0_fifo_playlist_update(priv);
257 mask = nv_rd32(priv, 0x0025a4);
258 for (engine = 0; mask && engine < 16; engine++) {
259 if (!(mask & (1 << engine)))
261 nv_mask(priv, 0x0025a8 + (engine * 4), 0x00000000, 0x00000000);
262 mask &= ~(1 << engine);
264 nv_wr32(priv, 0x003000 + (chid * 8), 0x00000000);
266 return nouveau_fifo_channel_fini(&chan->base, suspend);
269 static struct nouveau_ofuncs
271 .ctor = nvc0_fifo_chan_ctor,
272 .dtor = _nouveau_fifo_channel_dtor,
273 .init = nvc0_fifo_chan_init,
274 .fini = nvc0_fifo_chan_fini,
275 .rd32 = _nouveau_fifo_channel_rd32,
276 .wr32 = _nouveau_fifo_channel_wr32,
279 static struct nouveau_oclass
280 nvc0_fifo_sclass[] = {
281 { NVC0_CHANNEL_IND_CLASS, &nvc0_fifo_ofuncs },
285 /*******************************************************************************
286 * FIFO context - instmem heap and vm setup
287 ******************************************************************************/
290 nvc0_fifo_context_ctor(struct nouveau_object *parent,
291 struct nouveau_object *engine,
292 struct nouveau_oclass *oclass, void *data, u32 size,
293 struct nouveau_object **pobject)
295 struct nvc0_fifo_base *base;
298 ret = nouveau_fifo_context_create(parent, engine, oclass, NULL, 0x1000,
299 0x1000, NVOBJ_FLAG_ZERO_ALLOC |
300 NVOBJ_FLAG_HEAP, &base);
301 *pobject = nv_object(base);
305 ret = nouveau_gpuobj_new(nv_object(base), NULL, 0x10000, 0x1000, 0,
310 nv_wo32(base, 0x0200, lower_32_bits(base->pgd->addr));
311 nv_wo32(base, 0x0204, upper_32_bits(base->pgd->addr));
312 nv_wo32(base, 0x0208, 0xffffffff);
313 nv_wo32(base, 0x020c, 0x000000ff);
315 ret = nouveau_vm_ref(nouveau_client(parent)->vm, &base->vm, base->pgd);
323 nvc0_fifo_context_dtor(struct nouveau_object *object)
325 struct nvc0_fifo_base *base = (void *)object;
326 nouveau_vm_ref(NULL, &base->vm, base->pgd);
327 nouveau_gpuobj_ref(NULL, &base->pgd);
328 nouveau_fifo_context_destroy(&base->base);
331 static struct nouveau_oclass
333 .handle = NV_ENGCTX(FIFO, 0xc0),
334 .ofuncs = &(struct nouveau_ofuncs) {
335 .ctor = nvc0_fifo_context_ctor,
336 .dtor = nvc0_fifo_context_dtor,
337 .init = _nouveau_fifo_context_init,
338 .fini = _nouveau_fifo_context_fini,
339 .rd32 = _nouveau_fifo_context_rd32,
340 .wr32 = _nouveau_fifo_context_wr32,
344 /*******************************************************************************
346 ******************************************************************************/
348 static const struct nouveau_enum nvc0_fifo_fault_unit[] = {
349 { 0x00, "PGRAPH", NULL, NVDEV_ENGINE_GR },
350 { 0x03, "PEEPHOLE" },
353 { 0x07, "PFIFO", NULL, NVDEV_ENGINE_FIFO },
354 { 0x10, "PBSP", NULL, NVDEV_ENGINE_BSP },
355 { 0x11, "PPPP", NULL, NVDEV_ENGINE_PPP },
356 { 0x13, "PCOUNTER" },
357 { 0x14, "PVP", NULL, NVDEV_ENGINE_VP },
358 { 0x15, "PCOPY0", NULL, NVDEV_ENGINE_COPY0 },
359 { 0x16, "PCOPY1", NULL, NVDEV_ENGINE_COPY1 },
364 static const struct nouveau_enum nvc0_fifo_fault_reason[] = {
365 { 0x00, "PT_NOT_PRESENT" },
366 { 0x01, "PT_TOO_SHORT" },
367 { 0x02, "PAGE_NOT_PRESENT" },
368 { 0x03, "VM_LIMIT_EXCEEDED" },
369 { 0x04, "NO_CHANNEL" },
370 { 0x05, "PAGE_SYSTEM_ONLY" },
371 { 0x06, "PAGE_READ_ONLY" },
372 { 0x0a, "COMPRESSED_SYSRAM" },
373 { 0x0c, "INVALID_STORAGE_TYPE" },
377 static const struct nouveau_enum nvc0_fifo_fault_hubclient[] = {
380 { 0x04, "DISPATCH" },
383 { 0x07, "BAR_READ" },
384 { 0x08, "BAR_WRITE" },
388 { 0x11, "PCOUNTER" },
391 { 0x15, "CCACHE_POST" },
395 static const struct nouveau_enum nvc0_fifo_fault_gpcclient[] = {
403 static const struct nouveau_bitfield nvc0_fifo_subfifo_intr[] = {
404 /* { 0x00008000, "" } seen with null ib push */
405 { 0x00200000, "ILLEGAL_MTHD" },
406 { 0x00800000, "EMPTY_SUBC" },
411 nvc0_fifo_isr_vm_fault(struct nvc0_fifo_priv *priv, int unit)
413 u32 inst = nv_rd32(priv, 0x002800 + (unit * 0x10));
414 u32 valo = nv_rd32(priv, 0x002804 + (unit * 0x10));
415 u32 vahi = nv_rd32(priv, 0x002808 + (unit * 0x10));
416 u32 stat = nv_rd32(priv, 0x00280c + (unit * 0x10));
417 u32 client = (stat & 0x00001f00) >> 8;
418 const struct nouveau_enum *en;
419 struct nouveau_engine *engine;
420 struct nouveau_object *engctx = NULL;
423 case 3: /* PEEPHOLE */
424 nv_mask(priv, 0x001718, 0x00000000, 0x00000000);
427 nv_mask(priv, 0x001704, 0x00000000, 0x00000000);
430 nv_mask(priv, 0x001714, 0x00000000, 0x00000000);
436 nv_error(priv, "%s fault at 0x%010llx [", (stat & 0x00000080) ?
437 "write" : "read", (u64)vahi << 32 | valo);
438 nouveau_enum_print(nvc0_fifo_fault_reason, stat & 0x0000000f);
440 en = nouveau_enum_print(nvc0_fifo_fault_unit, unit);
441 if (stat & 0x00000040) {
443 nouveau_enum_print(nvc0_fifo_fault_hubclient, client);
445 pr_cont("/GPC%d/", (stat & 0x1f000000) >> 24);
446 nouveau_enum_print(nvc0_fifo_fault_gpcclient, client);
449 if (en && en->data2) {
450 engine = nouveau_engine(priv, en->data2);
452 engctx = nouveau_engctx_get(engine, inst);
455 pr_cont(" on channel 0x%010llx [%s]\n", (u64)inst << 12,
456 nouveau_client_name(engctx));
458 nouveau_engctx_put(engctx);
462 nvc0_fifo_swmthd(struct nvc0_fifo_priv *priv, u32 chid, u32 mthd, u32 data)
464 struct nvc0_fifo_chan *chan = NULL;
465 struct nouveau_handle *bind;
469 spin_lock_irqsave(&priv->base.lock, flags);
470 if (likely(chid >= priv->base.min && chid <= priv->base.max))
471 chan = (void *)priv->base.channel[chid];
475 bind = nouveau_namedb_get_class(nv_namedb(chan), 0x906e);
477 if (!mthd || !nv_call(bind->object, mthd, data))
479 nouveau_namedb_put(bind);
483 spin_unlock_irqrestore(&priv->base.lock, flags);
488 nvc0_fifo_isr_subfifo_intr(struct nvc0_fifo_priv *priv, int unit)
490 u32 stat = nv_rd32(priv, 0x040108 + (unit * 0x2000));
491 u32 addr = nv_rd32(priv, 0x0400c0 + (unit * 0x2000));
492 u32 data = nv_rd32(priv, 0x0400c4 + (unit * 0x2000));
493 u32 chid = nv_rd32(priv, 0x040120 + (unit * 0x2000)) & 0x7f;
494 u32 subc = (addr & 0x00070000) >> 16;
495 u32 mthd = (addr & 0x00003ffc);
498 if (stat & 0x00200000) {
499 if (mthd == 0x0054) {
500 if (!nvc0_fifo_swmthd(priv, chid, 0x0500, 0x00000000))
505 if (stat & 0x00800000) {
506 if (!nvc0_fifo_swmthd(priv, chid, mthd, data))
511 nv_error(priv, "SUBFIFO%d:", unit);
512 nouveau_bitfield_print(nvc0_fifo_subfifo_intr, show);
515 "SUBFIFO%d: ch %d [%s] subc %d mthd 0x%04x data 0x%08x\n",
517 nouveau_client_name_for_fifo_chid(&priv->base, chid),
521 nv_wr32(priv, 0x0400c0 + (unit * 0x2000), 0x80600008);
522 nv_wr32(priv, 0x040108 + (unit * 0x2000), stat);
526 nvc0_fifo_intr(struct nouveau_subdev *subdev)
528 struct nvc0_fifo_priv *priv = (void *)subdev;
529 u32 mask = nv_rd32(priv, 0x002140);
530 u32 stat = nv_rd32(priv, 0x002100) & mask;
532 if (stat & 0x00000001) {
533 u32 intr = nv_rd32(priv, 0x00252c);
534 nv_warn(priv, "INTR 0x00000001: 0x%08x\n", intr);
535 nv_wr32(priv, 0x002100, 0x00000001);
539 if (stat & 0x00000100) {
540 u32 intr = nv_rd32(priv, 0x00254c);
541 nv_warn(priv, "INTR 0x00000100: 0x%08x\n", intr);
542 nv_wr32(priv, 0x002100, 0x00000100);
546 if (stat & 0x00010000) {
547 u32 intr = nv_rd32(priv, 0x00256c);
548 nv_warn(priv, "INTR 0x00010000: 0x%08x\n", intr);
549 nv_wr32(priv, 0x002100, 0x00010000);
553 if (stat & 0x01000000) {
554 u32 intr = nv_rd32(priv, 0x00258c);
555 nv_warn(priv, "INTR 0x01000000: 0x%08x\n", intr);
556 nv_wr32(priv, 0x002100, 0x01000000);
560 if (stat & 0x10000000) {
561 u32 units = nv_rd32(priv, 0x00259c);
566 nvc0_fifo_isr_vm_fault(priv, i);
570 nv_wr32(priv, 0x00259c, units);
574 if (stat & 0x20000000) {
575 u32 units = nv_rd32(priv, 0x0025a0);
580 nvc0_fifo_isr_subfifo_intr(priv, i);
584 nv_wr32(priv, 0x0025a0, units);
588 if (stat & 0x40000000) {
589 u32 intr0 = nv_rd32(priv, 0x0025a4);
590 u32 intr1 = nv_mask(priv, 0x002a00, 0x00000000, 0x00000);
591 nv_debug(priv, "INTR 0x40000000: 0x%08x 0x%08x\n",
596 if (stat & 0x80000000) {
597 u32 intr = nv_mask(priv, 0x0025a8, 0x00000000, 0x00000000);
598 nouveau_event_trigger(priv->base.uevent, 0);
599 nv_debug(priv, "INTR 0x80000000: 0x%08x\n", intr);
604 nv_fatal(priv, "unhandled status 0x%08x\n", stat);
605 nv_wr32(priv, 0x002100, stat);
606 nv_wr32(priv, 0x002140, 0);
611 nvc0_fifo_uevent_enable(struct nouveau_event *event, int index)
613 struct nvc0_fifo_priv *priv = event->priv;
614 nv_mask(priv, 0x002140, 0x80000000, 0x80000000);
618 nvc0_fifo_uevent_disable(struct nouveau_event *event, int index)
620 struct nvc0_fifo_priv *priv = event->priv;
621 nv_mask(priv, 0x002140, 0x80000000, 0x00000000);
625 nvc0_fifo_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
626 struct nouveau_oclass *oclass, void *data, u32 size,
627 struct nouveau_object **pobject)
629 struct nvc0_fifo_priv *priv;
632 ret = nouveau_fifo_create(parent, engine, oclass, 0, 127, &priv);
633 *pobject = nv_object(priv);
637 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 0x1000, 0,
642 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 0x1000, 0x1000, 0,
647 ret = nouveau_gpuobj_new(nv_object(priv), NULL, 128 * 0x1000, 0x1000, 0,
652 ret = nouveau_gpuobj_map(priv->user.mem, NV_MEM_ACCESS_RW,
657 priv->base.uevent->enable = nvc0_fifo_uevent_enable;
658 priv->base.uevent->disable = nvc0_fifo_uevent_disable;
659 priv->base.uevent->priv = priv;
661 nv_subdev(priv)->unit = 0x00000100;
662 nv_subdev(priv)->intr = nvc0_fifo_intr;
663 nv_engine(priv)->cclass = &nvc0_fifo_cclass;
664 nv_engine(priv)->sclass = nvc0_fifo_sclass;
669 nvc0_fifo_dtor(struct nouveau_object *object)
671 struct nvc0_fifo_priv *priv = (void *)object;
673 nouveau_gpuobj_unmap(&priv->user.bar);
674 nouveau_gpuobj_ref(NULL, &priv->user.mem);
675 nouveau_gpuobj_ref(NULL, &priv->playlist[1]);
676 nouveau_gpuobj_ref(NULL, &priv->playlist[0]);
678 nouveau_fifo_destroy(&priv->base);
682 nvc0_fifo_init(struct nouveau_object *object)
684 struct nvc0_fifo_priv *priv = (void *)object;
687 ret = nouveau_fifo_init(&priv->base);
691 nv_wr32(priv, 0x000204, 0xffffffff);
692 nv_wr32(priv, 0x002204, 0xffffffff);
694 priv->spoon_nr = hweight32(nv_rd32(priv, 0x002204));
695 nv_debug(priv, "%d subfifo(s)\n", priv->spoon_nr);
697 /* assign engines to subfifos */
698 if (priv->spoon_nr >= 3) {
699 nv_wr32(priv, 0x002208, ~(1 << 0)); /* PGRAPH */
700 nv_wr32(priv, 0x00220c, ~(1 << 1)); /* PVP */
701 nv_wr32(priv, 0x002210, ~(1 << 1)); /* PPP */
702 nv_wr32(priv, 0x002214, ~(1 << 1)); /* PBSP */
703 nv_wr32(priv, 0x002218, ~(1 << 2)); /* PCE0 */
704 nv_wr32(priv, 0x00221c, ~(1 << 1)); /* PCE1 */
708 for (i = 0; i < priv->spoon_nr; i++) {
709 nv_mask(priv, 0x04013c + (i * 0x2000), 0x10000100, 0x00000000);
710 nv_wr32(priv, 0x040108 + (i * 0x2000), 0xffffffff); /* INTR */
711 nv_wr32(priv, 0x04010c + (i * 0x2000), 0xfffffeff); /* INTREN */
714 nv_mask(priv, 0x002200, 0x00000001, 0x00000001);
715 nv_wr32(priv, 0x002254, 0x10000000 | priv->user.bar.offset >> 12);
717 nv_wr32(priv, 0x002a00, 0xffffffff); /* clears PFIFO.INTR bit 30 */
718 nv_wr32(priv, 0x002100, 0xffffffff);
719 nv_wr32(priv, 0x002140, 0x3fffffff);
720 nv_wr32(priv, 0x002628, 0x00000001); /* makes mthd 0x20 work */
724 struct nouveau_oclass
726 .handle = NV_ENGINE(FIFO, 0xc0),
727 .ofuncs = &(struct nouveau_ofuncs) {
728 .ctor = nvc0_fifo_ctor,
729 .dtor = nvc0_fifo_dtor,
730 .init = nvc0_fifo_init,
731 .fini = _nouveau_fifo_fini,