1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 #include <intelblocks/acpi.h>
5 #include <soc/chip_common.h>
9 static uintptr_t xeonsp_ioapic_bases
[CONFIG_MAX_SOCKET
* MAX_IIO_STACK
+ 1];
11 size_t soc_get_ioapic_info(const uintptr_t *ioapic_bases
[])
14 const IIO_UDS
*hob
= get_iio_uds();
16 *ioapic_bases
= xeonsp_ioapic_bases
;
18 for (int socket
= 0; socket
< CONFIG_MAX_SOCKET
; socket
++) {
19 if (!soc_cpu_is_enabled(socket
))
21 for (int stack
= 0; stack
< MAX_IIO_STACK
; ++stack
) {
23 &hob
->PlatformData
.IIO_resource
[socket
].StackRes
[stack
];
24 uint32_t ioapic_base
= ri
->IoApicBase
;
25 if (ioapic_base
== 0 || ioapic_base
== 0xFFFFFFFF)
27 xeonsp_ioapic_bases
[index
++] = ioapic_base
;
29 * Stack 0 has non-PCH IOAPIC and PCH IOAPIC.
30 * The IIO IOAPIC is placed at 0x1000 from the reported base.
32 if (socket
== 0 && stack
== 0) {
33 ioapic_base
+= 0x1000;
34 xeonsp_ioapic_bases
[index
++] = ioapic_base
;