From 53d08b6ee292fdef0affe9232d05bd403539f4d8 Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Mon, 1 Mar 2021 14:42:57 -0700 Subject: [PATCH] sb/intel/common: Use new acpigen_write_PRT_*_entry functions Signed-off-by: Tim Wawrzynczak Change-Id: I9f573b9bd40260ab963c5a4a965a6ac483af91ec Reviewed-on: https://review.coreboot.org/c/coreboot/+/51158 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Furquan Shaikh --- src/southbridge/intel/common/acpi_pirq_gen.c | 17 +++++++---------- 1 file 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 +#include #include #include #include @@ -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(); } } }