Lines Matching refs:memx
18 memx_out(struct nvkm_memx *memx) in memx_out() argument
20 struct nvkm_device *device = memx->pmu->subdev.device; in memx_out()
23 if (memx->c.mthd) { in memx_out()
24 nvkm_wr32(device, 0x10a1c4, (memx->c.size << 16) | memx->c.mthd); in memx_out()
25 for (i = 0; i < memx->c.size; i++) in memx_out()
26 nvkm_wr32(device, 0x10a1c4, memx->c.data[i]); in memx_out()
27 memx->c.mthd = 0; in memx_out()
28 memx->c.size = 0; in memx_out()
33 memx_cmd(struct nvkm_memx *memx, u32 mthd, u32 size, u32 data[]) in memx_cmd() argument
35 if ((memx->c.size + size >= ARRAY_SIZE(memx->c.data)) || in memx_cmd()
36 (memx->c.mthd && memx->c.mthd != mthd)) in memx_cmd()
37 memx_out(memx); in memx_cmd()
38 memcpy(&memx->c.data[memx->c.size], data, size * sizeof(data[0])); in memx_cmd()
39 memx->c.size += size; in memx_cmd()
40 memx->c.mthd = mthd; in memx_cmd()
47 struct nvkm_memx *memx; in nvkm_memx_init() local
56 memx = *pmemx = kzalloc(sizeof(*memx), GFP_KERNEL); in nvkm_memx_init()
57 if (!memx) in nvkm_memx_init()
59 memx->pmu = pmu; in nvkm_memx_init()
60 memx->base = reply[0]; in nvkm_memx_init()
61 memx->size = reply[1]; in nvkm_memx_init()
67 nvkm_wr32(device, 0x10a1c0, 0x01000000 | memx->base); in nvkm_memx_init()
74 struct nvkm_memx *memx = *pmemx; in nvkm_memx_fini() local
75 struct nvkm_pmu *pmu = memx->pmu; in nvkm_memx_fini()
81 memx_out(memx); in nvkm_memx_fini()
90 memx->base, finish); in nvkm_memx_fini()
95 kfree(memx); in nvkm_memx_fini()
100 nvkm_memx_wr32(struct nvkm_memx *memx, u32 addr, u32 data) in nvkm_memx_wr32() argument
102 nvkm_debug(&memx->pmu->subdev, "R[%06x] = %08x\n", addr, data); in nvkm_memx_wr32()
103 memx_cmd(memx, MEMX_WR32, 2, (u32[]){ addr, data }); in nvkm_memx_wr32()
107 nvkm_memx_wait(struct nvkm_memx *memx, in nvkm_memx_wait() argument
110 nvkm_debug(&memx->pmu->subdev, "R[%06x] & %08x == %08x, %d us\n", in nvkm_memx_wait()
112 memx_cmd(memx, MEMX_WAIT, 4, (u32[]){ addr, mask, data, nsec }); in nvkm_memx_wait()
113 memx_out(memx); /* fuc can't handle multiple */ in nvkm_memx_wait()
117 nvkm_memx_nsec(struct nvkm_memx *memx, u32 nsec) in nvkm_memx_nsec() argument
119 nvkm_debug(&memx->pmu->subdev, " DELAY = %d ns\n", nsec); in nvkm_memx_nsec()
120 memx_cmd(memx, MEMX_DELAY, 1, (u32[]){ nsec }); in nvkm_memx_nsec()
121 memx_out(memx); /* fuc can't handle multiple */ in nvkm_memx_nsec()
125 nvkm_memx_wait_vblank(struct nvkm_memx *memx) in nvkm_memx_wait_vblank() argument
127 struct nvkm_subdev *subdev = &memx->pmu->subdev; in nvkm_memx_wait_vblank()
154 memx_cmd(memx, MEMX_VBLANK, 1, (u32[]){ head_sync }); in nvkm_memx_wait_vblank()
155 memx_out(memx); /* fuc can't handle multiple */ in nvkm_memx_wait_vblank()
159 nvkm_memx_train(struct nvkm_memx *memx) in nvkm_memx_train() argument
161 nvkm_debug(&memx->pmu->subdev, " MEM TRAIN\n"); in nvkm_memx_train()
162 memx_cmd(memx, MEMX_TRAIN, 0, NULL); in nvkm_memx_train()
192 nvkm_memx_block(struct nvkm_memx *memx) in nvkm_memx_block() argument
194 nvkm_debug(&memx->pmu->subdev, " HOST BLOCKED\n"); in nvkm_memx_block()
195 memx_cmd(memx, MEMX_ENTER, 0, NULL); in nvkm_memx_block()
199 nvkm_memx_unblock(struct nvkm_memx *memx) in nvkm_memx_unblock() argument
201 nvkm_debug(&memx->pmu->subdev, " HOST UNBLOCKED\n"); in nvkm_memx_unblock()
202 memx_cmd(memx, MEMX_LEAVE, 0, NULL); in nvkm_memx_unblock()