|
@@ -30,10 +30,11 @@ struct priv {
|
|
|
static u32
|
|
|
pramin_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
|
|
|
{
|
|
|
+ struct nvkm_device *device = bios->subdev.device;
|
|
|
u32 i;
|
|
|
if (offset + length <= 0x00100000) {
|
|
|
for (i = offset; i < offset + length; i += 4)
|
|
|
- *(u32 *)&bios->data[i] = nv_rd32(bios, 0x700000 + i);
|
|
|
+ *(u32 *)&bios->data[i] = nvkm_rd32(device, 0x700000 + i);
|
|
|
return length;
|
|
|
}
|
|
|
return 0;
|
|
@@ -44,7 +45,8 @@ pramin_fini(void *data)
|
|
|
{
|
|
|
struct priv *priv = data;
|
|
|
if (priv) {
|
|
|
- nv_wr32(priv->bios, 0x001700, priv->bar0);
|
|
|
+ struct nvkm_device *device = priv->bios->subdev.device;
|
|
|
+ nvkm_wr32(device, 0x001700, priv->bar0);
|
|
|
kfree(priv);
|
|
|
}
|
|
|
}
|
|
@@ -52,19 +54,20 @@ pramin_fini(void *data)
|
|
|
static void *
|
|
|
pramin_init(struct nvkm_bios *bios, const char *name)
|
|
|
{
|
|
|
+ struct nvkm_device *device = bios->subdev.device;
|
|
|
struct priv *priv = NULL;
|
|
|
u64 addr = 0;
|
|
|
|
|
|
/* PRAMIN always potentially available prior to nv50 */
|
|
|
- if (nv_device(bios)->card_type < NV_50)
|
|
|
+ if (device->card_type < NV_50)
|
|
|
return NULL;
|
|
|
|
|
|
/* we can't get the bios image pointer without PDISP */
|
|
|
- if (nv_device(bios)->card_type >= GM100)
|
|
|
- addr = nv_rd32(bios, 0x021c04);
|
|
|
+ if (device->card_type >= GM100)
|
|
|
+ addr = nvkm_rd32(device, 0x021c04);
|
|
|
else
|
|
|
- if (nv_device(bios)->card_type >= NV_C0)
|
|
|
- addr = nv_rd32(bios, 0x022500);
|
|
|
+ if (device->card_type >= NV_C0)
|
|
|
+ addr = nvkm_rd32(device, 0x022500);
|
|
|
if (addr & 0x00000001) {
|
|
|
nv_debug(bios, "... display disabled\n");
|
|
|
return ERR_PTR(-ENODEV);
|
|
@@ -74,7 +77,7 @@ pramin_init(struct nvkm_bios *bios, const char *name)
|
|
|
* important as we don't want to be touching vram on an
|
|
|
* uninitialised board
|
|
|
*/
|
|
|
- addr = nv_rd32(bios, 0x619f04);
|
|
|
+ addr = nvkm_rd32(device, 0x619f04);
|
|
|
if (!(addr & 0x00000008)) {
|
|
|
nv_debug(bios, "... not enabled\n");
|
|
|
return ERR_PTR(-ENODEV);
|
|
@@ -87,7 +90,7 @@ pramin_init(struct nvkm_bios *bios, const char *name)
|
|
|
/* some alternate method inherited from xf86-video-nv... */
|
|
|
addr = (addr & 0xffffff00) << 8;
|
|
|
if (!addr) {
|
|
|
- addr = (u64)nv_rd32(bios, 0x001700) << 16;
|
|
|
+ addr = (u64)nvkm_rd32(device, 0x001700) << 16;
|
|
|
addr += 0xf0000;
|
|
|
}
|
|
|
|
|
@@ -98,8 +101,8 @@ pramin_init(struct nvkm_bios *bios, const char *name)
|
|
|
}
|
|
|
|
|
|
priv->bios = bios;
|
|
|
- priv->bar0 = nv_rd32(bios, 0x001700);
|
|
|
- nv_wr32(bios, 0x001700, addr >> 16);
|
|
|
+ priv->bar0 = nvkm_rd32(device, 0x001700);
|
|
|
+ nvkm_wr32(device, 0x001700, addr >> 16);
|
|
|
return priv;
|
|
|
}
|
|
|
|