drivers/intel/dptf: Add new thermal control mechanism for pch device

Add new thermal control mechanism for pch device under dptf driver.
This provides support of different control knobs for FIVR.

BUG=b:198582766
BRANCH=None
TEST=Build FW and test on brya0 board

Change-Id: I035d2844b9ba6a9532ae006fc1c43e34cb94328a
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57096
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Sumeet Pawnikar 2021-08-30 23:19:38 +05:30 committed by Felix Held
parent 30fba61502
commit a91d931114
3 changed files with 58 additions and 1 deletions

View File

@ -5,3 +5,10 @@ config DRIVERS_INTEL_DPTF
help help
When enabled, entries in the devicetree are used to generate When enabled, entries in the devicetree are used to generate
Intel DPTF Tables at runtime in the SSDT. Intel DPTF Tables at runtime in the SSDT.
config DRIVERS_INTEL_DPTF_SUPPORTS_TPCH
def_bool n
depends on HAVE_ACPI_TABLES && PMC_IPC_ACPI_INTERFACE
help
When enabled, chip driver/intel/dptf will publish information to the
SSDT for the TPCH device.

View File

@ -4,6 +4,7 @@
#include <acpi/acpigen_pci.h> #include <acpi/acpigen_pci.h>
#include <console/console.h> #include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <intelblocks/pmc_ipc.h>
#include "chip.h" #include "chip.h"
#include "dptf.h" #include "dptf.h"
@ -194,7 +195,50 @@ static void write_generic_devices(const struct drivers_intel_dptf_config *config
} }
} }
/* \_SB.DPTF - note: leaves the Scope open for child devices*/ /* \_SB.DPTF.TPCH.RFC methods */
static void write_tpch_rfc_methods(const char *tpch_rfc_method_name,
unsigned int ipc_subcmd_ctrl_value)
{
acpigen_write_method_serialized(tpch_rfc_method_name, 1);
acpigen_emit_namestring("IPCS");
acpigen_write_integer(PMC_IPC_CMD_COMMAND_FIVR);
acpigen_write_integer(PMC_IPC_CMD_CMD_ID_FIVR_WRITE);
acpigen_write_integer(0x8);
acpigen_write_integer(ipc_subcmd_ctrl_value);
acpigen_emit_byte(ARG0_OP);
acpigen_write_dword(0);
acpigen_write_dword(0);
/* The reason for returning a value here is a W/A for the ESIF shell */
acpigen_emit_byte(RETURN_OP);
acpigen_write_package(0);
acpigen_write_package_end();
acpigen_write_method_end();
}
static void write_create_tpch(const struct dptf_platform_info *platform_info)
{
acpigen_write_device("TPCH");
acpigen_write_name("_HID");
dptf_write_hid(platform_info->use_eisa_hids, platform_info->tpch_device_hid);
acpigen_write_name_integer("_UID", 0);
acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON);
}
static void write_tpch_methods(const struct dptf_platform_info *platform_info)
{
write_create_tpch(platform_info);
/* Create RFC0 method */
write_tpch_rfc_methods(platform_info->tpch_rfc0_method,
PMC_IPC_SUBCMD_RFI_CTRL0_LOGIC);
/* Create RFC1 method */
write_tpch_rfc_methods(platform_info->tpch_rfc1_method,
PMC_IPC_SUBCMD_RFI_CTRL4_LOGIC);
acpigen_write_device_end(); /* TPCH Device */
}
/* \_SB.DPTF - note: leaves the Scope open for child devices */
static void write_open_dptf_device(const struct device *dev, static void write_open_dptf_device(const struct device *dev,
const struct dptf_platform_info *platform_info) const struct dptf_platform_info *platform_info)
{ {
@ -229,6 +273,9 @@ static void write_device_definitions(const struct device *dev)
write_imok(); write_imok();
write_generic_devices(config, platform_info); write_generic_devices(config, platform_info);
if (CONFIG(DRIVERS_INTEL_DPTF_SUPPORTS_TPCH))
write_tpch_methods(platform_info);
acpigen_pop_len(); /* DPTF Device (write_open_dptf_device) */ acpigen_pop_len(); /* DPTF Device (write_open_dptf_device) */
acpigen_pop_len(); /* Scope */ acpigen_pop_len(); /* Scope */
} }

View File

@ -14,6 +14,9 @@ struct dptf_platform_info {
const char *dptf_device_hid; const char *dptf_device_hid;
const char *generic_hid; const char *generic_hid;
const char *fan_hid; const char *fan_hid;
const char *tpch_device_hid;
const char *tpch_rfc0_method;
const char *tpch_rfc1_method;
}; };
const struct dptf_platform_info *get_dptf_platform_info(void); const struct dptf_platform_info *get_dptf_platform_info(void);