diff options
author | Varshit B Pandya <varshit.b.pandya@intel.com> | 2022-03-20 20:39:51 +0530 |
---|---|---|
committer | Paul Fagerburg <pfagerburg@chromium.org> | 2022-04-01 13:45:49 +0000 |
commit | e7d3a1a9e8e69cfa2963339e7cf45160509cd784 (patch) | |
tree | 693be5440f3ae8c62f8d99b4d65a4b5b8901d212 /src/drivers/intel | |
parent | 47b7904d78ff2f0eb002edea99a3b761ccde962b (diff) |
drivers/intel/dptf: Add support for Power participant
As per Intel Dynamic Tuning revision 1.3.13 (Doc no: 541817)
Add support for TPWR device under \_SB.DPTF
BUG=b:205928013
TEST=Build, boot brya0 and dump SSDT to check TPWR device
Device (TPWR)
{
Name (_HID, "INTC1060") // _HID: Hardware ID
Name (_UID, "TPWR") // _UID: Unique ID
Name (_STR, "Power Participant") // _STR: Description String
Name (PTYP, 0x11)
Method (_STA, 0, NotSerialized) // _STA: Status
{
Return (0x0F)
}
}
Signed-off-by: Varshit B Pandya <varshit.b.pandya@intel.com>
Change-Id: I437e509f58df1777d75e5981f0a5a63095ccb6a3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62944
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/intel')
-rw-r--r-- | src/drivers/intel/dptf/Kconfig | 7 | ||||
-rw-r--r-- | src/drivers/intel/dptf/dptf.c | 23 | ||||
-rw-r--r-- | src/drivers/intel/dptf/dptf.h | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/drivers/intel/dptf/Kconfig b/src/drivers/intel/dptf/Kconfig index 6f590b9246..a7a5760e0d 100644 --- a/src/drivers/intel/dptf/Kconfig +++ b/src/drivers/intel/dptf/Kconfig @@ -12,3 +12,10 @@ config DRIVERS_INTEL_DPTF_SUPPORTS_TPCH 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 DRIVERS_INTEL_DPTF + 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 71a25b606e..ecb338bf88 100644 --- a/src/drivers/intel/dptf/dptf.c +++ b/src/drivers/intel/dptf/dptf.c @@ -14,10 +14,12 @@ enum dptf_generic_participant_type { 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,24 @@ 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) +{ + acpigen_write_device("TPWR"); + acpigen_write_name("_HID"); + if (platform_info->tpwr_device_hid != NULL) + 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); + acpigen_write_device_end(); /* TPWR Power Participant Device */ +} + +static void write_tpwr_methods(const struct dptf_platform_info *platform_info) +{ + write_create_tpwr(platform_info); +} + /* \_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 +426,9 @@ static void write_device_definitions(const struct device *dev) if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPCH)) write_tpch_methods(platform_info); + if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPWR)) + write_tpwr_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 877aad98e1..c80e64a9ac 100644 --- a/src/drivers/intel/dptf/dptf.h +++ b/src/drivers/intel/dptf/dptf.h @@ -15,6 +15,7 @@ struct dptf_platform_info { 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; |