blob: be4e4834470a92232e8441156017c87b5db1e906 [file] [log] [blame]
Ben Skeggs4b223ee2010-08-03 10:00:56 +10001/*
2 * Copyright 2010 Red Hat Inc.
3 *
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:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
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.
21 *
22 * Authors: Ben Skeggs
23 */
24
25#include "drmP.h"
26
27#include "nouveau_drv.h"
Ben Skeggsb2b09932010-11-24 10:47:15 +100028#include "nouveau_mm.h"
29
30static void nvc0_fifo_isr(struct drm_device *);
31
32struct nvc0_fifo_priv {
33 struct nouveau_gpuobj *playlist[2];
34 int cur_playlist;
35 struct nouveau_vma user_vma;
Ben Skeggsec9c0882010-12-31 12:10:49 +100036 int spoon_nr;
Ben Skeggsb2b09932010-11-24 10:47:15 +100037};
38
39struct nvc0_fifo_chan {
40 struct nouveau_bo *user;
41 struct nouveau_gpuobj *ramfc;
42};
43
44static void
45nvc0_fifo_playlist_update(struct drm_device *dev)
46{
47 struct drm_nouveau_private *dev_priv = dev->dev_private;
48 struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem;
49 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
50 struct nvc0_fifo_priv *priv = pfifo->priv;
51 struct nouveau_gpuobj *cur;
52 int i, p;
53
54 cur = priv->playlist[priv->cur_playlist];
55 priv->cur_playlist = !priv->cur_playlist;
56
57 for (i = 0, p = 0; i < 128; i++) {
58 if (!(nv_rd32(dev, 0x3004 + (i * 8)) & 1))
59 continue;
60 nv_wo32(cur, p + 0, i);
61 nv_wo32(cur, p + 4, 0x00000004);
62 p += 8;
63 }
64 pinstmem->flush(dev);
65
66 nv_wr32(dev, 0x002270, cur->vinst >> 12);
67 nv_wr32(dev, 0x002274, 0x01f00000 | (p >> 3));
68 if (!nv_wait(dev, 0x00227c, 0x00100000, 0x00000000))
69 NV_ERROR(dev, "PFIFO - playlist update failed\n");
70}
Ben Skeggs4b223ee2010-08-03 10:00:56 +100071
72void
73nvc0_fifo_disable(struct drm_device *dev)
74{
75}
76
77void
78nvc0_fifo_enable(struct drm_device *dev)
79{
80}
81
82bool
83nvc0_fifo_reassign(struct drm_device *dev, bool enable)
84{
85 return false;
86}
87
88bool
Ben Skeggs4b223ee2010-08-03 10:00:56 +100089nvc0_fifo_cache_pull(struct drm_device *dev, bool enable)
90{
91 return false;
92}
93
94int
95nvc0_fifo_channel_id(struct drm_device *dev)
96{
97 return 127;
98}
99
100int
101nvc0_fifo_create_context(struct nouveau_channel *chan)
102{
Ben Skeggsb2b09932010-11-24 10:47:15 +1000103 struct drm_device *dev = chan->dev;
104 struct drm_nouveau_private *dev_priv = dev->dev_private;
105 struct nouveau_instmem_engine *pinstmem = &dev_priv->engine.instmem;
106 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
107 struct nvc0_fifo_priv *priv = pfifo->priv;
108 struct nvc0_fifo_chan *fifoch;
109 u64 ib_virt, user_vinst;
110 int ret;
111
112 chan->fifo_priv = kzalloc(sizeof(*fifoch), GFP_KERNEL);
113 if (!chan->fifo_priv)
114 return -ENOMEM;
115 fifoch = chan->fifo_priv;
116
117 /* allocate vram for control regs, map into polling area */
118 ret = nouveau_bo_new(dev, NULL, 0x1000, 0, TTM_PL_FLAG_VRAM,
Ben Skeggsd550c412011-02-16 08:41:56 +1000119 0, 0, &fifoch->user);
Ben Skeggsb2b09932010-11-24 10:47:15 +1000120 if (ret)
121 goto error;
122
123 ret = nouveau_bo_pin(fifoch->user, TTM_PL_FLAG_VRAM);
124 if (ret) {
125 nouveau_bo_ref(NULL, &fifoch->user);
126 goto error;
127 }
128
129 user_vinst = fifoch->user->bo.mem.start << PAGE_SHIFT;
130
131 ret = nouveau_bo_map(fifoch->user);
132 if (ret) {
133 nouveau_bo_unpin(fifoch->user);
134 nouveau_bo_ref(NULL, &fifoch->user);
135 goto error;
136 }
137
138 nouveau_vm_map_at(&priv->user_vma, chan->id * 0x1000,
139 fifoch->user->bo.mem.mm_node);
140
141 chan->user = ioremap_wc(pci_resource_start(dev->pdev, 1) +
142 priv->user_vma.offset + (chan->id * 0x1000),
143 PAGE_SIZE);
144 if (!chan->user) {
145 ret = -ENOMEM;
146 goto error;
147 }
148
149 ib_virt = chan->pushbuf_base + chan->dma.ib_base * 4;
150
151 /* zero channel regs */
152 nouveau_bo_wr32(fifoch->user, 0x0040/4, 0);
153 nouveau_bo_wr32(fifoch->user, 0x0044/4, 0);
154 nouveau_bo_wr32(fifoch->user, 0x0048/4, 0);
155 nouveau_bo_wr32(fifoch->user, 0x004c/4, 0);
156 nouveau_bo_wr32(fifoch->user, 0x0050/4, 0);
157 nouveau_bo_wr32(fifoch->user, 0x0058/4, 0);
158 nouveau_bo_wr32(fifoch->user, 0x005c/4, 0);
159 nouveau_bo_wr32(fifoch->user, 0x0060/4, 0);
160 nouveau_bo_wr32(fifoch->user, 0x0088/4, 0);
161 nouveau_bo_wr32(fifoch->user, 0x008c/4, 0);
162
163 /* ramfc */
164 ret = nouveau_gpuobj_new_fake(dev, chan->ramin->pinst,
165 chan->ramin->vinst, 0x100,
166 NVOBJ_FLAG_ZERO_ALLOC, &fifoch->ramfc);
167 if (ret)
168 goto error;
169
170 nv_wo32(fifoch->ramfc, 0x08, lower_32_bits(user_vinst));
171 nv_wo32(fifoch->ramfc, 0x0c, upper_32_bits(user_vinst));
172 nv_wo32(fifoch->ramfc, 0x10, 0x0000face);
173 nv_wo32(fifoch->ramfc, 0x30, 0xfffff902);
174 nv_wo32(fifoch->ramfc, 0x48, lower_32_bits(ib_virt));
175 nv_wo32(fifoch->ramfc, 0x4c, drm_order(chan->dma.ib_max + 1) << 16 |
176 upper_32_bits(ib_virt));
177 nv_wo32(fifoch->ramfc, 0x54, 0x00000002);
178 nv_wo32(fifoch->ramfc, 0x84, 0x20400000);
179 nv_wo32(fifoch->ramfc, 0x94, 0x30000001);
180 nv_wo32(fifoch->ramfc, 0x9c, 0x00000100);
181 nv_wo32(fifoch->ramfc, 0xa4, 0x1f1f1f1f);
182 nv_wo32(fifoch->ramfc, 0xa8, 0x1f1f1f1f);
183 nv_wo32(fifoch->ramfc, 0xac, 0x0000001f);
184 nv_wo32(fifoch->ramfc, 0xb8, 0xf8000000);
185 nv_wo32(fifoch->ramfc, 0xf8, 0x10003080); /* 0x002310 */
186 nv_wo32(fifoch->ramfc, 0xfc, 0x10000010); /* 0x002350 */
187 pinstmem->flush(dev);
188
189 nv_wr32(dev, 0x003000 + (chan->id * 8), 0xc0000000 |
190 (chan->ramin->vinst >> 12));
191 nv_wr32(dev, 0x003004 + (chan->id * 8), 0x001f0001);
192 nvc0_fifo_playlist_update(dev);
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000193 return 0;
Ben Skeggsb2b09932010-11-24 10:47:15 +1000194
195error:
196 pfifo->destroy_context(chan);
197 return ret;
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000198}
199
200void
201nvc0_fifo_destroy_context(struct nouveau_channel *chan)
202{
Ben Skeggsb2b09932010-11-24 10:47:15 +1000203 struct drm_device *dev = chan->dev;
204 struct nvc0_fifo_chan *fifoch;
205
206 nv_mask(dev, 0x003004 + (chan->id * 8), 0x00000001, 0x00000000);
207 nv_wr32(dev, 0x002634, chan->id);
208 if (!nv_wait(dev, 0x0002634, 0xffffffff, chan->id))
209 NV_WARN(dev, "0x2634 != chid: 0x%08x\n", nv_rd32(dev, 0x2634));
210
211 nvc0_fifo_playlist_update(dev);
212
213 nv_wr32(dev, 0x003000 + (chan->id * 8), 0x00000000);
214
215 if (chan->user) {
216 iounmap(chan->user);
217 chan->user = NULL;
218 }
219
220 fifoch = chan->fifo_priv;
221 chan->fifo_priv = NULL;
222 if (!fifoch)
223 return;
224
225 nouveau_gpuobj_ref(NULL, &fifoch->ramfc);
226 if (fifoch->user) {
227 nouveau_bo_unmap(fifoch->user);
228 nouveau_bo_unpin(fifoch->user);
229 nouveau_bo_ref(NULL, &fifoch->user);
230 }
231 kfree(fifoch);
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000232}
233
234int
235nvc0_fifo_load_context(struct nouveau_channel *chan)
236{
237 return 0;
238}
239
240int
241nvc0_fifo_unload_context(struct drm_device *dev)
242{
Ben Skeggs7a5c23d2011-04-12 18:51:39 +1000243 int i;
244
245 for (i = 0; i < 128; i++) {
246 if (!(nv_rd32(dev, 0x003004 + (i * 4)) & 1))
247 continue;
248
249 nv_mask(dev, 0x003004 + (i * 4), 0x00000001, 0x00000000);
250 nv_wr32(dev, 0x002634, i);
251 if (!nv_wait(dev, 0x002634, 0xffffffff, i)) {
252 NV_INFO(dev, "PFIFO: kick ch %d failed: 0x%08x\n",
253 i, nv_rd32(dev, 0x002634));
254 return -EBUSY;
255 }
256 }
257
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000258 return 0;
259}
260
Ben Skeggsb2b09932010-11-24 10:47:15 +1000261static void
262nvc0_fifo_destroy(struct drm_device *dev)
263{
264 struct drm_nouveau_private *dev_priv = dev->dev_private;
265 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
266 struct nvc0_fifo_priv *priv;
267
268 priv = pfifo->priv;
269 if (!priv)
270 return;
271
272 nouveau_vm_put(&priv->user_vma);
273 nouveau_gpuobj_ref(NULL, &priv->playlist[1]);
274 nouveau_gpuobj_ref(NULL, &priv->playlist[0]);
275 kfree(priv);
276}
277
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000278void
279nvc0_fifo_takedown(struct drm_device *dev)
280{
Ben Skeggsb2b09932010-11-24 10:47:15 +1000281 nv_wr32(dev, 0x002140, 0x00000000);
282 nvc0_fifo_destroy(dev);
283}
284
285static int
286nvc0_fifo_create(struct drm_device *dev)
287{
288 struct drm_nouveau_private *dev_priv = dev->dev_private;
289 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
290 struct nvc0_fifo_priv *priv;
291 int ret;
292
293 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
294 if (!priv)
295 return -ENOMEM;
296 pfifo->priv = priv;
297
298 ret = nouveau_gpuobj_new(dev, NULL, 0x1000, 0x1000, 0,
299 &priv->playlist[0]);
300 if (ret)
301 goto error;
302
303 ret = nouveau_gpuobj_new(dev, NULL, 0x1000, 0x1000, 0,
304 &priv->playlist[1]);
305 if (ret)
306 goto error;
307
308 ret = nouveau_vm_get(dev_priv->bar1_vm, pfifo->channels * 0x1000,
309 12, NV_MEM_ACCESS_RW, &priv->user_vma);
310 if (ret)
311 goto error;
312
313 nouveau_irq_register(dev, 8, nvc0_fifo_isr);
314 NVOBJ_CLASS(dev, 0x506e, SW); /* nvsw */
315 return 0;
316
317error:
318 nvc0_fifo_destroy(dev);
319 return ret;
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000320}
321
322int
323nvc0_fifo_init(struct drm_device *dev)
324{
Ben Skeggsb2b09932010-11-24 10:47:15 +1000325 struct drm_nouveau_private *dev_priv = dev->dev_private;
326 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
Ben Skeggs0638df42011-04-12 19:38:06 +1000327 struct nouveau_channel *chan;
Ben Skeggsb2b09932010-11-24 10:47:15 +1000328 struct nvc0_fifo_priv *priv;
329 int ret, i;
330
331 if (!pfifo->priv) {
332 ret = nvc0_fifo_create(dev);
333 if (ret)
334 return ret;
335 }
336 priv = pfifo->priv;
337
338 /* reset PFIFO, enable all available PSUBFIFO areas */
339 nv_mask(dev, 0x000200, 0x00000100, 0x00000000);
340 nv_mask(dev, 0x000200, 0x00000100, 0x00000100);
341 nv_wr32(dev, 0x000204, 0xffffffff);
342 nv_wr32(dev, 0x002204, 0xffffffff);
343
Ben Skeggsec9c0882010-12-31 12:10:49 +1000344 priv->spoon_nr = hweight32(nv_rd32(dev, 0x002204));
345 NV_DEBUG(dev, "PFIFO: %d subfifo(s)\n", priv->spoon_nr);
346
Ben Skeggsb2b09932010-11-24 10:47:15 +1000347 /* assign engines to subfifos */
Ben Skeggsec9c0882010-12-31 12:10:49 +1000348 if (priv->spoon_nr >= 3) {
349 nv_wr32(dev, 0x002208, ~(1 << 0)); /* PGRAPH */
350 nv_wr32(dev, 0x00220c, ~(1 << 1)); /* PVP */
351 nv_wr32(dev, 0x002210, ~(1 << 1)); /* PPP */
352 nv_wr32(dev, 0x002214, ~(1 << 1)); /* PBSP */
353 nv_wr32(dev, 0x002218, ~(1 << 2)); /* PCE0 */
354 nv_wr32(dev, 0x00221c, ~(1 << 1)); /* PCE1 */
355 }
Ben Skeggsb2b09932010-11-24 10:47:15 +1000356
357 /* PSUBFIFO[n] */
358 for (i = 0; i < 3; i++) {
359 nv_mask(dev, 0x04013c + (i * 0x2000), 0x10000100, 0x00000000);
360 nv_wr32(dev, 0x040108 + (i * 0x2000), 0xffffffff); /* INTR */
361 nv_wr32(dev, 0x04010c + (i * 0x2000), 0xfffffeff); /* INTR_EN */
362 }
363
364 nv_mask(dev, 0x002200, 0x00000001, 0x00000001);
365 nv_wr32(dev, 0x002254, 0x10000000 | priv->user_vma.offset >> 12);
366
367 nv_wr32(dev, 0x002a00, 0xffffffff); /* clears PFIFO.INTR bit 30 */
368 nv_wr32(dev, 0x002100, 0xffffffff);
369 nv_wr32(dev, 0x002140, 0xbfffffff);
Ben Skeggs0638df42011-04-12 19:38:06 +1000370
371 /* restore PFIFO context table */
372 for (i = 0; i < 128; i++) {
373 chan = dev_priv->channels.ptr[i];
374 if (!chan || !chan->fifo_priv)
375 continue;
376
377 nv_wr32(dev, 0x003000 + (i * 8), 0xc0000000 |
378 (chan->ramin->vinst >> 12));
379 nv_wr32(dev, 0x003004 + (i * 8), 0x001f0001);
380 }
381 nvc0_fifo_playlist_update(dev);
382
Ben Skeggs4b223ee2010-08-03 10:00:56 +1000383 return 0;
384}
385
Ben Skeggsb2b09932010-11-24 10:47:15 +1000386struct nouveau_enum nvc0_fifo_fault_unit[] = {
Ben Skeggs7a313472011-03-29 00:52:59 +1000387 { 0x00, "PGRAPH" },
388 { 0x03, "PEEPHOLE" },
389 { 0x04, "BAR1" },
390 { 0x05, "BAR3" },
391 { 0x07, "PFIFO" },
392 { 0x10, "PBSP" },
393 { 0x11, "PPPP" },
394 { 0x13, "PCOUNTER" },
395 { 0x14, "PVP" },
396 { 0x15, "PCOPY0" },
397 { 0x16, "PCOPY1" },
398 { 0x17, "PDAEMON" },
Ben Skeggsb2b09932010-11-24 10:47:15 +1000399 {}
400};
401
402struct nouveau_enum nvc0_fifo_fault_reason[] = {
Ben Skeggse2966632011-03-29 08:57:34 +1000403 { 0x00, "PT_NOT_PRESENT" },
404 { 0x01, "PT_TOO_SHORT" },
405 { 0x02, "PAGE_NOT_PRESENT" },
406 { 0x03, "VM_LIMIT_EXCEEDED" },
407 { 0x04, "NO_CHANNEL" },
408 { 0x05, "PAGE_SYSTEM_ONLY" },
409 { 0x06, "PAGE_READ_ONLY" },
410 { 0x0a, "COMPRESSED_SYSRAM" },
411 { 0x0c, "INVALID_STORAGE_TYPE" },
Ben Skeggsb2b09932010-11-24 10:47:15 +1000412 {}
413};
414
Ben Skeggs7795bee2011-03-29 09:28:24 +1000415struct nouveau_enum nvc0_fifo_fault_hubclient[] = {
416 { 0x01, "PCOPY0" },
417 { 0x02, "PCOPY1" },
418 { 0x04, "DISPATCH" },
419 { 0x05, "CTXCTL" },
420 { 0x06, "PFIFO" },
421 { 0x07, "BAR_READ" },
422 { 0x08, "BAR_WRITE" },
423 { 0x0b, "PVP" },
424 { 0x0c, "PPPP" },
425 { 0x0d, "PBSP" },
426 { 0x11, "PCOUNTER" },
427 { 0x12, "PDAEMON" },
428 { 0x14, "CCACHE" },
429 { 0x15, "CCACHE_POST" },
430 {}
431};
432
433struct nouveau_enum nvc0_fifo_fault_gpcclient[] = {
434 { 0x01, "TEX" },
435 { 0x0c, "ESETUP" },
436 { 0x0e, "CTXCTL" },
437 { 0x0f, "PROP" },
438 {}
439};
440
Ben Skeggsb2b09932010-11-24 10:47:15 +1000441struct nouveau_bitfield nvc0_fifo_subfifo_intr[] = {
442/* { 0x00008000, "" } seen with null ib push */
443 { 0x00200000, "ILLEGAL_MTHD" },
444 { 0x00800000, "EMPTY_SUBC" },
445 {}
446};
447
448static void
449nvc0_fifo_isr_vm_fault(struct drm_device *dev, int unit)
450{
451 u32 inst = nv_rd32(dev, 0x2800 + (unit * 0x10));
452 u32 valo = nv_rd32(dev, 0x2804 + (unit * 0x10));
453 u32 vahi = nv_rd32(dev, 0x2808 + (unit * 0x10));
454 u32 stat = nv_rd32(dev, 0x280c + (unit * 0x10));
Ben Skeggs7795bee2011-03-29 09:28:24 +1000455 u32 client = (stat & 0x00001f00) >> 8;
Ben Skeggsb2b09932010-11-24 10:47:15 +1000456
457 NV_INFO(dev, "PFIFO: %s fault at 0x%010llx [",
458 (stat & 0x00000080) ? "write" : "read", (u64)vahi << 32 | valo);
459 nouveau_enum_print(nvc0_fifo_fault_reason, stat & 0x0000000f);
460 printk("] from ");
461 nouveau_enum_print(nvc0_fifo_fault_unit, unit);
Ben Skeggs7795bee2011-03-29 09:28:24 +1000462 if (stat & 0x00000040) {
463 printk("/");
464 nouveau_enum_print(nvc0_fifo_fault_hubclient, client);
465 } else {
466 printk("/GPC%d/", (stat & 0x1f000000) >> 24);
467 nouveau_enum_print(nvc0_fifo_fault_gpcclient, client);
468 }
Ben Skeggsb2b09932010-11-24 10:47:15 +1000469 printk(" on channel 0x%010llx\n", (u64)inst << 12);
470}
471
472static void
473nvc0_fifo_isr_subfifo_intr(struct drm_device *dev, int unit)
474{
475 u32 stat = nv_rd32(dev, 0x040108 + (unit * 0x2000));
476 u32 addr = nv_rd32(dev, 0x0400c0 + (unit * 0x2000));
477 u32 data = nv_rd32(dev, 0x0400c4 + (unit * 0x2000));
478 u32 chid = nv_rd32(dev, 0x040120 + (unit * 0x2000)) & 0x7f;
479 u32 subc = (addr & 0x00070000);
480 u32 mthd = (addr & 0x00003ffc);
481
482 NV_INFO(dev, "PSUBFIFO %d:", unit);
483 nouveau_bitfield_print(nvc0_fifo_subfifo_intr, stat);
484 NV_INFO(dev, "PSUBFIFO %d: ch %d subc %d mthd 0x%04x data 0x%08x\n",
485 unit, chid, subc, mthd, data);
486
487 nv_wr32(dev, 0x0400c0 + (unit * 0x2000), 0x80600008);
488 nv_wr32(dev, 0x040108 + (unit * 0x2000), stat);
489}
490
491static void
492nvc0_fifo_isr(struct drm_device *dev)
493{
494 u32 stat = nv_rd32(dev, 0x002100);
495
Ben Skeggscc8cd642011-01-28 13:42:16 +1000496 if (stat & 0x00000100) {
497 NV_INFO(dev, "PFIFO: unknown status 0x00000100\n");
498 nv_wr32(dev, 0x002100, 0x00000100);
499 stat &= ~0x00000100;
500 }
501
Ben Skeggsb2b09932010-11-24 10:47:15 +1000502 if (stat & 0x10000000) {
503 u32 units = nv_rd32(dev, 0x00259c);
504 u32 u = units;
505
506 while (u) {
507 int i = ffs(u) - 1;
508 nvc0_fifo_isr_vm_fault(dev, i);
509 u &= ~(1 << i);
510 }
511
512 nv_wr32(dev, 0x00259c, units);
513 stat &= ~0x10000000;
514 }
515
516 if (stat & 0x20000000) {
517 u32 units = nv_rd32(dev, 0x0025a0);
518 u32 u = units;
519
520 while (u) {
521 int i = ffs(u) - 1;
522 nvc0_fifo_isr_subfifo_intr(dev, i);
523 u &= ~(1 << i);
524 }
525
526 nv_wr32(dev, 0x0025a0, units);
527 stat &= ~0x20000000;
528 }
529
Ben Skeggscc8cd642011-01-28 13:42:16 +1000530 if (stat & 0x40000000) {
531 NV_INFO(dev, "PFIFO: unknown status 0x40000000\n");
532 nv_mask(dev, 0x002a00, 0x00000000, 0x00000000);
533 stat &= ~0x40000000;
534 }
535
Ben Skeggsb2b09932010-11-24 10:47:15 +1000536 if (stat) {
537 NV_INFO(dev, "PFIFO: unhandled status 0x%08x\n", stat);
538 nv_wr32(dev, 0x002100, stat);
Ben Skeggscc8cd642011-01-28 13:42:16 +1000539 nv_wr32(dev, 0x002140, 0);
Ben Skeggsb2b09932010-11-24 10:47:15 +1000540 }
Ben Skeggsb2b09932010-11-24 10:47:15 +1000541}