diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-05-29 14:19:15 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-07-07 17:21:07 +0000 |
commit | 3a9cde9ab630fa34240b16f7e6ae10b5a61aa67e (patch) | |
tree | b85c33d30756850725c2866e8394b442a5faca5c /src/include | |
parent | 7eb1136c27a839a18a4224b970b5a61587e29bd7 (diff) |
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>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/acpi/acpigen_dptf.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/acpi/acpigen_dptf.h b/src/include/acpi/acpigen_dptf.h index 214578a4c1..45fbe8f29f 100644 --- a/src/include/acpi/acpigen_dptf.h +++ b/src/include/acpi/acpigen_dptf.h @@ -28,6 +28,7 @@ enum { DPTF_MAX_ACX = 10, DPTF_MAX_ACTIVE_POLICIES = (DPTF_PARTICIPANT_COUNT-1), DPTF_MAX_PASSIVE_POLICIES = (DPTF_PARTICIPANT_COUNT-1), + DPTF_MAX_CRITICAL_POLICIES = (DPTF_PARTICIPANT_COUNT-1), }; /* Active Policy */ @@ -59,6 +60,22 @@ struct dptf_passive_policy { uint8_t priority; }; +/* Critical Policy type: graceful S4 transition or graceful shutdown */ +enum dptf_critical_policy_type { + DPTF_CRITICAL_S4, + DPTF_CRITICAL_SHUTDOWN, +}; + +/* Critical Policy */ +struct dptf_critical_policy { + /* The device that can trigger a critical event */ + enum dptf_participant source; + /* What type of critical policy */ + enum dptf_critical_policy_type type; + /* Temperature to activate policy, degrees C */ + uint8_t temp; +}; + /* * This function provides tables of temperature and corresponding fan or percent. When the * temperature thresholds are met (_AC0 - _AC9), the fan is driven to corresponding percentage @@ -74,6 +91,13 @@ void dptf_write_active_policies(const struct dptf_active_policy *policies, int m */ void dptf_write_passive_policies(const struct dptf_passive_policy *policies, int max_count); +/* + * Critical policies are temperature thresholds that, when reached, will cause the system to + * take some emergency action in order to eliminate excess temperatures from damaging the + * system. The emergency actions are a graceful suspend or a graceful shutdown. + */ +void dptf_write_critical_policies(const struct dptf_critical_policy *policies, int max_count); + /* Helper method to open the scope for a given participant. */ void dptf_write_scope(enum dptf_participant participant); |