Varshit B Pandya has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62944 )
Change subject: drivers/intel/dptf: Add support for Power participant ......................................................................
drivers/intel/dptf: Add support for Power participant
As per Intel Dynamic Tuning revision 1.3.13 add support for TPWR device under _SB.DPTF
BUG=b:205928013 TEST=Build, boot brya0 and dump SSDT to check TPWR device
Signed-off-by: Varshit B Pandya varshit.b.pandya@intel.com Change-Id: I437e509f58df1777d75e5981f0a5a63095ccb6a3 --- M src/acpi/acpigen_dptf.c M src/drivers/intel/dptf/Kconfig M src/drivers/intel/dptf/dptf.c M src/drivers/intel/dptf/dptf.h M src/include/acpi/acpigen_dptf.h 5 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/62944/1
diff --git a/src/acpi/acpigen_dptf.c b/src/acpi/acpigen_dptf.c index f2ae769..3c7c0e5 100644 --- a/src/acpi/acpigen_dptf.c +++ b/src/acpi/acpigen_dptf.c @@ -74,6 +74,8 @@ return "TSR4"; case DPTF_TPCH: return "TPCH"; + case DPTF_TPWR: + return "TPWR"; default: return ""; } diff --git a/src/drivers/intel/dptf/Kconfig b/src/drivers/intel/dptf/Kconfig index 6f590b9..6fbcb722 100644 --- a/src/drivers/intel/dptf/Kconfig +++ b/src/drivers/intel/dptf/Kconfig @@ -12,3 +12,10 @@ help When enabled, chip driver/intel/dptf will publish information to the SSDT for the TPCH device. + +config DRIVERS_INTEL_DPTF_SUPPORTS_TPWR + def_bool n + depends on HAVE_ACPI_TABLES + help + When enabled, chip driver/intel/dptf will publish information to the + SSDT for TPWR device. diff --git a/src/drivers/intel/dptf/dptf.c b/src/drivers/intel/dptf/dptf.c index 71a25b6..c107442 100644 --- a/src/drivers/intel/dptf/dptf.c +++ b/src/drivers/intel/dptf/dptf.c @@ -14,10 +14,12 @@ DPTF_GENERIC_PARTICIPANT_TYPE_TSR = 0x3, DPTF_GENERIC_PARTICIPANT_TYPE_TPCH = 0x5, DPTF_GENERIC_PARTICIPANT_TYPE_CHARGER = 0xB, + DPTF_GENERIC_PARTICIPANT_TYPE_POWER = 0x11, };
#define DEFAULT_CHARGER_STR "Battery Charger" #define DEFAULT_TPCH_STR "Intel PCH FIVR Participant" +#define DEFAULT_POWER_STR "Power Participant"
#define PMC_IPC_COMMAND_FIVR_SIZE 0x8
@@ -368,6 +370,23 @@ acpigen_write_device_end(); /* TPCH Device */ }
+static void write_create_tpwr(const struct dptf_platform_info *platform_info) +{ + acpigen_write_device("TPWR"); + acpigen_write_name("_HID"); + dptf_write_hid(platform_info->use_eisa_hids, platform_info->tpwr_device_hid); + acpigen_write_name_string("_UID", "TPWR"); + 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); +} + +static void write_power_methods(const struct dptf_platform_info *platform_info) +{ + write_create_tpwr(platform_info); + acpigen_write_device_end(); /* TPWR Power Participant Device */ +} + /* _SB.DPTF - note: leaves the Scope open for child devices */ static void write_open_dptf_device(const struct device *dev, const struct dptf_platform_info *platform_info) @@ -406,6 +425,9 @@ if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPCH)) write_tpch_methods(platform_info);
+ if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPWR)) + write_power_methods(platform_info); + acpigen_pop_len(); /* DPTF Device (write_open_dptf_device) */ acpigen_pop_len(); /* Scope */ } diff --git a/src/drivers/intel/dptf/dptf.h b/src/drivers/intel/dptf/dptf.h index 877aad9..c80e64a 100644 --- a/src/drivers/intel/dptf/dptf.h +++ b/src/drivers/intel/dptf/dptf.h @@ -15,6 +15,7 @@ const char *generic_hid; const char *fan_hid; const char *tpch_device_hid; + const char *tpwr_device_hid; struct { const char *set_fivr_low_clock_method; const char *set_fivr_high_clock_method; diff --git a/src/include/acpi/acpigen_dptf.h b/src/include/acpi/acpigen_dptf.h index 758398d..c06e683 100644 --- a/src/include/acpi/acpigen_dptf.h +++ b/src/include/acpi/acpigen_dptf.h @@ -27,6 +27,7 @@ DPTF_TEMP_SENSOR_4, DPTF_TPCH, DPTF_PARTICIPANT_COUNT, + DPTF_TPWR, };
/* DPTF compile-time constants */