summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorJonathan Zhang <jonzhang@fb.com>2021-04-21 17:51:31 -0700
committerWerner Zeh <werner.zeh@siemens.com>2021-05-27 14:37:19 +0000
commit3164b645ab3b12e475305be67093f34cde4ff6df (patch)
tree08f3511a7c981f2690b31141cc69e459f1d238e2 /src/acpi
parent2de78e25a32931536cb14cd4b51d612ae546fcdf (diff)
acpi: add SRAT Generic Initiator Affinity structure
Generic Initiator Affinity structure is introdcued in ACPI spec 6.3. This structure is used to define NUMA affinity domain which is established by generic initiator (such as by CXL device). Signed-off-by: Jonathan Zhang <jonzhang@fb.com> Change-Id: Ic6ef01c59e02f30dc290f27e741027e16f5d8359 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52734 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lance Zhao
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpi.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c
index 6c1828aba4..0874e6e21f 100644
--- a/src/acpi/acpi.c
+++ b/src/acpi/acpi.c
@@ -508,6 +508,23 @@ int acpi_create_srat_mem(acpi_srat_mem_t *mem, u8 node, u32 basek, u32 sizek,
return mem->length;
}
+int acpi_create_srat_gia_pci(acpi_srat_gia_t *gia, u32 proximity_domain,
+ u16 seg, u8 bus, u8 dev, u8 func, u32 flags)
+{
+ gia->type = ACPI_SRAT_STRUCTURE_GIA;
+ gia->length = sizeof(acpi_srat_gia_t);
+ gia->proximity_domain = proximity_domain;
+ gia->dev_handle_type = ACPI_SRAT_GIA_DEV_HANDLE_PCI;
+ /* First two bytes has segment number */
+ memcpy(gia->dev_handle, &seg, 2);
+ gia->dev_handle[2] = bus; /* Byte 2 has bus number */
+ /* Byte 3 has bits 7:3 for dev, bits 2:0 for func */
+ gia->dev_handle[3] = PCI_SLOT(dev) | PCI_FUNC(func);
+ gia->flags = flags;
+
+ return gia->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))