Attention is currently required from: Lance Zhao, Patrick Rudolph. Wonkyu Kim has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51724 )
Change subject: src/*acpi: create acpi table for x2apic mode ......................................................................
src/*acpi: create acpi table for x2apic mode
Create acpi table for x2apic nmi, apicids
BUG=None BRANCH=None TEST=boot to OS and check apic mode cat /proc/cpuinfo | grep "apicid"
Signed-off-by: Wonkyu Kim wonkyu.kim@intel.com Change-Id: I9399d30b686b55d86806f5db4110bf4a80fe459b --- M src/acpi/acpi.c M src/soc/intel/common/block/acpi/acpi.c 2 files changed, 17 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/51724/1
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 867e163..21bbc78f 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -26,6 +26,7 @@ #include <types.h> #include <version.h> #include <commonlib/sort.h> +#include <cpu/x86/lapic.h>
static acpi_rsdp_t *valid_rsdp(acpi_rsdp_t *rsdp);
@@ -157,14 +158,20 @@ if (num_cpus > 1) bubblesort(apic_ids, num_cpus, NUM_ASCENDING); for (index = 0; index < num_cpus; index++) { - if (apic_ids[index] < 0xff) - current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, + if (is_x2apic_mode()) { + current += acpi_create_madt_lx2apic((acpi_madt_lx2apic_t *) + current, index, apic_ids[index]); + } else { + if (apic_ids[index] < 0xff) + current += acpi_create_madt_lapic( + (acpi_madt_lapic_t *)current, index, apic_ids[index]); - else - current += acpi_create_madt_lx2apic((acpi_madt_lx2apic_t *)current, + else + current += acpi_create_madt_lx2apic( + (acpi_madt_lx2apic_t *)current, index, apic_ids[index]); + } } - return current; }
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index cf62ccc..d7a0e8e 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -19,6 +19,7 @@ #include <soc/gpio.h> #include <soc/iomap.h> #include <soc/pm.h> +#include <cpu/x86/lapic.h>
#define CPUID_6_EAX_ISST (1 << 7)
@@ -80,6 +81,10 @@ /* NMI */ current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)current, 0xff, 5, 1);
+ if (is_x2apic_mode()) + current += acpi_create_madt_lx2apic_nmi((acpi_madt_lx2apic_nmi_t *)current, + 0xff, 0xd, 1); + return current; }