mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
@ 2026-11-01 23:37 Arnaud BERTRAND
  2026-11-02 13:58 ` Alex Deucher
  0 siblings, 1 reply; 8+ messages in thread
From: Arnaud BERTRAND @ 2026-11-01 23:37 UTC (permalink / raw)
  To: Oz Tiram
  Cc: airlied, alexander.deucher, amd-gfx, christian.koenig, dri-devel,
	linux-kernel, simona

Hello,

I have two dGPUs : a Radeon RX 6800
XT and a Radeon RX 6800. They both report the same PCI identity
1002:73bf and each has a different VBIOS.
I hit the same VFCT bus-number mismatch on 7.2.10, but with a different
outcome: on my machine the device-identity fallback actively breaks the second
dGPU.
I patched my kernel to remove the fallback, but I would like to have a
better solution for my use case.
Would it be possible to apply the patch only to APUs ? That would keep
Oz's APU case working but a dGPU with a stale bus number would fall
through to its own ROM, which is the source that is
guaranteed to match the card in the slot.
I can provide more details if needed, I am out of my depth here.
Thanks
Arnaud

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
  2026-11-01 23:37 [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery Arnaud BERTRAND
@ 2026-11-02 13:58 ` Alex Deucher
  2026-11-03 20:59   ` Arnaud BERTRAND
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Deucher @ 2026-11-02 13:58 UTC (permalink / raw)
  To: Arnaud BERTRAND
  Cc: Oz Tiram, airlied, alexander.deucher, amd-gfx, christian.koenig,
	dri-devel, linux-kernel, simona

On Mon, Nov 2, 2026 at 3:07 AM Arnaud BERTRAND <arnaud078@gmail.com> wrote:
>
> Hello,
>
> I have two dGPUs : a Radeon RX 6800
> XT and a Radeon RX 6800. They both report the same PCI identity
> 1002:73bf and each has a different VBIOS.
> I hit the same VFCT bus-number mismatch on 7.2.10, but with a different
> outcome: on my machine the device-identity fallback actively breaks the second
> dGPU.
> I patched my kernel to remove the fallback, but I would like to have a
> better solution for my use case.
> Would it be possible to apply the patch only to APUs ? That would keep
> Oz's APU case working but a dGPU with a stale bus number would fall
> through to its own ROM, which is the source that is
> guaranteed to match the card in the slot.
> I can provide more details if needed, I am out of my depth here.

Should be fixed with this patch series:
https://patchwork.freedesktop.org/series/176969/

Alex

> Thanks
> Arnaud

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
  2026-11-02 13:58 ` Alex Deucher
@ 2026-11-03 20:59   ` Arnaud BERTRAND
  0 siblings, 0 replies; 8+ messages in thread
From: Arnaud BERTRAND @ 2026-11-03 20:59 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Oz Tiram, airlied, alexander.deucher, amd-gfx, christian.koenig,
	dri-devel, linux-kernel, simona

> On Mon. Nov  2. 2026 at 14:58, Alex Deucher <alexdeucher@gmail.com> wrote :
>
> >On Mon, Nov 2, 2026 at 3:07 AM Arnaud BERTRAND <arnaud078@gmail.com> wrote:
> >
> > Hello,
> >
> > I have two dGPUs : a Radeon RX 6800
> > XT and a Radeon RX 6800. They both report the same PCI identity
> > 1002:73bf and each has a different VBIOS.
> > I hit the same VFCT bus-number mismatch on 7.2.10, but with a different
> > outcome: on my machine the device-identity fallback actively breaks the second
> > dGPU.
> > I patched my kernel to remove the fallback, but I would like to have a
> > better solution for my use case.
> > Would it be possible to apply the patch only to APUs ? That would keep
> > Oz's APU case working but a dGPU with a stale bus number would fall
> > through to its own ROM, which is the source that is
> > guaranteed to match the card in the slot.
> > I can provide more details if needed, I am out of my depth here.
>
> Should be fixed with this patch series:
> https://patchwork.freedesktop.org/series/176969/
This patch series applied on top of kernel 7.3.0 indeed fixed the
issue for me. Thanks Alex and Mario for the swift answers.
>
> Alex
>
> > Thanks
> > Arnaud

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
  2026-06-26 17:42   ` Mario Limonciello
  2026-06-26 19:38     ` Alex Deucher
@ 2026-07-05 10:15     ` Oz Tiram
  1 sibling, 0 replies; 8+ messages in thread
