diff options
Diffstat (limited to 'src/acpi')
-rw-r--r-- | src/acpi/Kconfig | 8 | ||||
-rw-r--r-- | src/acpi/acpi.c | 22 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/acpi/Kconfig b/src/acpi/Kconfig index 83d18bf62f..417ff60abb 100644 --- a/src/acpi/Kconfig +++ b/src/acpi/Kconfig @@ -111,3 +111,11 @@ config ACPI_PPTT_MAX_CACHES help This variable sets the maximum number of distinct caches per topology level. Increasing this option also increases stack usage. + +config ACPI_WDAT_WDT + bool + default n + depends on HAVE_ACPI_TABLES + help + Selected by platforms that support and fill ACPI Watchdog Action Table + (WDAT). diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index beba5fdb3a..5e769163b7 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; } |