summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2021-02-26 10:54:15 -0700
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-03-24 16:08:57 +0000
commit290979f96059e14f0656c5740d552be852e25b4e (patch)
tree05f6fefd0b27ac9368a98769db329078560561d5 /src/acpi
parent93a4e0135c41c1d90498a221b1e20e1b211376c1 (diff)
downloadcoreboot-290979f96059e14f0656c5740d552be852e25b4e.tar.xz
acpi: Add acpigen_write_PRT* helpers for generating _PRT entries
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: Ia666bd0e5db40d7873532dc22bc89be9854b903a Reviewed-on: https://review.coreboot.org/c/coreboot/+/51107 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpigen_pci.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/acpi/acpigen_pci.c b/src/acpi/acpigen_pci.c
index 66f8dcd1bd..3edf0d0342 100644
--- a/src/acpi/acpigen_pci.c
+++ b/src/acpi/acpigen_pci.c
@@ -24,3 +24,34 @@ void acpigen_write_ADR_pci_device(const struct device *dev)
assert(dev->path.type == DEVICE_PATH_PCI);
acpigen_write_ADR_pci_devfn(dev->path.pci.devfn);
}
+
+void acpigen_write_PRT_GSI_entry(unsigned int pci_dev, unsigned int acpi_pin, unsigned int gsi)
+{
+ acpigen_write_package(4);
+ acpigen_write_dword((pci_dev << 16) | 0xffff);
+ acpigen_write_byte(acpi_pin);
+
+ /* Source */
+ acpigen_write_byte(0);
+
+ /* Source Index */
+ acpigen_write_dword(gsi);
+
+ acpigen_pop_len(); /* Package */
+}
+
+void acpigen_write_PRT_source_entry(unsigned int pci_dev, unsigned int acpi_pin,
+ const char *source_path, unsigned int index)
+{
+ acpigen_write_package(4);
+ acpigen_write_dword((pci_dev << 16) | 0xffff);
+ acpigen_write_byte(acpi_pin);
+
+ /* Source */
+ acpigen_emit_namestring(source_path);
+
+ /* Source Index */
+ acpigen_write_dword(index);
+
+ acpigen_pop_len(); /* Package */
+}