From: Oz Tiram @ 2026-07-05 10:15 UTC (permalink / raw)
  To: Mario Limonciello, amd-gfx
  Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	open list:DRM DRIVERS, open list

Hi Mario,

Sorry for the slow response, I'm new to the kernel contribution process. 
Thanks for the review. v2 addresses your questions: -

The VFCT does contain the iGPU entry, but with a stale PCIBus value from 
BIOS POST time (0x6A). With pci=realloc,assign-busses the iGPU lands on 
bus 0x0B at runtime, so amdgpu_acpi_vfct_bios() never matches it

This is clarified in the commit message along with a note that the UEFI 
GOP driver initializes the iGPU successfully, confirming the hardware is 
functional.

The VBIOS image data in the VFCT is valid — only the PCIBus metadata is 
wrong.

The firmware file was extracted directly from the VFCT with dd, skipping 
past the ACPI header and VFCT_IMAGE_HEADER. The commit message now 
documents the exact command and byte offsets.

The patch follows.

Oz

On 6/26/26 19:42, Mario Limonciello wrote:
>
>
> On 6/21/26 13:01, Oz Tiram wrote:
>> APUs (e.g. AMD Radeon 780M / HawkPoint, PCI 1002:1900) have no
>> dedicated VBIOS ROM chip.  amdgpu_get_bios_apu() attempts four paths
>> before giving up:
>>
>>    1. ACPI VFCT table
>>    2. VRAM BAR read
>>    3. ROM BAR read
>>    4. platform BIOS
>>
>> On some systems all four fail:
>
> That's pretty odd to me.  Isn't this a BIOS bug?  Can you share more 
> about why all of these are failing?
>
> Does the UEFI GOP driver work?
>
>>
>>    - The VFCT table is absent or contains only the discrete GPU entry
>>      (e.g. when a custom ACPI override is present for the dGPU only).
>>    - The VRAM BAR is unmapped at probe time.
>>    - The ROM BAR is zero (PCI firmware did not assign it; observed even
>>      with pci=realloc,assign-busses).
>>    - No platform BIOS mapping exists.
>>
>> The driver then prints "Unable to locate a BIOS ROM" and refuses to
>> bind, leaving the APU completely unusable under Linux even though the
>> hardware is functional.
>>
>> Add a fifth fallback: request a firmware file named
>> "amdgpu/<vendor>_<device>.bin" (e.g. "amdgpu/1002_1900.bin") via
>> request_firmware().  This allows a VBIOS image extracted from the
>> running hardware 
>
> I thought you just said this didn't work.  How did you extract it?
>
>> to be shipped as a firmware blob in /lib/firmware/ and
>> makes the binding succeed without any change to the ACPI tables.
>>
>> The fallback is only reached if all existing paths have already failed,
>> so there is no regression risk for boards where VFCT or ROM BAR work.
>>
>> Signed-off-by: Oz Tiram <oz@shift-computing.de>
>> ---
>> v2: Validate the fetched firmware with check_atom_bios() before 
>> accepting
>>      it, consistent with all other VBIOS discovery paths. Save fw->size
>>      before release_firmware() so it remains valid for the size check.
>>      Release the buffer via amdgpu_bios_release() if validation fails.
>>
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 23 +++++++++++++++++++++++
>>   1 file changed, 23 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
>> index aa039e148a5e..86064c753b09 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
>> @@ -26,6 +26,7 @@
>>    *          Jerome Glisse
>>    */
>>   +#include <linux/firmware.h>
>>   #include "amdgpu.h"
>>   #include "atom.h"
>>   @@ -457,6 +458,28 @@ static bool amdgpu_get_bios_apu(struct 
>> amdgpu_device *adev)
>>           goto success;
>>       }
>>   +    {
>> +        const struct firmware *fw;
>> +        char fw_name[32];
>> +        size_t fw_size;
>> +
>> +        snprintf(fw_name, sizeof(fw_name), "amdgpu/%04x_%04x.bin",
>> +             adev->pdev->vendor, adev->pdev->device);
>> +        if (request_firmware(&fw, fw_name, adev->dev) == 0) {
>> +            adev->bios = kmemdup(fw->data, fw->size, GFP_KERNEL);
>> +            fw_size = fw->size;
>> +            release_firmware(fw);
>> +            if (!adev->bios || !check_atom_bios(adev, fw_size)) {
>> +                amdgpu_bios_release(adev);
>> +            } else {
>> +                adev->bios_size = fw_size;
>> +                dev_info(adev->dev, "Fetched VBIOS from firmware 
>> file %s\n",
>> +                     fw_name);
>> +                goto success;
>> +            }
>> +        }
>> +    }
>> +
>>       dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
>>       return false;
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
  2026-06-26 17:42   ` Mario Limonciello
@ 2026-06-26 19:38     ` Alex Deucher
  2026-07-05 10:15     ` Oz Tiram
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Deucher @ 2026-06-26 19:38 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Oz Tiram, amd-gfx, Alex Deucher, Christian König,
	David Airlie, Simona Vetter, open list:DRM DRIVERS, open list

On Fri, Jun 26, 2026 at 1:42 PM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
>
>
> On 6/21/26 13:01, Oz Tiram wrote:
> > APUs (e.g. AMD Radeon 780M / HawkPoint, PCI 1002:1900) have no
> > dedicated VBIOS ROM chip.  amdgpu_get_bios_apu() attempts four paths
> > before giving up:
> >
> >    1. ACPI VFCT table
> >    2. VRAM BAR read
> >    3. ROM BAR read
> >    4. platform BIOS
> >
> > On some systems all four fail:
>
> That's pretty odd to me.  Isn't this a BIOS bug?  Can you share more
> about why all of these are failing?
>
> Does the UEFI GOP driver work?
>
> >
> >    - The VFCT table is absent or contains only the discrete GPU entry
> >      (e.g. when a custom ACPI override is present for the dGPU only).
> >    - The VRAM BAR is unmapped at probe time.
> >    - The ROM BAR is zero (PCI firmware did not assign it; observed even
> >      with pci=realloc,assign-busses).
> >    - No platform BIOS mapping exists.
> >
> > The driver then prints "Unable to locate a BIOS ROM" and refuses to
> > bind, leaving the APU completely unusable under Linux even though the
> > hardware is functional.
> >
> > Add a fifth fallback: request a firmware file named
> > "amdgpu/<vendor>_<device>.bin" (e.g. "amdgpu/1002_1900.bin") via
> > request_firmware().  This allows a VBIOS image extracted from the
> > running hardware
>
> I thought you just said this didn't work.  How did you extract it?

This is not likely to work which is why we don't generally support
this.  On APUs, the base vbios image is updated by the sbios at boot
depending on the runtime configuration of the specific system (OEM
display configuration, etc.).  Overriding these values with something
else can cause serious problems.

Alex

>
> > to be shipped as a firmware blob in /lib/firmware/ and
> > makes the binding succeed without any change to the ACPI tables.
> >
> > The fallback is only reached if all existing paths have already failed,
> > so there is no regression risk for boards where VFCT or ROM BAR work.
> >
> > Signed-off-by: Oz Tiram <oz@shift-computing.de>
> > ---
> > v2: Validate the fetched firmware with check_atom_bios() before accepting
> >      it, consistent with all other VBIOS discovery paths.  Save fw->size
> >      before release_firmware() so it remains valid for the size check.
> >      Release the buffer via amdgpu_bios_release() if validation fails.
> >
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 23 +++++++++++++++++++++++
> >   1 file changed, 23 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> > index aa039e148a5e..86064c753b09 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> > @@ -26,6 +26,7 @@
> >    *          Jerome Glisse
> >    */
> >
> > +#include <linux/firmware.h>
> >   #include "amdgpu.h"
> >   #include "atom.h"
> >
> > @@ -457,6 +458,28 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
> >               goto success;
> >       }
> >
> > +     {
> > +             const struct firmware *fw;
> > +             char fw_name[32];
> > +             size_t fw_size;
> > +
> > +             snprintf(fw_name, sizeof(fw_name), "amdgpu/%04x_%04x.bin",
> > +                      adev->pdev->vendor, adev->pdev->device);
> > +             if (request_firmware(&fw, fw_name, adev->dev) == 0) {
> > +                     adev->bios = kmemdup(fw->data, fw->size, GFP_KERNEL);
> > +                     fw_size = fw->size;
> > +                     release_firmware(fw);
> > +                     if (!adev->bios || !check_atom_bios(adev, fw_size)) {
> > +                             amdgpu_bios_release(adev);
> > +                     } else {
> > +                             adev->bios_size = fw_size;
> > +                             dev_info(adev->dev, "Fetched VBIOS from firmware file %s\n",
> > +                                      fw_name);
> > +                             goto success;
> > +                     }
> > +             }
> > +     }
> > +
> >       dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
> >       return false;
> >
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
  2026-06-21 18:01 ` Oz Tiram
