summaryrefslogtreecommitdiffstats
path: root/src/acpi/acpi.c
diff options
context:
space:
mode:
authorMarek Maslanka <mmaslanka@google.com>2023-12-07 13:21:35 +0000
committerFelix Held <felix-coreboot@felixheld.de>2023-12-15 19:08:45 +0000
commit017003cbd0b75119cd1ee6ff52236f8a18182c3c (patch)
treeaece1d47e5ea203970f12b163e956759f368477a /src/acpi/acpi.c
parentd9c347fb8bf5815567ca5fe94f1cf2d0b4cd3c87 (diff)
downloadcoreboot-017003cbd0b75119cd1ee6ff52236f8a18182c3c.tar.gz
coreboot-017003cbd0b75119cd1ee6ff52236f8a18182c3c.tar.bz2
coreboot-017003cbd0b75119cd1ee6ff52236f8a18182c3c.zip
acpi: Add support for WDAT table
This commit lays the groundwork for implementing the ACPI WDAT (Watchdog Action Table) table specification. The WDAT is a special ACPI table introduced by Microsoft that describes the watchdog for the OS. Platforms that need to implement the WDAT table must describe the hardware watchdog management operations as described in the specification. See “Links to ACPI-Related Documents” (http://uefi.org/acpi) under the heading “Watchdog Action Table”. BUG=b:314260167 TEST=Mock the acpi_soc_fill_wdat function for a specific platform/soc and enable ACPI_WDAT_WDT in the kconfig. Check if the build passes successfully. Change-Id: Ieb82d1f69b2b7fffacfd2928bc71f8ff10498074 Signed-off-by: Marek Maslanka <mmaslanka@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79380 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jakub Czapiga <czapiga@google.com>
Diffstat (limited to 'src/acpi/acpi.c')
-rw-r--r--src/acpi/acpi.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c
index beba5fdb3ac6..5e769163b72d 100644
--- a/src/acpi/acpi.c
+++ b/src/acpi/acpi.c
@@ -1218,6 +1218,25 @@ static void acpi_create_iort(acpi_header_t *header, void *unused)
header->length = current - (unsigned long)iort;
}
+static void acpi_create_wdat(acpi_header_t *header, void *unused)
+{
+ if (!CONFIG(ACPI_WDAT_WDT))
+ return;
+
+ acpi_wdat_t *wdat = (acpi_wdat_t *)header;
+ unsigned long current = (unsigned long)wdat + sizeof(acpi_wdat_t);
+
+ memset((void *)wdat, 0, sizeof(acpi_wdat_t));
+
+ if (acpi_fill_header(header, "WDAT", WDAT, sizeof(acpi_wdat_t)) != CB_SUCCESS)
+ return;
+
+ current = acpi_soc_fill_wdat(wdat, current);
+
+ /* (Re)calculate length. */
+ header->length = current - (unsigned long)wdat;
+}
+
unsigned long acpi_create_lpi_desc_ncst(acpi_lpi_desc_ncst_t *lpi_desc, uint16_t uid)
{
memset(lpi_desc, 0, sizeof(acpi_lpi_desc_ncst_t));
@@ -1434,6 +1453,7 @@ unsigned long write_acpi_tables(const unsigned long start)
{ acpi_create_gtdt, NULL, sizeof(acpi_gtdt_t) },
{ acpi_create_pptt, NULL, sizeof(acpi_pptt_t) },
{ acpi_create_iort, NULL, sizeof(acpi_iort_t) },
+ { acpi_create_wdat, NULL, sizeof(acpi_wdat_t) },
};
current = start;
@@ -1787,6 +1807,8 @@ int get_acpi_table_revision(enum acpi_tables table)
return 3;
case IORT: /* IO Remapping Table E.e */
return 6;
+ case WDAT:
+ return 1;
default:
return -1;
}