@@ -447,6 +447,13 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
447
447
return true;
448
448
}
449
449
450
+ static bool amdgpu_prefer_rom_resource (struct amdgpu_device * adev )
451
+ {
452
+ struct resource * res = & adev -> pdev -> resource [PCI_ROM_RESOURCE ];
453
+
454
+ return (res -> flags & IORESOURCE_ROM_SHADOW );
455
+ }
456
+
450
457
static bool amdgpu_get_bios_dgpu (struct amdgpu_device * adev )
451
458
{
452
459
if (amdgpu_atrm_get_bios (adev )) {
@@ -465,14 +472,27 @@ static bool amdgpu_get_bios_dgpu(struct amdgpu_device *adev)
465
472
goto success ;
466
473
}
467
474
468
- if (amdgpu_read_platform_bios (adev )) {
469
- dev_info (adev -> dev , "Fetched VBIOS from platform\n" );
470
- goto success ;
471
- }
475
+ if (amdgpu_prefer_rom_resource (adev )) {
476
+ if (amdgpu_read_bios (adev )) {
477
+ dev_info (adev -> dev , "Fetched VBIOS from ROM BAR\n" );
478
+ goto success ;
479
+ }
472
480
473
- if (amdgpu_read_bios (adev )) {
474
- dev_info (adev -> dev , "Fetched VBIOS from ROM BAR\n" );
475
- goto success ;
481
+ if (amdgpu_read_platform_bios (adev )) {
482
+ dev_info (adev -> dev , "Fetched VBIOS from platform\n" );
483
+ goto success ;
484
+ }
485
+
486
+ } else {
487
+ if (amdgpu_read_platform_bios (adev )) {
488
+ dev_info (adev -> dev , "Fetched VBIOS from platform\n" );
489
+ goto success ;
490
+ }
491
+
492
+ if (amdgpu_read_bios (adev )) {
493
+ dev_info (adev -> dev , "Fetched VBIOS from ROM BAR\n" );
494
+ goto success ;
495
+ }
476
496
}
477
497
478
498
if (amdgpu_read_bios_from_rom (adev )) {
0 commit comments