Commit 60fb7064 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/bios/vmap: pointers are 32-bit

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 1957d3d5
...@@ -6,8 +6,8 @@ struct nvbios_vmap { ...@@ -6,8 +6,8 @@ struct nvbios_vmap {
u8 max2; u8 max2;
}; };
u16 nvbios_vmap_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u32 nvbios_vmap_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_vmap_parse(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u32 nvbios_vmap_parse(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_vmap *); struct nvbios_vmap *);
struct nvbios_vmap_entry { struct nvbios_vmap_entry {
...@@ -18,7 +18,7 @@ struct nvbios_vmap_entry { ...@@ -18,7 +18,7 @@ struct nvbios_vmap_entry {
s32 arg[6]; s32 arg[6];
}; };
u16 nvbios_vmap_entry(struct nvkm_bios *, int idx, u8 *ver, u8 *len); u32 nvbios_vmap_entry(struct nvkm_bios *, int idx, u8 *ver, u8 *len);
u16 nvbios_vmap_entry_parse(struct nvkm_bios *, int idx, u8 *ver, u8 *len, u32 nvbios_vmap_entry_parse(struct nvkm_bios *, int idx, u8 *ver, u8 *len,
struct nvbios_vmap_entry *); struct nvbios_vmap_entry *);
#endif #endif
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/vmap.h> #include <subdev/bios/vmap.h>
u16 u32
nvbios_vmap_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_vmap_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
u16 vmap = 0x0000; u32 vmap = 0;
if (!bit_entry(bios, 'P', &bit_P)) { if (!bit_entry(bios, 'P', &bit_P)) {
if (bit_P.version == 2) { if (bit_P.version == 2) {
vmap = nvbios_rd16(bios, bit_P.offset + 0x20); vmap = nvbios_rd32(bios, bit_P.offset + 0x20);
if (vmap) { if (vmap) {
*ver = nvbios_rd08(bios, vmap + 0); *ver = nvbios_rd08(bios, vmap + 0);
switch (*ver) { switch (*ver) {
...@@ -50,14 +50,14 @@ nvbios_vmap_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -50,14 +50,14 @@ nvbios_vmap_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
} }
return 0x0000; return 0;
} }
u16 u32
nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_vmap *info) struct nvbios_vmap *info)
{ {
u16 vmap = nvbios_vmap_table(bios, ver, hdr, cnt, len); u32 vmap = nvbios_vmap_table(bios, ver, hdr, cnt, len);
memset(info, 0x00, sizeof(*info)); memset(info, 0x00, sizeof(*info));
switch (!!vmap * *ver) { switch (!!vmap * *ver) {
case 0x10: case 0x10:
...@@ -77,23 +77,23 @@ nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, ...@@ -77,23 +77,23 @@ nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
return vmap; return vmap;
} }
u16 u32
nvbios_vmap_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len) nvbios_vmap_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 vmap = nvbios_vmap_table(bios, ver, &hdr, &cnt, len); u32 vmap = nvbios_vmap_table(bios, ver, &hdr, &cnt, len);
if (vmap && idx < cnt) { if (vmap && idx < cnt) {
vmap = vmap + hdr + (idx * *len); vmap = vmap + hdr + (idx * *len);
return vmap; return vmap;
} }
return 0x0000; return 0;
} }
u16 u32
nvbios_vmap_entry_parse(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len, nvbios_vmap_entry_parse(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len,
struct nvbios_vmap_entry *info) struct nvbios_vmap_entry *info)
{ {
u16 vmap = nvbios_vmap_entry(bios, idx, ver, len); u32 vmap = nvbios_vmap_entry(bios, idx, ver, len);
memset(info, 0x00, sizeof(*info)); memset(info, 0x00, sizeof(*info));
switch (!!vmap * *ver) { switch (!!vmap * *ver) {
case 0x10: case 0x10:
......
...@@ -84,7 +84,7 @@ nvkm_volt_map_min(struct nvkm_volt *volt, u8 id) ...@@ -84,7 +84,7 @@ nvkm_volt_map_min(struct nvkm_volt *volt, u8 id)
struct nvkm_bios *bios = volt->subdev.device->bios; struct nvkm_bios *bios = volt->subdev.device->bios;
struct nvbios_vmap_entry info; struct nvbios_vmap_entry info;
u8 ver, len; u8 ver, len;
u16 vmap; u32 vmap;
vmap = nvbios_vmap_entry_parse(bios, id, &ver, &len, &info); vmap = nvbios_vmap_entry_parse(bios, id, &ver, &len, &info);
if (vmap) { if (vmap) {
...@@ -106,7 +106,7 @@ nvkm_volt_map(struct nvkm_volt *volt, u8 id, u8 temp) ...@@ -106,7 +106,7 @@ nvkm_volt_map(struct nvkm_volt *volt, u8 id, u8 temp)
struct nvkm_bios *bios = volt->subdev.device->bios; struct nvkm_bios *bios = volt->subdev.device->bios;
struct nvbios_vmap_entry info; struct nvbios_vmap_entry info;
u8 ver, len; u8 ver, len;
u16 vmap; u32 vmap;
vmap = nvbios_vmap_entry_parse(bios, id, &ver, &len, &info); vmap = nvbios_vmap_entry_parse(bios, id, &ver, &len, &info);
if (vmap) { if (vmap) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment