]> www.infradead.org Git - linux.git/commitdiff
drm/amdgpu: Reorder to read EFI exported ROM first
authorLijo Lazar <lijo.lazar@amd.com>
Mon, 12 Aug 2024 03:32:57 +0000 (09:02 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Aug 2024 16:12:52 +0000 (12:12 -0400)
On EFI BIOSes, PCI ROM may be exported through EFI_PCI_IO_PROTOCOL and
expansion ROM BARs may not be enabled. Choose to read from EFI exported
ROM data before reading PCI Expansion ROM BAR.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c

index 618e469e36222be2af443951e95555d6e2dfb92f..42e64bce661e47ed85aa9341e5698592440724a3 100644 (file)
@@ -431,6 +431,11 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
                goto success;
        }
 
+       if (amdgpu_read_platform_bios(adev)) {
+               dev_info(adev->dev, "Fetched VBIOS from platform\n");
+               goto success;
+       }
+
        if (amdgpu_read_bios(adev)) {
                dev_info(adev->dev, "Fetched VBIOS from ROM BAR\n");
                goto success;
@@ -446,11 +451,6 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
                goto success;
        }
 
-       if (amdgpu_read_platform_bios(adev)) {
-               dev_info(adev->dev, "Fetched VBIOS from platform\n");
-               goto success;
-       }
-
        dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
        return false;