From: Guy Raviv <guyraviv8@gmail.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: edk2-devel@lists.01.org
Subject: Re: Dynamic Pci configuration devices
Date: Wed, 9 May 2018 08:50:18 +0300 [thread overview]
Message-ID: <CALFDPeXeq9A1MCH3vJ0_R-82P3yLMU7yjzyf0WMyVZ55zuqqdA@mail.gmail.com> (raw)
In-Reply-To: <cd18b3d3-431f-70b9-0b3e-8f74a35b0644@redhat.com>
Thanks for the detailed answer.
if i choose the 2nd approach would it be possible to modify the structrue
itself of the pci tree,
and not only a specific device number?
example: if i add a pci bridge between my board and a graphic card.
Thanks,
On Tue, May 8, 2018 at 5:47 PM, Laszlo Ersek <lersek@redhat.com> wrote:
> On 05/08/18 16:16, Guy Raviv wrote:
> > Hi all,
> >
> > currently in
> >
> > \Vlv2DeviceRefCodePkg\AcpiTablesPCAT\HOST_BUS.ASL
> >
> > The PCI devices are declared statically.
> >
> > i want to make this declaration dynamic - so that the device number can
> change
> >
> > according according to my hardware setup. Is it possible?
>
> There are generally two ways for this.
>
> One is to write the bulk of the ASL like seen here, statically, but all
> the customizable values are referenced as external objects / fields.
> Then, a platform ACPI DXE driver in the firmware computes those values,
> and installs a small SSDT with just those objects. The AML is generated
> manually by the firmware, which is super awkward, but due to the small
> size of the integer objects etc, it is tolerable.
>
> A similar approach can be seen e.g. in "OvmfPkg/AcpiPlatformDxe/Qemu.c",
> function QemuInstallAcpiSsdtTable(). And the referring ASL code is in
> "OvmfPkg/AcpiTables/Dsdt.asl". (Search both for "FWDT".)
>
> (Note however that said function is not used nowadays on QEMU, because
> now QEMU generates *all* of the AML dynamically.)
>
> The other approach is to process the (static) AML before installing it
> with EFI_ACPI_TABLE_PROTOCOL.InstallAcpiTable(). If you know the exact
> path to / structure of the AML node that you want to modify, the
> EFI_ACPI_SDT_PROTOCOL lets you navigate to the node, and patch it
> in-place, in a memory array. Then you can install the modified table
> blob with EFI_ACPI_TABLE_PROTOCOL. (Important: do not modify a table
> *after* it is installed.)
>
> One example for the 2nd approach should be
> "QuarkPlatformPkg/Acpi/Dxe/AcpiPlatform/AcpiPciUpdate.c".
>
> Thanks
> Laszlo
>
next prev parent reply other threads:[~2018-05-09 5:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 14:16 Dynamic Pci configuration devices Guy Raviv
2018-05-08 14:47 ` Laszlo Ersek
2018-05-09 5:50 ` Guy Raviv [this message]
2018-05-09 11:39 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALFDPeXeq9A1MCH3vJ0_R-82P3yLMU7yjzyf0WMyVZ55zuqqdA@mail.gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox