Lines Matching +full:device +full:- +full:addr

39 	return (chan->cgrp->runl->doorbell << 16) | chan->id;  in ga100_chan_doorbell_handle()
45 struct nvkm_runl *runl = chan->cgrp->runl; in ga100_chan_stop()
47 nvkm_wr32(runl->fifo->engine.subdev.device, runl->chan + (chan->id * 4), 0x00000003); in ga100_chan_stop()
53 struct nvkm_runl *runl = chan->cgrp->runl; in ga100_chan_start()
54 struct nvkm_device *device = runl->fifo->engine.subdev.device; in ga100_chan_start() local
57 nvkm_wr32(device, runl->chan + (chan->id * 4), 0x00000002); in ga100_chan_start()
58 nvkm_wr32(device, runl->addr + 0x0090, (gfid << 16) | chan->id); /* INTERNAL_DOORBELL. */ in ga100_chan_start()
64 struct nvkm_runl *runl = chan->cgrp->runl; in ga100_chan_unbind()
66 nvkm_wr32(runl->fifo->engine.subdev.device, runl->chan + (chan->id * 4), 0xffffffff); in ga100_chan_unbind()
74 nvkm_kmap(chan->inst); in ga100_chan_ramfc_write()
75 nvkm_wo32(chan->inst, 0x010, 0x0000face); in ga100_chan_ramfc_write()
76 nvkm_wo32(chan->inst, 0x030, 0x7ffff902); in ga100_chan_ramfc_write()
77 nvkm_wo32(chan->inst, 0x048, lower_32_bits(offset)); in ga100_chan_ramfc_write()
78 nvkm_wo32(chan->inst, 0x04c, upper_32_bits(offset) | (limit2 << 16)); in ga100_chan_ramfc_write()
79 nvkm_wo32(chan->inst, 0x084, 0x20400000); in ga100_chan_ramfc_write()
80 nvkm_wo32(chan->inst, 0x094, 0x30000000 | devm); in ga100_chan_ramfc_write()
81 nvkm_wo32(chan->inst, 0x0e4, priv ? 0x00000020 : 0x00000000); in ga100_chan_ramfc_write()
82 nvkm_wo32(chan->inst, 0x0e8, chan->id); in ga100_chan_ramfc_write()
83 nvkm_wo32(chan->inst, 0x0f4, 0x00001000 | (priv ? 0x00000100 : 0x00000000)); in ga100_chan_ramfc_write()
84 nvkm_wo32(chan->inst, 0x0f8, 0x80000000 | chan->cgrp->runl->nonstall.vector); in ga100_chan_ramfc_write()
85 nvkm_mo32(chan->inst, 0x218, 0x00000000, 0x00000000); in ga100_chan_ramfc_write()
86 nvkm_done(chan->inst); in ga100_chan_ramfc_write()
112 struct nvkm_runl *runl = cgrp->runl; in ga100_cgrp_preempt()
114 nvkm_wr32(runl->fifo->engine.subdev.device, runl->addr + 0x098, 0x01000000 | cgrp->id); in ga100_cgrp_preempt()
125 struct nvkm_runl *runl = engn->runl; in ga100_engn_cxid()
126 struct nvkm_device *device = runl->fifo->engine.subdev.device; in ga100_engn_cxid() local
127 u32 stat = nvkm_rd32(device, runl->addr + 0x200 + engn->id * 0x40); in ga100_engn_cxid()
133 case 0 /* INVALID */: return -ENODEV; in ga100_engn_cxid()
138 if (nvkm_engine_chsw_load(engn->engine)) in ga100_engn_cxid()
146 return -ENODEV; in ga100_engn_cxid()
152 struct nvkm_engine *engine = engn->engine; in ga100_engn_nonstall()
154 if (WARN_ON(!engine->func->nonstall)) in ga100_engn_nonstall()
155 return -EINVAL; in ga100_engn_nonstall()
157 return engine->func->nonstall(engine); in ga100_engn_nonstall()
179 struct nvkm_device *device = runq->fifo->engine.subdev.device; in ga100_runq_idle() local
181 return !(nvkm_rd32(device, 0x04015c + (runq->id * 0x800)) & 0x0000e000); in ga100_runq_idle()
187 struct nvkm_device *device = runq->fifo->engine.subdev.device; in ga100_runq_intr_1() local
188 u32 inte = nvkm_rd32(device, 0x040180 + (runq->id * 0x800)); in ga100_runq_intr_1()
189 u32 intr = nvkm_rd32(device, 0x040148 + (runq->id * 0x800)); in ga100_runq_intr_1()
198 u32 chid = nvkm_rd32(device, 0x040120 + (runq->id * 0x0800)) & runl->chid->mask; in ga100_runq_intr_1()
209 nvkm_mask(device, 0x0400ac + (runq->id * 0x800), 0x00030000, 0x00030000); in ga100_runq_intr_1()
215 nvkm_wr32(device, 0x0401a0 + (runq->id * 0x800), stat); in ga100_runq_intr_1()
218 nvkm_wr32(device, 0x040148 + (runq->id * 0x800), intr); in ga100_runq_intr_1()
225 struct nvkm_device *device = runq->fifo->engine.subdev.device; in ga100_runq_intr_0() local
226 u32 inte = nvkm_rd32(device, 0x040170 + (runq->id * 0x800)); in ga100_runq_intr_0()
227 u32 intr = nvkm_rd32(device, 0x040108 + (runq->id * 0x800)); in ga100_runq_intr_0()
237 u32 chid = nvkm_rd32(device, 0x040120 + (runq->id * 0x0800)) & runl->chid->mask; in ga100_runq_intr_0()
253 nvkm_wr32(device, 0x040190 + (runq->id * 0x800), stat); in ga100_runq_intr_0()
256 nvkm_wr32(device, 0x040108 + (runq->id * 0x800), intr); in ga100_runq_intr_0()
272 struct nvkm_device *device = runq->fifo->engine.subdev.device; in ga100_runq_init() local
274 nvkm_wr32(device, 0x040108 + (runq->id * 0x800), 0xffffffff); /* INTR_0 */ in ga100_runq_init()
275 nvkm_wr32(device, 0x040148 + (runq->id * 0x800), 0xffffffff); /* INTR_1 */ in ga100_runq_init()
276 nvkm_wr32(device, 0x040170 + (runq->id * 0x800), 0xffffffff); /* INTR_0_EN_SET_TREE */ in ga100_runq_init()
277 nvkm_wr32(device, 0x040180 + (runq->id * 0x800), 0xffffffff); /* INTR_1_EN_SET_TREE */ in ga100_runq_init()
290 return nvkm_rd32(runl->fifo->engine.subdev.device, runl->addr + 0x098) & 0x00100000; in ga100_runl_preempt_pending()
296 nvkm_wr32(runl->fifo->engine.subdev.device, runl->addr + 0x098, 0x00000000); in ga100_runl_preempt()
302 nvkm_mask(runl->fifo->engine.subdev.device, runl->addr + 0x094, 0x00000001, 0x00000000); in ga100_runl_allow()
308 nvkm_mask(runl->fifo->engine.subdev.device, runl->addr + 0x094, 0x00000001, 0x00000001); in ga100_runl_block()
314 struct nvkm_device *device = runl->fifo->engine.subdev.device; in ga100_runl_pending() local
316 return nvkm_rd32(device, runl->addr + 0x08c) & 0x00008000; in ga100_runl_pending()
322 struct nvkm_device *device = runl->fifo->engine.subdev.device; in ga100_runl_commit() local
323 u64 addr = nvkm_memory_addr(memory) + start; in ga100_runl_commit() local
325 nvkm_wr32(device, runl->addr + 0x080, lower_32_bits(addr)); in ga100_runl_commit()
326 nvkm_wr32(device, runl->addr + 0x084, upper_32_bits(addr)); in ga100_runl_commit()
327 nvkm_wr32(device, runl->addr + 0x088, count); in ga100_runl_commit()
335 struct nvkm_device *device = runl->fifo->engine.subdev.device; in ga100_runl_intr() local
336 u32 inte = nvkm_rd32(device, runl->addr + 0x120); in ga100_runl_intr()
337 u32 intr = nvkm_rd32(device, runl->addr + 0x100); in ga100_runl_intr()
347 nvkm_runl_foreach_engn_cond(engn, runl, stat & BIT(engn->id)) { in ga100_runl_intr()
348 info = nvkm_rd32(device, runl->addr + 0x224 + (engn->id * 0x40)); in ga100_runl_intr()
352 nvkm_wr32(device, runl->addr + 0x100, BIT(engn->id)); in ga100_runl_intr()
353 stat &= ~BIT(engn->id); in ga100_runl_intr()
358 nvkm_wr32(device, runl->addr + 0x100, stat & 0x00000300); in ga100_runl_intr()
363 if (runl->runq[0]) { in ga100_runl_intr()
364 if (runl->runq[0]->func->intr(runl->runq[0], runl)) in ga100_runl_intr()
370 if (runl->runq[1]) { in ga100_runl_intr()
371 if (runl->runq[1]->func->intr(runl->runq[1], runl)) in ga100_runl_intr()
378 nvkm_wr32(device, runl->addr + 0x140, stat); in ga100_runl_intr()
381 nvkm_wr32(device, runl->addr + 0x180, 0x00000001); in ga100_runl_intr()
388 nvkm_mask(runl->fifo->engine.subdev.device, runl->addr + 0x300, 0x80000000, 0x00000000); in ga100_runl_fini()
389 nvkm_inth_block(&runl->inth); in ga100_runl_fini()
395 struct nvkm_fifo *fifo = runl->fifo; in ga100_runl_init()
397 struct nvkm_device *device = fifo->engine.subdev.device; in ga100_runl_init() local
401 nvkm_wr32(device, runl->addr + 0x088, 0x00000000); in ga100_runl_init()
402 runl->func->preempt(runl); in ga100_runl_init()
405 nvkm_mask(device, runl->addr + 0x300, 0x80000000, 0x80000000); in ga100_runl_init()
407 nvkm_wr32(device, runl->addr + 0x100, 0xffffffff); /* INTR_0 */ in ga100_runl_init()
408 nvkm_wr32(device, runl->addr + 0x140, 0xffffffff); /* INTR_0_EN_CLEAR_TREE(0) */ in ga100_runl_init()
409 nvkm_wr32(device, runl->addr + 0x120, 0x000f1307); /* INTR_0_EN_SET_TREE(0) */ in ga100_runl_init()
410 nvkm_wr32(device, runl->addr + 0x148, 0xffffffff); /* INTR_0_EN_CLEAR_TREE(1) */ in ga100_runl_init()
411 nvkm_wr32(device, runl->addr + 0x128, 0x00000000); /* INTR_0_EN_SET_TREE(1) */ in ga100_runl_init()
414 for (i = 0; i < runl->runq_nr; i++) { in ga100_runl_init()
415 runq = runl->runq[i]; in ga100_runl_init()
416 runq->func->init(runq); in ga100_runl_init()
419 nvkm_inth_allow(&runl->inth); in ga100_runl_init()
440 ga100_runl_new(struct nvkm_fifo *fifo, int id, u32 addr, struct nvkm_runl **prunl) in ga100_runl_new() argument
442 struct nvkm_device *device = fifo->engine.subdev.device; in ga100_runl_new() local
446 u32 chcfg = nvkm_rd32(device, addr + 0x004); in ga100_runl_new()
449 u32 dbcfg = nvkm_rd32(device, addr + 0x008); in ga100_runl_new()
450 u32 vector = nvkm_rd32(device, addr + 0x160); in ga100_runl_new()
453 runl = nvkm_runl_new(fifo, id, addr, chnum); in ga100_runl_new()
460 u32 pbcfg = nvkm_rd32(device, addr + 0x010 + (i * 0x04)); in ga100_runl_new()
462 runl->runq[runl->runq_nr] = in ga100_runl_new()
463 nvkm_runq_new(fifo, ((pbcfg & 0x03fffc00) - 0x040000) / 0x800); in ga100_runl_new()
464 if (!runl->runq[runl->runq_nr]) { in ga100_runl_new()
465 RUNL_ERROR(runl, "runq %d", runl->runq_nr); in ga100_runl_new()
466 return -ENOMEM; in ga100_runl_new()
469 runl->runq_nr++; in ga100_runl_new()
473 nvkm_list_foreach(tdev, &device->top->device, head, tdev->runlist == runl->addr) { in ga100_runl_new()
474 if (tdev->engine < 0) { in ga100_runl_new()
476 return -EINVAL; in ga100_runl_new()
479 engn = nvkm_runl_add(runl, tdev->engine, (tdev->type == NVKM_ENGINE_CE) ? in ga100_runl_new()
480 fifo->func->engn_ce : fifo->func->engn, in ga100_runl_new()
481 tdev->type, tdev->inst); in ga100_runl_new()
483 return -EINVAL; in ga100_runl_new()
485 if (!engn->engine->func->nonstall) { in ga100_runl_new()
486 RUNL_DEBUG(runl, "engn %s !nonstall", engn->engine->subdev.name); in ga100_runl_new()
487 return -EINVAL; in ga100_runl_new()
491 if (list_empty(&runl->engns)) { in ga100_runl_new()
493 return -EINVAL; in ga100_runl_new()
496 ret = nvkm_inth_add(&device->vfn->intr, vector & 0x00000fff, NVKM_INTR_PRIO_NORMAL, in ga100_runl_new()
497 &fifo->engine.subdev, ga100_runl_intr, &runl->inth); in ga100_runl_new()
503 runl->chan = chaddr; in ga100_runl_new()
504 runl->doorbell = dbcfg >> 16; in ga100_runl_new()
513 nvkm_event_ntfy(&runl->fifo->nonstall.event, runl->id, NVKM_FIFO_NONSTALL_EVENT); in ga100_fifo_nonstall_intr()
523 nvkm_inth_block(&runl->nonstall.inth); in ga100_fifo_nonstall_block()
532 nvkm_inth_allow(&runl->nonstall.inth); in ga100_fifo_nonstall_allow()
544 struct nvkm_subdev *subdev = &fifo->engine.subdev; in ga100_fifo_nonstall_ctor()
545 struct nvkm_vfn *vfn = subdev->device->vfn; in ga100_fifo_nonstall_ctor()
550 struct nvkm_engn *engn = list_first_entry(&runl->engns, typeof(*engn), head); in ga100_fifo_nonstall_ctor()
552 runl->nonstall.vector = engn->func->nonstall(engn); in ga100_fifo_nonstall_ctor()
555 if (runl->nonstall.vector == -1) in ga100_fifo_nonstall_ctor()
557 if (runl->nonstall.vector < 0) { in ga100_fifo_nonstall_ctor()
558 RUNL_ERROR(runl, "nonstall %d", runl->nonstall.vector); in ga100_fifo_nonstall_ctor()
559 return runl->nonstall.vector; in ga100_fifo_nonstall_ctor()
562 ret = nvkm_inth_add(&vfn->intr, runl->nonstall.vector, NVKM_INTR_PRIO_NORMAL, in ga100_fifo_nonstall_ctor()
563 subdev, ga100_fifo_nonstall_intr, &runl->nonstall.inth); in ga100_fifo_nonstall_ctor()
567 nr = max(nr, runl->id + 1); in ga100_fifo_nonstall_ctor()
576 struct nvkm_device *device = fifo->engine.subdev.device; in ga100_fifo_runl_ctor() local
581 nvkm_list_foreach(tdev, &device->top->device, head, tdev->runlist >= 0) { in ga100_fifo_runl_ctor()
582 runl = nvkm_runl_get(fifo, -1, tdev->runlist); in ga100_fifo_runl_ctor()
584 ret = ga100_runl_new(fifo, id++, tdev->runlist, &runl); in ga100_fifo_runl_ctor()
612 ga100_fifo_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, in ga100_fifo_new() argument
615 if (nvkm_gsp_rm(device->gsp)) in ga100_fifo_new()
616 return r535_fifo_new(&ga100_fifo, device, type, inst, pfifo); in ga100_fifo_new()
618 return nvkm_fifo_new_(&ga100_fifo, device, type, inst, pfifo); in ga100_fifo_new()