diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-05-29 14:46:19 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-07-07 17:23:16 +0000 |
commit | bb5c255907378a5c5798b5dab3616df1e63d3ee7 (patch) | |
tree | 6998607d8ef4942b7c547131c121cd25264f61d7 /src/include/acpi | |
parent | 2ad8ffed6fc3d0865d8dc066dcbf6ef2e369794c (diff) | |
download | coreboot-bb5c255907378a5c5798b5dab3616df1e63d3ee7.tar.xz |
dptf: Add support for Running Average Power Limits
This change adds support for emitting the PPCC table, which describes
the ranges available as knobs for DPTF to tune. It can support min/max
power, min/max time window for averaging, and the minimum adjustment size
(granularity or step size) of each power limit. The current implementation
only supports PL1 and PL2.
BUG=b:143539650
TEST=compiles
Change-Id: I67e80d661ea5bb79980ef285eca40c9a4b0f1849
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41890
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/include/acpi')
-rw-r--r-- | src/include/acpi/acpigen_dptf.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/acpi/acpigen_dptf.h b/src/include/acpi/acpigen_dptf.h index 3452f79578..474f72cd71 100644 --- a/src/include/acpi/acpigen_dptf.h +++ b/src/include/acpi/acpigen_dptf.h @@ -103,6 +103,26 @@ struct dptf_fan_perf { uint16_t power; }; +/* Running Average Power Limits (RAPL) */ +struct dptf_power_limit_config { + /* Minimum level of power limit, in mW */ + uint32_t min_power; + /* Maximum level of power limit, in mW */ + uint32_t max_power; + /* Minimum time window running average is over, in seconds */ + uint32_t time_window_min; + /* Maximum time window running average is over, in seconds */ + uint32_t time_window_max; + /* Granularity of the power limit setting (between min and max), in mW */ + uint16_t granularity; +}; + +/* Only PL1 and PL2 are controllable via DPTF */ +struct dptf_power_limits { + struct dptf_power_limit_config pl1; + struct dptf_power_limit_config pl2; +}; + /* * 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 @@ -142,6 +162,13 @@ void dptf_write_charger_perf(const struct dptf_charger_perf *perf, int max_count */ void dptf_write_fan_perf(const struct dptf_fan_perf *perf, int max_count); +/* + * This function writes out a PPCC table, which indicates power ranges that different Intel + * Running Average Power Limits (RAPLs) can take, as well as the time period they average over + * and the minimum adjustment amount. + */ +void dptf_write_power_limits(const struct dptf_power_limits *limits); + /* Helper method to open the scope for a given participant. */ void dptf_write_scope(enum dptf_participant participant); |