33 #define NV44_GART_SIZE (512 * 1024 * 1024)
34 #define NV44_GART_PAGE ( 4 * 1024)
44 u32 base = (pte << 2) & ~0x0000000f;
47 tmp[0] = nv_ro32(pgt, base + 0x0);
48 tmp[1] = nv_ro32(pgt, base + 0x4);
49 tmp[2] = nv_ro32(pgt, base + 0x8);
50 tmp[3] = nv_ro32(pgt, base + 0
xc);
53 u32 addr = list ? (*list++ >> 12) : (null >> 12);
54 switch (pte++ & 0x3) {
56 tmp[0] &= ~0x07ffffff;
60 tmp[0] &= ~0xf8000000;
62 tmp[1] &= ~0x003fffff;
66 tmp[1] &= ~0xffc00000;
68 tmp[2] &= ~0x0001ffff;
72 tmp[2] &= ~0xfffe0000;
74 tmp[3] &= ~0x00000fff;
80 nv_wo32(pgt, base + 0x0, tmp[0]);
81 nv_wo32(pgt, base + 0x4, tmp[1]);
82 nv_wo32(pgt, base + 0x8, tmp[2]);
83 nv_wo32(pgt, base + 0
xc, tmp[3] | 0x40000000);
97 nv44_vm_fill(pgt, priv->
null, list, pte, part);
104 for (
i = 0;
i < 4;
i++)
105 tmp[
i] = *list++ >> 12;
106 nv_wo32(pgt, pte++ * 4,
tmp[0] >> 0 |
tmp[1] << 27);
107 nv_wo32(pgt, pte++ * 4,
tmp[1] >> 5 |
tmp[2] << 22);
108 nv_wo32(pgt, pte++ * 4,
tmp[2] >> 10 |
tmp[3] << 17);
109 nv_wo32(pgt, pte++ * 4,
tmp[3] >> 15 | 0x40000000);
114 nv44_vm_fill(pgt, priv->
null, list, pte, cnt);
125 nv44_vm_fill(pgt, priv->
null,
NULL, pte, part);
131 nv_wo32(pgt, pte++ * 4, 0x00000000);
132 nv_wo32(pgt, pte++ * 4, 0x00000000);
133 nv_wo32(pgt, pte++ * 4, 0x00000000);
134 nv_wo32(pgt, pte++ * 4, 0x00000000);
139 nv44_vm_fill(pgt, priv->
null,
NULL, pte, cnt);
147 nv_wr32(priv, 0x100808, 0x00000020);
148 if (!
nv_wait(priv, 0x100808, 0x00000001, 0x00000001))
149 nv_error(priv,
"timeout: 0x%08x\n", nv_rd32(priv, 0x100808));
150 nv_wr32(priv, 0x100808, 0x00000000);
169 data, size, pobject);
174 *pobject = nv_object(priv);
180 priv->
base.dma_bits = 39;
181 priv->
base.pgt_bits = 32 - 12;
182 priv->
base.spg_shift = 12;
183 priv->
base.lpg_shift = 12;
184 priv->
base.map_sg = nv44_vm_map_sg;
185 priv->
base.unmap = nv44_vm_unmap;
186 priv->
base.flush = nv44_vm_flush;
190 nv_error(priv,
"unable to allocate dummy pages\n");
202 &priv->
vm->pgt[0].obj[0]);
203 priv->
vm->pgt[0].refcount[0] = 1;
226 addr = nv_rd32(priv, 0x10020c);
227 addr -= ((gart->
addr >> 19) + 1) << 19;
229 nv_wr32(priv, 0x100850, 0x80000000);
230 nv_wr32(priv, 0x100818, priv->
null);
232 nv_wr32(priv, 0x100850, 0x00008000);
233 nv_mask(priv, 0x10008c, 0x00000200, 0x00000200);
234 nv_wr32(priv, 0x100820, 0x00000000);
235 nv_wr32(priv, 0x10082c, 0x00000001);
236 nv_wr32(priv, 0x100800, addr | 0x00000010);
244 .ctor = nv44_vmmgr_ctor,
246 .init = nv44_vmmgr_init,