@ 2026-06-26 17:42   ` Mario Limonciello
  2026-06-26 19:38     ` Alex Deucher
  2026-07-05 10:15     ` Oz Tiram
  0 siblings, 2 replies; 8+ messages in thread
From: Mario Limonciello @ 2026-06-26 17:42 UTC (permalink / raw)
  To: Oz Tiram, amd-gfx
  Cc: Alex Deucher, Christian König, David Airlie, Simona Vetter,
	open list:DRM DRIVERS, open list



On 6/21/26 13:01, Oz Tiram wrote:
> APUs (e.g. AMD Radeon 780M / HawkPoint, PCI 1002:1900) have no
> dedicated VBIOS ROM chip.  amdgpu_get_bios_apu() attempts four paths
> before giving up:
> 
>    1. ACPI VFCT table
>    2. VRAM BAR read
>    3. ROM BAR read
>    4. platform BIOS
> 
> On some systems all four fail:

That's pretty odd to me.  Isn't this a BIOS bug?  Can you share more 
about why all of these are failing?

Does the UEFI GOP driver work?

> 
>    - The VFCT table is absent or contains only the discrete GPU entry
>      (e.g. when a custom ACPI override is present for the dGPU only).
>    - The VRAM BAR is unmapped at probe time.
>    - The ROM BAR is zero (PCI firmware did not assign it; observed even
>      with pci=realloc,assign-busses).
>    - No platform BIOS mapping exists.
> 
> The driver then prints "Unable to locate a BIOS ROM" and refuses to
> bind, leaving the APU completely unusable under Linux even though the
> hardware is functional.
> 
> Add a fifth fallback: request a firmware file named
> "amdgpu/<vendor>_<device>.bin" (e.g. "amdgpu/1002_1900.bin") via
> request_firmware().  This allows a VBIOS image extracted from the
> running hardware 

I thought you just said this didn't work.  How did you extract it?

> to be shipped as a firmware blob in /lib/firmware/ and
> makes the binding succeed without any change to the ACPI tables.
> 
> The fallback is only reached if all existing paths have already failed,
> so there is no regression risk for boards where VFCT or ROM BAR work.
> 
> Signed-off-by: Oz Tiram <oz@shift-computing.de>
> ---
> v2: Validate the fetched firmware with check_atom_bios() before accepting
>      it, consistent with all other VBIOS discovery paths.  Save fw->size
>      before release_firmware() so it remains valid for the size check.
>      Release the buffer via amdgpu_bios_release() if validation fails.
> 
>   drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> index aa039e148a5e..86064c753b09 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
> @@ -26,6 +26,7 @@
>    *          Jerome Glisse
>    */
>   
> +#include <linux/firmware.h>
>   #include "amdgpu.h"
>   #include "atom.h"
>   
> @@ -457,6 +458,28 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
>   		goto success;
>   	}
>   
> +	{
> +		const struct firmware *fw;
> +		char fw_name[32];
> +		size_t fw_size;
> +
> +		snprintf(fw_name, sizeof(fw_name), "amdgpu/%04x_%04x.bin",
> +			 adev->pdev->vendor, adev->pdev->device);
> +		if (request_firmware(&fw, fw_name, adev->dev) == 0) {
> +			adev->bios = kmemdup(fw->data, fw->size, GFP_KERNEL);
> +			fw_size = fw->size;
> +			release_firmware(fw);
> +			if (!adev->bios || !check_atom_bios(adev, fw_size)) {
> +				amdgpu_bios_release(adev);
> +			} else {
> +				adev->bios_size = fw_size;
> +				dev_info(adev->dev, "Fetched VBIOS from firmware file %s\n",
> +					 fw_name);
> +				goto success;
> +			}
> +		}
> +	}
> +
>   	dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
>   	return false;
>   


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
  2026-06-21 17:32 Oz Tiram
@ 2026-06-21 18:01 ` Oz Tiram
  2026-06-26 17:42   ` Mario Limonciello
  0 siblings, 1 reply; 8+ messages in thread
From: Oz Tiram @ 2026-06-21 18:01 UTC (permalink / raw)
  To: amd-gfx
  Cc: Oz Tiram, Alex Deucher, Christian König, David Airlie,
	Simona Vetter, open list:DRM DRIVERS, open list

APUs (e.g. AMD Radeon 780M / HawkPoint, PCI 1002:1900) have no
dedicated VBIOS ROM chip.  amdgpu_get_bios_apu() attempts four paths
before giving up:

  1. ACPI VFCT table
  2. VRAM BAR read
  3. ROM BAR read
  4. platform BIOS

On some systems all four fail:

  - The VFCT table is absent or contains only the discrete GPU entry
    (e.g. when a custom ACPI override is present for the dGPU only).
  - The VRAM BAR is unmapped at probe time.
  - The ROM BAR is zero (PCI firmware did not assign it; observed even
    with pci=realloc,assign-busses).
  - No platform BIOS mapping exists.

The driver then prints "Unable to locate a BIOS ROM" and refuses to
bind, leaving the APU completely unusable under Linux even though the
hardware is functional.

Add a fifth fallback: request a firmware file named
"amdgpu/<vendor>_<device>.bin" (e.g. "amdgpu/1002_1900.bin") via
request_firmware().  This allows a VBIOS image extracted from the
running hardware to be shipped as a firmware blob in /lib/firmware/ and
makes the binding succeed without any change to the ACPI tables.

The fallback is only reached if all existing paths have already failed,
so there is no regression risk for boards where VFCT or ROM BAR work.

Signed-off-by: Oz Tiram <oz@shift-computing.de>
---
v2: Validate the fetched firmware with check_atom_bios() before accepting
    it, consistent with all other VBIOS discovery paths.  Save fw->size
    before release_firmware() so it remains valid for the size check.
    Release the buffer via amdgpu_bios_release() if validation fails.

 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index aa039e148a5e..86064c753b09 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -26,6 +26,7 @@
  *          Jerome Glisse
  */
 
+#include <linux/firmware.h>
 #include "amdgpu.h"
 #include "atom.h"
 
@@ -457,6 +458,28 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
 		goto success;
 	}
 
+	{
+		const struct firmware *fw;
+		char fw_name[32];
+		size_t fw_size;
+
+		snprintf(fw_name, sizeof(fw_name), "amdgpu/%04x_%04x.bin",
+			 adev->pdev->vendor, adev->pdev->device);
+		if (request_firmware(&fw, fw_name, adev->dev) == 0) {
+			adev->bios = kmemdup(fw->data, fw->size, GFP_KERNEL);
+			fw_size = fw->size;
+			release_firmware(fw);
+			if (!adev->bios || !check_atom_bios(adev, fw_size)) {
+				amdgpu_bios_release(adev);
+			} else {
+				adev->bios_size = fw_size;
+				dev_info(adev->dev, "Fetched VBIOS from firmware file %s\n",
+					 fw_name);
+				goto success;
+			}
+		}
+	}
+
 	dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
 	return false;
 
-- 
2.53.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery
@ 2026-06-21 17:32 Oz Tiram
  2026-06-21 18:01 ` Oz Tiram
  0 siblings, 1 reply; 8+ messages in thread
