Varshit B Pandya has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63315 )
Change subject: drivers/intel/dptf: Add support for Battery participant ......................................................................
drivers/intel/dptf: Add support for Battery participant
As per Intel Dynamic Tuning revision 1.3.13 (Doc no: 541817) Add support for BAT1 device under _SB.DPTF
BUG=b:205928013 TEST=Build, boot brya0 and dump SSDT to check BAT1 device
Device (BAT1) { Name (_HID, "INTC1061") // _HID: Hardware ID Name (_UID, "BAT1") // _UID: Unique ID Name (_STR, "Battery Participant") // _STR: Description String Name (PTYP, 0xC) Method (_STA, 0, NotSerialized) // _STA: Status { Return (0x0F) } }
Signed-off-by: Varshit B Pandya varshit.b.pandya@intel.com Change-Id: I9104318fd838f30253ab1eeac4e212b3b917f516 --- 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, 36 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/63315/1
diff --git a/src/acpi/acpigen_dptf.c b/src/acpi/acpigen_dptf.c index 4a5bd09..ea608b8 100644 --- a/src/acpi/acpigen_dptf.c +++ b/src/acpi/acpigen_dptf.c @@ -76,6 +76,8 @@ return "TPCH"; case DPTF_POWER: return "TPWR"; + case DPTF_BATTERY: + return "BAT1"; default: return ""; } diff --git a/src/drivers/intel/dptf/Kconfig b/src/drivers/intel/dptf/Kconfig index a7a5760..1420425 100644 --- a/src/drivers/intel/dptf/Kconfig +++ b/src/drivers/intel/dptf/Kconfig @@ -19,3 +19,10 @@ help When enabled, chip driver/intel/dptf will publish information to the SSDT for TPWR device. + +config DRIVERS_INTEL_DPTF_SUPPORTS_BAT + def_bool n + depends on DRIVERS_INTEL_DPTF + help + When enabled, chip driver/intel/dptf will publish information to the + SSDT for BAT1 device. diff --git a/src/drivers/intel/dptf/dptf.c b/src/drivers/intel/dptf/dptf.c index ecb338b..23df2d9 100644 --- a/src/drivers/intel/dptf/dptf.c +++ b/src/drivers/intel/dptf/dptf.c @@ -15,11 +15,13 @@ DPTF_GENERIC_PARTICIPANT_TYPE_TPCH = 0x5, DPTF_GENERIC_PARTICIPANT_TYPE_CHARGER = 0xB, DPTF_GENERIC_PARTICIPANT_TYPE_POWER = 0x11, + DPTF_GENERIC_PARTICIPANT_TYPE_BATTERY = 0xC, };
#define DEFAULT_CHARGER_STR "Battery Charger" #define DEFAULT_TPCH_STR "Intel PCH FIVR Participant" #define DEFAULT_POWER_STR "Power Participant" +#define DEFAULT_BATTERY_STR "Battery Participant"
#define PMC_IPC_COMMAND_FIVR_SIZE 0x8
@@ -388,6 +390,26 @@ write_create_tpwr(platform_info); }
+static void write_create_tbat(const struct dptf_platform_info *platform_info) +{ + acpigen_write_device("BAT1"); + acpigen_write_name("_HID"); + if (platform_info->tbat_device_hid != NULL) + dptf_write_hid(platform_info->use_eisa_hids, platform_info->tbat_device_hid); + acpigen_write_name_string("_UID", "BAT1"); + acpigen_write_name_string("_STR", DEFAULT_BATTERY_STR); + acpigen_write_name_integer("PTYP", DPTF_GENERIC_PARTICIPANT_TYPE_BATTERY); + acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON); + acpigen_write_device_end(); /* BAT1 Battery Participant Device */ +} + + +static void write_tbat_methods(const struct dptf_platform_info *platform_info) +{ + write_create_tbat(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) @@ -429,6 +451,9 @@ if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPWR)) write_tpwr_methods(platform_info);
+ if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_BAT)) + write_tbat_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 c80e64a..ed25880 100644 --- a/src/drivers/intel/dptf/dptf.h +++ b/src/drivers/intel/dptf/dptf.h @@ -16,6 +16,7 @@ const char *fan_hid; const char *tpch_device_hid; const char *tpwr_device_hid; + const char *tbat_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 0d49452..893256e 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_POWER, + DPTF_BATTERY, DPTF_PARTICIPANT_COUNT, };