diff options
author | Tim Wawrzynczak <twawrzynczak@chromium.org> | 2020-05-29 13:56:37 -0600 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-07-07 17:20:13 +0000 |
commit | c41f7f15c192d06b5dfdeb1b74f99278cee66110 (patch) | |
tree | 4e8e33a2268c837f329fafb05d42837ac119fae9 /src/drivers | |
parent | ff2f6b2478dac8cd957695e528f13babaa49a963 (diff) |
dptf: Add support for generation of Active Policies
This change adds support for generating the different pieces of DPTF
Active Policies. This includes the Active Relationship Table, in
addition to _ACx methods.
BUG=b:143539650
TEST=compiles
Change-Id: Iea0ccbd96f88d0f3a8f2c77a7d0f3a284e5ee463
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41885
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/intel/dptf/chip.h | 5 | ||||
-rw-r--r-- | src/drivers/intel/dptf/dptf.c | 26 |
2 files changed, 19 insertions, 12 deletions
diff --git a/src/drivers/intel/dptf/chip.h b/src/drivers/intel/dptf/chip.h index 704b83e763..730d23ed6b 100644 --- a/src/drivers/intel/dptf/chip.h +++ b/src/drivers/intel/dptf/chip.h @@ -3,7 +3,12 @@ #ifndef _DRIVERS_INTEL_DPTF_CHIP_H_ #define _DRIVERS_INTEL_DPTF_CHIP_H_ +#include <acpi/acpigen_dptf.h> + struct drivers_intel_dptf_config { + struct { + struct dptf_active_policy active[DPTF_MAX_ACTIVE_POLICIES]; + } policies; }; #endif /* _DRIVERS_INTEL_DPTF_CHIP_H_ */ diff --git a/src/drivers/intel/dptf/dptf.c b/src/drivers/intel/dptf/dptf.c index 060864adc1..20f8d9b4ae 100644 --- a/src/drivers/intel/dptf/dptf.c +++ b/src/drivers/intel/dptf/dptf.c @@ -5,18 +5,6 @@ #include <device/device.h> #include "chip.h" -enum dptf_participant { - DPTF_NONE, - DPTF_CPU, - DPTF_CHARGER, - DPTF_FAN, - DPTF_TEMP_SENSOR_0, - DPTF_TEMP_SENSOR_1, - DPTF_TEMP_SENSOR_2, - DPTF_TEMP_SENSOR_3, - DPTF_PARTICIPANT_COUNT, -}; - /* Generic DPTF participants have a PTYP field to distinguish them */ enum dptf_generic_participant_type { DPTF_GENERIC_PARTICIPANT_TYPE_TSR = 0x3, @@ -40,6 +28,17 @@ enum dptf_generic_participant_type { static bool is_participant_used(const struct drivers_intel_dptf_config *config, enum dptf_participant participant) { + int i; + + /* Active? */ + for (i = 0; i < DPTF_MAX_ACTIVE_POLICIES; ++i) + if (config->policies.active[i].target == 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; + return false; } @@ -53,6 +52,9 @@ static void dptf_fill_ssdt(const struct device *dev) { struct drivers_intel_dptf_config *config = config_of(dev); + dptf_write_active_policies(config->policies.active, + DPTF_MAX_ACTIVE_POLICIES); + printk(BIOS_INFO, "\\_SB.DPTF: %s at %s\n", dev->chip_ops->name, dev_path(dev)); } |