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 <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41887
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Tim Wawrzynczak
2020-05-29 14:19:15 -06:00
committed by Patrick Georgi
parent 7eb1136c27
commit 3a9cde9ab6
4 changed files with 51 additions and 0 deletions

View File

@@ -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 */
}
}