soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / soc / intel / xeon_sp / iio_ioapic.c
blob456524a901d4c64af20fa9233dc71eb05b90cce6
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <arch/ioapic.h>
4 #include <device/pci_ids.h>
5 #include <device/pci_ops.h>
6 #include <intelblocks/acpi.h>
7 #include <soc/util.h>
8 #include <soc/pci_devs.h>
9 #include <stdint.h>
11 static uintptr_t xeonsp_ioapic_bases[CONFIG_MAX_SOCKET * MAX_IIO_STACK + 1];
13 size_t soc_get_ioapic_info(const uintptr_t *ioapic_bases[])
15 struct device *dev = NULL;
16 int index = 0;
18 *ioapic_bases = xeonsp_ioapic_bases;
21 * Stack 0 has non-PCH IOAPIC and PCH IOAPIC.
22 * The IIO IOAPIC is placed at 0x1000 from the reported base.
24 xeonsp_ioapic_bases[index++] = IO_APIC_ADDR;
26 while ((dev = dev_find_class(PCI_CLASS_SYSTEM_PIC << 8, dev))) {
27 if (!is_pci_ioapic(dev))
28 continue;
30 u16 abar = pci_read_config16(dev, APIC_ABAR);
31 if (!abar)
32 continue;
33 const u32 addr = IO_APIC_ADDR | ((abar & 0xfff) << 8);
35 printk(BIOS_DEBUG, "%s: %s: IOAPIC Address: 0x%x\n",
36 __func__, dev_path(dev), addr);
37 xeonsp_ioapic_bases[index++] = addr;
40 return index;