From e33d253793f6fe553f0deaad5eb30c7095fe4203 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 26 Jun 2023 22:58:59 +0200 Subject: [PATCH] soc/amd/common/block/acpi/ivrs: fix missing IOAPIC[1] error When probing the resource with the IOMMU_IOAPIC_IDX index, we need to use the PCI device 0 function 0 on the first bus in the domain for probing and not the domain device, since the resource isn't on the domain device, but on the northbridge device which is B0F0D0 in the case of the APUs. TEST=This fixes the following error on Mandolin with Picasso: AMD-Vi: [Firmware Bug]: : IOAPIC[1] not in IVRS table AMD-Vi: Disabling interrupt remapping Signed-off-by: Felix Held Change-Id: Id88f17d68ba5accef6561837478828bd3d24baa5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76117 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) Reviewed-by: Fred Reitberger --- src/soc/amd/common/block/acpi/ivrs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/soc/amd/common/block/acpi/ivrs.c b/src/soc/amd/common/block/acpi/ivrs.c index ca58c35d8e..ae39775482 100644 --- a/src/soc/amd/common/block/acpi/ivrs.c +++ b/src/soc/amd/common/block/acpi/ivrs.c @@ -181,7 +181,8 @@ static unsigned long acpi_ivhd_misc(unsigned long current, struct device *dev) add_ivhd_device_entries(NULL, dev, 0, -1, &root_level, ¤t, dev->link_list->secondary); - res = probe_resource(dev, IOMMU_IOAPIC_IDX); + res = probe_resource(pcidev_path_behind(dev->link_list, PCI_DEVFN(0, 0)), + IOMMU_IOAPIC_IDX); if (res) { /* Describe IOAPIC associated with the IOMMU */ current = acpi_fill_ivrs_ioapic(current, (u8 *)(uintptr_t)res->base,