drm/radeon/kms: check for valid PCI bios and not OF rom
authorDave Airlie <airlied@redhat.com>
Thu, 11 Feb 2010 05:38:23 +0000 (15:38 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 11 Feb 2010 09:04:07 +0000 (19:04 +1000)
stops us trying to treat a OF rom as a PCI rom.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_bios.c

index 906921740c6034153cdbf5264acf9bf5664785e8..26856ed8d9727820c6ef42867c32bb682979e30f 100644 (file)
@@ -411,6 +411,12 @@ bool radeon_get_bios(struct radeon_device *rdev)
                goto free_bios;
        }
 
+       tmp = RBIOS16(0x18);
+       if (RBIOS8(tmp + 0x14) != 0x0) {
+               DRM_INFO("Not an x86 BIOS ROM, not using.\n");
+               goto free_bios;
+       }
+
        rdev->bios_header_start = RBIOS16(0x48);
        if (!rdev->bios_header_start) {
                goto free_bios;