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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel