summaryrefslogtreecommitdiff
path: root/nvkm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-09-22 10:51:37 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-12-02 15:37:18 +1000
commit9eb9890a7fa209781949bb13214a8451cff9e125 (patch)
tree3cf5ba949ed491e73dfec618b4048342b8dc17dd /nvkm
parent316f027c19599dc40ea68d327d193fca65c740d3 (diff)
downloadnouveau-9eb9890a7fa209781949bb13214a8451cff9e125.tar.gz
bios: use size/type from pci data structure
The field at +0x2 is technically processor specific, though I don't know that it's ever mattered in practice (yet). Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm')
-rw-r--r--nvkm/subdev/bios/image.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nvkm/subdev/bios/image.c b/nvkm/subdev/bios/image.c
index 4b2120b1f..64ed641b8 100644
--- a/nvkm/subdev/bios/image.c
+++ b/nvkm/subdev/bios/image.c
@@ -24,10 +24,14 @@
#include <subdev/bios.h>
#include <subdev/bios/image.h>
+#include <subdev/bios/pcir.h>
static bool
nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
{
+ struct nvbios_pcirT pcir;
+ u8 ver;
+ u16 hdr;
u32 data;
switch ((data = nv_ro16(bios, image->base + 0x00))) {
@@ -39,8 +43,10 @@ nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
return false;
}
- image->size = nv_ro08(bios, image->base + 0x02) * 512;
- image->type = 0x00;
+ if (!(data = nvbios_pcirTp(bios, image->base, &ver, &hdr, &pcir)))
+ return false;
+ image->size = pcir.image_size;
+ image->type = pcir.image_type;
image->last = true;
return true;
}