summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
index cd0b06fbc3c2..be116f35c4bc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c
@@ -25,10 +25,11 @@
static u32
prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{
+ struct nvkm_device *device = data;
u32 i;
if (offset + length <= 0x00100000) {
for (i = offset; i < offset + length; i += 4)
- *(u32 *)&bios->data[i] = nv_rd32(bios, 0x300000 + i);
+ *(u32 *)&bios->data[i] = nvkm_rd32(device, 0x300000 + i);
return length;
}
return 0;
@@ -37,25 +38,25 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
static void
prom_fini(void *data)
{
- struct nvkm_bios *bios = data;
- if (nv_device(bios)->card_type < NV_50)
- nv_mask(bios, 0x001850, 0x00000001, 0x00000001);
+ struct nvkm_device *device = data;
+ if (device->card_type < NV_50)
+ nvkm_mask(device, 0x001850, 0x00000001, 0x00000001);
else
- nv_mask(bios, 0x088050, 0x00000001, 0x00000001);
+ nvkm_mask(device, 0x088050, 0x00000001, 0x00000001);
}
static void *
prom_init(struct nvkm_bios *bios, const char *name)
{
- if (nv_device(bios)->card_type < NV_50) {
- if (nv_device(bios)->card_type == NV_40 &&
- nv_device(bios)->chipset >= 0x4c)
+ struct nvkm_device *device = bios->subdev.device;
+ if (device->card_type < NV_50) {
+ if (device->card_type == NV_40 && device->chipset >= 0x4c)
return ERR_PTR(-ENODEV);
- nv_mask(bios, 0x001850, 0x00000001, 0x00000000);
+ nvkm_mask(device, 0x001850, 0x00000001, 0x00000000);
} else {
- nv_mask(bios, 0x088050, 0x00000001, 0x00000000);
+ nvkm_mask(device, 0x088050, 0x00000001, 0x00000000);
}
- return bios;
+ return device;
}
const struct nvbios_source
OpenPOWER on IntegriCloud