summaryrefslogtreecommitdiffstats
path: root/src/acpi/acpi.c
diff options
context:
space:
mode:
authorDavid Milosevic <David.Milosevic@9elements.com>2023-09-22 14:34:28 +0200
committerLean Sheng Tan <sheng.tan@9elements.com>2023-12-02 19:16:26 +0000
commitd982274a4ecc8ed6b42724d03332d06d50393109 (patch)
treee21488faa5cac62c9b40b209a02ed6da55d0f88c /src/acpi/acpi.c
parentfaf277995999179794d0a571ffc02faaee363c79 (diff)
downloadcoreboot-d982274a4ecc8ed6b42724d03332d06d50393109.tar.gz
coreboot-d982274a4ecc8ed6b42724d03332d06d50393109.tar.bz2
coreboot-d982274a4ecc8ed6b42724d03332d06d50393109.zip
acpi: Add PPTT support
This patch adds code to generate Processor Properties Topology Tables (PPTT) compliant to the ACPI 6.4 specification. - The 'acpi_get_pptt_topology' hook is mandatory once ACPI_PPTT is selected. Its purpose is to return a pointer to a topology tree, which describes the relationship between CPUs and caches. The hook can be provided by, for example, mainboard code. Background: We are currently working on mainboard code for qemu-sbsa and Neoverse N2. Both require a valid PPTT table. Patch was tested against the qemu-sbsa board. Change-Id: Ia119e1ba15756704668116bdbc655190ec94ff10 Signed-off-by: David Milosevic <David.Milosevic@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78071 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Diffstat (limited to 'src/acpi/acpi.c')
-rw-r--r--src/acpi/acpi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c
index 942d464ad6dd..e40d4ac9aa43 100644
--- a/src/acpi/acpi.c
+++ b/src/acpi/acpi.c
@@ -1204,6 +1204,18 @@ unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t
return lpi_desc->header.length;
}
+static void acpi_create_pptt(acpi_header_t *header, void *unused)
+{
+ if (!CONFIG(ACPI_PPTT))
+ return;
+
+ if (acpi_fill_header(header, "PPTT", PPTT, sizeof(acpi_pptt_t)) != CB_SUCCESS)
+ return;
+
+ acpi_pptt_t *pptt = (acpi_pptt_t *)header;
+ acpi_create_pptt_body(pptt);
+}
+
static uint8_t acpi_spcr_type(void)
{
/* 16550-compatible with parameters defined in Generic Address Structure */
@@ -1394,6 +1406,7 @@ unsigned long write_acpi_tables(const unsigned long start)
{ acpi_create_bert, NULL, sizeof(acpi_bert_t) },
{ acpi_create_spcr, NULL, sizeof(acpi_spcr_t) },
{ acpi_create_gtdt, NULL, sizeof(acpi_gtdt_t) },
+ { acpi_create_pptt, NULL, sizeof(acpi_pptt_t) },
};
current = start;
@@ -1743,6 +1756,8 @@ int get_acpi_table_revision(enum acpi_tables table)
return 4;
case GTDT:
return 3;
+ case PPTT: /* ACPI 6.4 */
+ return 3;
default:
return -1;
}