Commit 06a08570 authored by Matthew Garrett's avatar Matthew Garrett Committed by Bjorn Helgaas

radeon: Attempt to use platform-provided ROM image

Some platforms only provide their PCI ROM via a platform-specific interface.
Fall back to attempting that if all other sources fail.
Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 121cdf08
...@@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev) ...@@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev)
return true; return true;
} }
static bool radeon_read_platform_bios(struct radeon_device *rdev)
{
uint8_t __iomem *bios;
size_t size;
rdev->bios = NULL;
bios = pci_platform_rom(rdev->pdev, &size);
if (!bios) {
return false;
}
if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) {
return false;
}
rdev->bios = kmemdup(bios, size, GFP_KERNEL);
if (rdev->bios == NULL) {
return false;
}
return true;
}
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
/* ATRM is used to get the BIOS on the discrete cards in /* ATRM is used to get the BIOS on the discrete cards in
* dual-gpu systems. * dual-gpu systems.
...@@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev) ...@@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev)
if (r == false) { if (r == false) {
r = radeon_read_disabled_bios(rdev); r = radeon_read_disabled_bios(rdev);
} }
if (r == false) {
r = radeon_read_platform_bios(rdev);
}
if (r == false || rdev->bios == NULL) { if (r == false || rdev->bios == NULL) {
DRM_ERROR("Unable to locate a BIOS ROM\n"); DRM_ERROR("Unable to locate a BIOS ROM\n");
rdev->bios = NULL; rdev->bios = NULL;
......
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