From 3a9cde9ab630fa34240b16f7e6ae10b5a61aa67e Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Fri, 29 May 2020 14:19:15 -0600 Subject: dptf: Add support for Critical Policies This patch adds support for DPTF Critical Policies, which are consist of Method definitions only. They are `_CRT` and `_HOT`, which are defined as temperature thresholds that, when exceeded, will execute a graceful suspend or a graceful shutdown, respectively. BUG=b:143539650 TEST=compiles Change-Id: I711ecdcf17ae8f6e653f33069201da4515ace85e Signed-off-by: Tim Wawrzynczak Reviewed-on: https://review.coreboot.org/c/coreboot/+/41887 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie --- src/acpi/acpigen_dptf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/acpi/acpigen_dptf.c') diff --git a/src/acpi/acpigen_dptf.c b/src/acpi/acpigen_dptf.c index abd99c1394..88cf386bc8 100644 --- a/src/acpi/acpigen_dptf.c +++ b/src/acpi/acpigen_dptf.c @@ -262,3 +262,21 @@ void dptf_write_passive_policies(const struct dptf_passive_policy *policies, int write_thermal_relationship_table(policies, max_count); write_all_PSV(policies, max_count); } + +void dptf_write_critical_policies(const struct dptf_critical_policy *policies, int max_count) +{ + int i; + + for (i = 0; i < max_count; ++i) { + if (policies[i].source == DPTF_NONE) + break; + + dptf_write_scope(policies[i].source); + + /* Choose _CRT or _HOT */ + write_simple_return_method(policies[i].type == DPTF_CRITICAL_SHUTDOWN ? + "_CRT" : "_HOT", to_acpi_temp(policies[i].temp)); + + acpigen_pop_len(); /* Scope */ + } +} -- cgit v1.2.3