KOUAM Ledoux has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43286 )
Change subject: SRAT revision to 3 ......................................................................
SRAT revision to 3
Bump SRAT revision to 3. This adds have take all the type of ACPI STRAT table (1 - 5 )
Change-Id: Ia4bd5f97be1abf1b2de005d7c26c86665ecb8c5e Signed-off-by: kouamdo kouamdoux@gmail.com --- M src/acpi/acpi.c M src/include/acpi/acpi.h 2 files changed, 96 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/43286/1
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 47f03c8..354af8e 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -507,6 +507,58 @@ return mem->length; }
+int acpi_create_srat_lx2apic(acpi_srat_lx2apic_t *lx2apic, u8 node, u8 x2apic) +{ + lx2apic->type = 2; + lx2apic->length = sizeof(acpi_srat_lx2apic_t); + lx2apic->proximity_domain = node; + lx2apic->lx2apic_id = x2apic; + lx2apic->flags = (1 << 0); + /* TODO: clock domain: lx2apic->clock_domain */ + lx2apic->resv1 = 0; + lx2apic->resv2 = 0; + + return lx2apic->length; +} + +int acpi_create_srat_gicc(acpi_srat_gicc_t *gicc, u8 node, u8 cpu) +{ + gicc->type = 3; + gicc->length = sizeof(acpi_srat_gicc_t); + gicc->proximity_domain = node; + gicc->processor_id = cpu; + gicc->flags = (1 << 0); + /* TODO: clock domain: gicc->clock_domain */ + + return gicc->length; +} + +int acpi_create_srat_its(acpi_srat_its_t *gicc, u8 node, u8 cpu) +{ + gicc->type = 4; + gicc->length = sizeof(acpi_srat_its_t); + gicc->proximity_domain = node; + gicc->resv = 0; + gicc->its_id = cpu; + + return gicc->length; +} + +int acpi_create_srat_gen_init_struct_(acpi_srat_gen_init_struc_t *gen, u8 node, u8 cpu) +{ + gen->type = 5; + gen->length = sizeof(acpi_srat_gen_init_struc_t); + gen->resv1 = 0; + /* TODO: Device Handle type: gen->device_hdle_type*/ + + gen->proximity_domain = node; + /* TODO: Device handle for the generic Initiator*/ + + gen->flags = (1 << 0); + gen->resv2 = 0; + + return gen->length; +} /* http://www.microsoft.com/whdc/system/sysinternals/sratdwn.mspx */ void acpi_create_srat(acpi_srat_t *srat, unsigned long (*acpi_fill_srat)(unsigned long current)) diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index cd99899..e6c0a8a 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -199,7 +199,7 @@ } __packed acpi_mcfg_mmconfig_t;
/* SRAT (System Resource Affinity Table) */ -typedef struct acpi_srat { +typedef struct { acpi_header_t header; u32 resv; u64 resv1; @@ -235,6 +235,49 @@ u32 resv2[2]; } __packed acpi_srat_mem_t;
+/* SRAT: x2APIC Affinity Structure */ +typedef struct acpi_srat_lx2apic { + u8 type; /* Type (2) */ + u8 length; /* Length in bytes (24) */ + u16 resv1; /* Reserved */ + u32 proximity_domain; /* Proximity Domain */ + u32 lx2apic_id; /* Local APIC Id */ + u32 flags; /* */ + u32 clock_domain; /**/ + u32 resv2; +} __packed acpi_srat_lx2apic_t; + +/* SRAT: GICC Affinity Structure*/ +typedef struct acpi_srat_gicc { + u8 type; /* Type (3) */ + u8 length; /* Length in bytes (18) */ + u32 proximity_domain; /* Proximity Domain */ + u32 processor_id; /* Local APIC Id */ + u32 flags; /* */ + u32 clock_domain; /**/ +} __packed acpi_srat_gicc_t; + +/* SRAT: Architecture Specific Affinity Structure */ +typedef struct acpi_srat_its { + u8 type; /* Type (4) */ + u8 length; /* Length in bytes (12) */ + u32 proximity_domain; /* Proximity Domain */ + u16 resv; + u32 its_id; /* ITS ID matching a GIC ITS entry in the MADT */ +} __packed acpi_srat_its_t; + +/*SRAT: Generic Initiator Affinity Structure*/ +typedef struct acpi_srat_gen_init_struc { + u8 type; /* Type (5) */ + u8 length; /* Length in bytes (32) */ + u16 resv1; /* Reserved */ + u8 device_hdle_type; /* Device Handle Type */ + u32 proximity_domain; /* Proximity Domain */ + u32 device_hdle[4]; /* Device Handle of the Generic Initiator */ + u32 flags; /* */ + u32 resv2; +} __packed acpi_srat_gen_init_struc_t; + /* SLIT (System Locality Distance Information Table) */ typedef struct acpi_slit { acpi_header_t header;