summaryrefslogtreecommitdiff
path: root/src/soc/intel/xeon_sp
diff options
context:
space:
mode:
authorNaresh Solanki <Naresh.Solanki@9elements.com>2023-01-20 19:38:07 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-03-10 19:56:21 +0000
commit559f9ed58308bf777d72c98bc4d69cc620959ec6 (patch)
tree72aede6a1a75d57a466800c5076523306144a755 /src/soc/intel/xeon_sp
parent994ff52464d38275a6861454ba3f981fe75e6855 (diff)
xeon_sp: Setup x2apic in SRAT
Set up SRAT table in X2APIC mode when necessary. Change-Id: Ib8b4cebefe81f7b5514524dba2fa364eee4bb157 Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/73366 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel/xeon_sp')
-rw-r--r--src/soc/intel/xeon_sp/nb_acpi.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/soc/intel/xeon_sp/nb_acpi.c b/src/soc/intel/xeon_sp/nb_acpi.c
index 121c8a1cee..89deb88665 100644
--- a/src/soc/intel/xeon_sp/nb_acpi.c
+++ b/src/soc/intel/xeon_sp/nb_acpi.c
@@ -4,6 +4,7 @@
#include <arch/hpet.h>
#include <assert.h>
#include <cbmem.h>
+#include <cpu/x86/lapic.h>
#include <device/mmio.h>
#include <device/pci.h>
#include <soc/acpi.h>
@@ -26,10 +27,20 @@ unsigned long acpi_create_srat_lapics(unsigned long current)
for (cpu = all_devices; cpu; cpu = cpu->next) {
if (!is_enabled_cpu(cpu))
continue;
- printk(BIOS_DEBUG, "SRAT: lapic cpu_index=%02x, node_id=%02x, apic_id=%02x\n",
- cpu_index, cpu->path.apic.node_id, cpu->path.apic.apic_id);
- current += acpi_create_srat_lapic((acpi_srat_lapic_t *)current,
- cpu->path.apic.node_id, cpu->path.apic.apic_id);
+
+ if (is_x2apic_mode()) {
+ printk(BIOS_DEBUG, "SRAT: x2apic cpu_index=%08x, node_id=%02x, apic_id=%08x\n",
+ cpu_index, cpu->path.apic.node_id, cpu->path.apic.apic_id);
+
+ current += acpi_create_srat_x2apic((acpi_srat_x2apic_t *)current,
+ cpu->path.apic.node_id, cpu->path.apic.apic_id);
+ } else {
+ printk(BIOS_DEBUG, "SRAT: lapic cpu_index=%02x, node_id=%02x, apic_id=%02x\n",
+ cpu_index, cpu->path.apic.node_id, cpu->path.apic.apic_id);
+
+ current += acpi_create_srat_lapic((acpi_srat_lapic_t *)current,
+ cpu->path.apic.node_id, cpu->path.apic.apic_id);
+ }
cpu_index++;
}
return current;