summaryrefslogtreecommitdiff
path: root/src/drivers/intel
diff options
context:
space:
mode:
authorVarshit B Pandya <varshit.b.pandya@intel.com>2022-04-18 14:50:30 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-04-20 09:58:58 +0000
commit282b3b6873e8666b0750ca973557b8cd7adf3689 (patch)
tree5eb2a3e2981588f700f7c27569beb31affa8a3e5 /src/drivers/intel
parent5784ab34d4ea89bb086af11125caec4af0cf1cd8 (diff)
drivers/intel/dptf: Add support for PROP method
Add PROP method under \_SB.DPTF.TPWR scope which will return static worst case rest of platform power in miliWatts. This value is static, which has to configured from devicetree of overridetree for each platform BUG=b:205928013 TEST=Build, boot brya0 and dump SSDT to check PROP method Scope (\_SB) { Device (DPTF) { Device (TPWR) { Method (PROP, 0, Serialized) { Return (XXXX) } } } } Signed-off-by: Varshit B Pandya <varshit.b.pandya@intel.com> Change-Id: I1415d2a9eb55cfadc3a7b41b53ecbec657002759 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63697 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src/drivers/intel')
-rw-r--r--src/drivers/intel/dptf/chip.h3
-rw-r--r--src/drivers/intel/dptf/dptf.c18
2 files changed, 17 insertions, 4 deletions
diff --git a/src/drivers/intel/dptf/chip.h b/src/drivers/intel/dptf/chip.h
index 59b1e251b3..060f19699d 100644
--- a/src/drivers/intel/dptf/chip.h
+++ b/src/drivers/intel/dptf/chip.h
@@ -59,6 +59,9 @@ struct drivers_intel_dptf_config {
struct {
uint32_t oem_variables[DPTF_OEM_VARIABLE_COUNT];
} oem_data;
+
+ /* Rest of platform Power */
+ uint32_t prop;
};
#endif /* _DRIVERS_INTEL_DPTF_CHIP_H_ */
diff --git a/src/drivers/intel/dptf/dptf.c b/src/drivers/intel/dptf/dptf.c
index 27c713313b..3cfd23c1d8 100644
--- a/src/drivers/intel/dptf/dptf.c
+++ b/src/drivers/intel/dptf/dptf.c
@@ -372,7 +372,8 @@ static void write_tpch_methods(const struct dptf_platform_info *platform_info)
acpigen_write_device_end(); /* TPCH Device */
}
-static void write_create_tpwr(const struct dptf_platform_info *platform_info)
+static void write_create_tpwr(const struct drivers_intel_dptf_config *config,
+ const struct dptf_platform_info *platform_info)
{
acpigen_write_device("TPWR");
acpigen_write_name("_HID");
@@ -382,12 +383,21 @@ static void write_create_tpwr(const struct dptf_platform_info *platform_info)
acpigen_write_name_string("_STR", DEFAULT_POWER_STR);
acpigen_write_name_integer("PTYP", DPTF_GENERIC_PARTICIPANT_TYPE_POWER);
acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON);
+
+ /* PROP method */
+ if(config->prop != 0) {
+ acpigen_write_method_serialized("PROP", 0);
+ acpigen_emit_byte(RETURN_OP);
+ acpigen_write_integer(config->prop);
+ acpigen_pop_len(); /* Method PROP */
+ }
acpigen_write_device_end(); /* TPWR Power Participant Device */
}
-static void write_tpwr_methods(const struct dptf_platform_info *platform_info)
+static void write_tpwr_methods(const struct drivers_intel_dptf_config *config,
+ const struct dptf_platform_info *platform_info)
{
- write_create_tpwr(platform_info);
+ write_create_tpwr(config, platform_info);
}
static void write_create_tbat(const struct dptf_platform_info *platform_info)
@@ -449,7 +459,7 @@ static void write_device_definitions(const struct device *dev)
write_tpch_methods(platform_info);
if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPWR))
- write_tpwr_methods(platform_info);
+ write_tpwr_methods(config, platform_info);
if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TBAT))
write_tbat_methods(platform_info);