From: Oz Tiram @ 2026-06-21 17:32 UTC (permalink / raw)
  To: amd-gfx
  Cc: Oz Tiram, Alex Deucher, Christian König, David Airlie,
	Simona Vetter, open list:DRM DRIVERS, open list

APUs (e.g. AMD Radeon 780M / HawkPoint, PCI 1002:1900) have no
dedicated VBIOS ROM chip.  amdgpu_get_bios_apu() attempts four paths
before giving up:

  1. ACPI VFCT table
  2. VRAM BAR read
  3. ROM BAR read
  4. platform BIOS

On some systems all four fail:

  - The VFCT table is absent or contains only the discrete GPU entry
    (e.g. when a custom ACPI override is present for the dGPU only).
  - The VRAM BAR is unmapped at probe time.
  - The ROM BAR is zero (PCI firmware did not assign it; observed even
    with pci=realloc,assign-busses).
  - No platform BIOS mapping exists.

The driver then prints "Unable to locate a BIOS ROM" and refuses to
bind, leaving the APU completely unusable under Linux even though the
hardware is functional.

Add a fifth fallback: request a firmware file named
"amdgpu/<vendor>_<device>.bin" (e.g. "amdgpu/1002_1900.bin") via
request_firmware().  This allows a VBIOS image extracted from the
running hardware to be shipped as a firmware blob in /lib/firmware/ and
makes the binding succeed without any change to the ACPI tables.

