summaryrefslogtreecommitdiff
path: root/src/southbridge/intel/common
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2021-03-01 14:42:57 -0700
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-03-24 16:09:16 +0000
commit53d08b6ee292fdef0affe9232d05bd403539f4d8 (patch)
tree15913642b28078d4a2b6171eef0b227990836dd0 /src/southbridge/intel/common
parent290979f96059e14f0656c5740d552be852e25b4e (diff)
sb/intel/common: Use new acpigen_write_PRT_*_entry functions
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: I9f573b9bd40260ab963c5a4a965a6ac483af91ec Reviewed-on: https://review.coreboot.org/c/coreboot/+/51158 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/southbridge/intel/common')
-rw-r--r--src/southbridge/intel/common/acpi_pirq_gen.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/southbridge/intel/common/acpi_pirq_gen.c b/src/southbridge/intel/common/acpi_pirq_gen.c
index 73d101955b..18def9b4af 100644
--- a/src/southbridge/intel/common/acpi_pirq_gen.c
+++ b/src/southbridge/intel/common/acpi_pirq_gen.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpigen.h>
+#include <acpi/acpigen_pci.h>
#include <console/console.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
@@ -52,20 +53,16 @@ static void gen_pirq_route(const enum emit_type emit, const char *lpcb_path,
pirq = pci_int_mapping[pci_dev][int_pin];
if (pirq == PIRQ_NONE)
continue;
- acpigen_write_package(4);
- acpigen_write_dword((pci_dev << 16) | 0xffff);
- acpigen_write_byte(int_pin);
+
if (emit == EMIT_APIC) {
- acpigen_write_zero();
- acpigen_write_dword(16 + pirq - PIRQ_A);
+ const unsigned int gsi = 16 + pirq - PIRQ_A;
+ acpigen_write_PRT_GSI_entry(pci_dev, int_pin, gsi);
} else {
snprintf(buffer, sizeof(buffer),
- "%s.LNK%c",
- lpcb_path, 'A' + pirq - PIRQ_A);
- acpigen_emit_namestring(buffer);
- acpigen_write_dword(0);
+ "%s.LNK%c",
+ lpcb_path, 'A' + pirq - PIRQ_A);
+ acpigen_write_PRT_source_entry(pci_dev, int_pin, buffer, 0);
}
- acpigen_pop_len();
}
}
}