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

@@ -8,6 +8,7 @@
struct drivers_intel_dptf_config {
struct {
struct dptf_active_policy active[DPTF_MAX_ACTIVE_POLICIES];
struct dptf_critical_policy critical[DPTF_MAX_CRITICAL_POLICIES];
struct dptf_passive_policy passive[DPTF_MAX_PASSIVE_POLICIES];
} policies;
};

View File

@@ -41,6 +41,11 @@ static bool is_participant_used(const struct drivers_intel_dptf_config *config,
config->policies.passive[i].target == participant)
return true;
/* Critical? */
for (i = 0; i < DPTF_MAX_CRITICAL_POLICIES; ++i)
if (config->policies.critical[i].source == participant)
return true;
/* Check fan as well (its use is implicit in the Active policy) */
if (participant == DPTF_FAN && config->policies.active[0].target != DPTF_NONE)
return true;
@@ -64,6 +69,9 @@ static void dptf_fill_ssdt(const struct device *dev)
dptf_write_passive_policies(config->policies.passive,
DPTF_MAX_PASSIVE_POLICIES);
dptf_write_critical_policies(config->policies.critical,
DPTF_MAX_CRITICAL_POLICIES);
printk(BIOS_INFO, "\\_SB.DPTF: %s at %s\n", dev->chip_ops->name, dev_path(dev));
}