The fallback is only reached if all existing paths have already failed,
so there is no regression risk for boards where VFCT or ROM BAR work.

Signed-off-by: Oz Tiram <oz@shift-computing.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index aa039e148a5e..491f88f495a6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -26,6 +26,7 @@
  *          Jerome Glisse
  */
 
+#include <linux/firmware.h>
 #include "amdgpu.h"
 #include "atom.h"
 
@@ -457,6 +458,24 @@ static bool amdgpu_get_bios_apu(struct amdgpu_device *adev)
 		goto success;
 	}
 
+	{
+		const struct firmware *fw;
+		char fw_name[32];
+
+		snprintf(fw_name, sizeof(fw_name), "amdgpu/%04x_%04x.bin",
+			 adev->pdev->vendor, adev->pdev->device);
+		if (request_firmware(&fw, fw_name, adev->dev) == 0) {
+			adev->bios = kmemdup(fw->data, fw->size, GFP_KERNEL);
+			adev->bios_size = fw->size;
+			release_firmware(fw);
+			if (adev->bios) {
+				dev_info(adev->dev, "Fetched VBIOS from firmware file %s\n",
+					 fw_name);
+				goto success;
+			}
+		}
+	}
+
 	dev_err(adev->dev, "Unable to locate a BIOS ROM\n");
 	return false;
 
-- 
2.53.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-03 20:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-01 23:37 [PATCH] drm/amd/amdgpu: add firmware file fallback for APU VBIOS discovery Arnaud BERTRAND
2026-11-02 13:58 ` Alex Deucher
2026-11-03 20:59   ` Arnaud BERTRAND
  -- strict thread matches above, loose matches on Subject: below --
2026-06-21 17:32 Oz Tiram
2026-06-21 18:01 ` Oz Tiram
2026-06-26 17:42   ` Mario Limonciello
2026-06-26 19:38     ` Alex Deucher
2026-07-05 10:15     ` Oz Tiram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®