Commit f78313fa authored by Lijo Lazar's avatar Lijo Lazar Committed by Alex Deucher

drm/amdgpu: Check if FB BAR is enabled for ROM read

Some configurations don't have FB BAR enabled. Avoid reading ROM image
from FB BAR region in such cases.
Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a364782f
...@@ -97,6 +97,10 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev) ...@@ -97,6 +97,10 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
if (amdgpu_device_need_post(adev)) if (amdgpu_device_need_post(adev))
return false; return false;
/* FB BAR not enabled */
if (pci_resource_len(adev->pdev, 0) == 0)
return false;
adev->bios = NULL; adev->bios = NULL;
vram_base = pci_resource_start(adev->pdev, 0); vram_base = pci_resource_start(adev->pdev, 0);
bios = ioremap_wc(vram_base, size); bios = ioremap_wc(vram_base, size);
......
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