diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2020-03-24 17:29:49 +0100 |
---|---|---|
committer | Matt DeVillier <matt.devillier@gmail.com> | 2020-04-13 23:32:27 +0000 |
commit | 56a3ef2e7419150e468198ac6c6ae2ebdd9e0afd (patch) | |
tree | 5a35e2a1aaccba906509ae017040d53babf490ca /src/arch/x86/acpi.c | |
parent | c02bda0f066927744c5d75de14e4c1cf73ce39c9 (diff) |
acpi: Bump MADT to revision 3
Add structs and methods for revision 3.
Change-Id: Ida75f530551ad2b8b20ce7fdeffb3befc51296bc
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39806
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Diffstat (limited to 'src/arch/x86/acpi.c')
-rw-r--r-- | src/arch/x86/acpi.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index a5c5c49473..4ff1ad55e1 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -127,6 +127,18 @@ int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic) return lapic->length; } +int acpi_create_madt_lx2apic(acpi_madt_lx2apic_t *lapic, u32 cpu, u32 apic) +{ + lapic->type = LOCAL_X2APIC; /* Local APIC structure */ + lapic->reserved = 0; + lapic->length = sizeof(acpi_madt_lx2apic_t); + lapic->flags = (1 << 0); /* Processor/LAPIC enabled */ + lapic->processor_id = cpu; + lapic->x2apic_id = apic; + + return lapic->length; +} + unsigned long acpi_create_madt_lapics(unsigned long current) { struct device *cpu; @@ -146,8 +158,12 @@ unsigned long acpi_create_madt_lapics(unsigned long current) if (num_cpus > 1) bubblesort(apic_ids, num_cpus, NUM_ASCENDING); for (index = 0; index < num_cpus; index++) { - current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, - index, apic_ids[index]); + 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, + index, apic_ids[index]); } return current; @@ -191,6 +207,21 @@ int acpi_create_madt_lapic_nmi(acpi_madt_lapic_nmi_t *lapic_nmi, u8 cpu, return lapic_nmi->length; } +int acpi_create_madt_lx2apic_nmi(acpi_madt_lx2apic_nmi_t *lapic_nmi, u32 cpu, + u16 flags, u8 lint) +{ + lapic_nmi->type = LOCAL_X2APIC_NMI; /* Local APIC NMI structure */ + lapic_nmi->length = sizeof(acpi_madt_lx2apic_nmi_t); + lapic_nmi->flags = flags; + lapic_nmi->processor_id = cpu; + lapic_nmi->lint = lint; + lapic_nmi->reserved[0] = 0; + lapic_nmi->reserved[1] = 0; + lapic_nmi->reserved[2] = 0; + + return lapic_nmi->length; +} + void acpi_create_madt(acpi_madt_t *madt) { acpi_header_t *header = &(madt->header); @@ -1556,7 +1587,7 @@ int get_acpi_table_revision(enum acpi_tables table) case FADT: return ACPI_FADT_REV_ACPI_6_0; case MADT: /* ACPI 3.0: 2, ACPI 4.0/5.0: 3, ACPI 6.2b/6.3: 5 */ - return 2; + return 3; case MCFG: return 1; case TCPA: |