drm/nv50: fix a couple of vm init issues
Fixes overwriting the first page table entry when testing that the PRAMIN BAR can be correctly read/written, and adds an additional bar flush after poking the BAR3 control regs. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
fd70b6cd78
commit
c45aadabb9
|
@ -182,16 +182,17 @@ nv50_instmem_init(struct drm_device *dev)
|
||||||
nv_wr32(dev, 0x001704, 0x40000000 | (chan->ramin->vinst >> 12));
|
nv_wr32(dev, 0x001704, 0x40000000 | (chan->ramin->vinst >> 12));
|
||||||
nv_wr32(dev, 0x00170c, 0x80000000 | (priv->bar3_dmaobj->cinst >> 4));
|
nv_wr32(dev, 0x00170c, 0x80000000 | (priv->bar3_dmaobj->cinst >> 4));
|
||||||
|
|
||||||
tmp = nv_ri32(dev, 0);
|
dev_priv->engine.instmem.flush(dev);
|
||||||
nv_wi32(dev, 0, ~tmp);
|
dev_priv->ramin_available = true;
|
||||||
if (nv_ri32(dev, 0) != ~tmp) {
|
|
||||||
|
tmp = nv_ro32(chan->ramin, 0);
|
||||||
|
nv_wo32(chan->ramin, 0, ~tmp);
|
||||||
|
if (nv_ro32(chan->ramin, 0) != ~tmp) {
|
||||||
NV_ERROR(dev, "PRAMIN readback failed\n");
|
NV_ERROR(dev, "PRAMIN readback failed\n");
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
nv_wi32(dev, 0, tmp);
|
nv_wo32(chan->ramin, 0, tmp);
|
||||||
|
|
||||||
dev_priv->ramin_available = true;
|
|
||||||
|
|
||||||
/* BAR1 */
|
/* BAR1 */
|
||||||
ret = nouveau_vm_new(dev, BAR1_VM_BASE, BAR1_VM_SIZE, BAR1_VM_BASE,
|
ret = nouveau_vm_new(dev, BAR1_VM_BASE, BAR1_VM_SIZE, BAR1_VM_BASE,
|
||||||
|
|
Loading…
Reference in a new issue