drivers/intel/dptf: Add DCFG support

After final production, it's possible by setting particular
bit using DCFG the OEM/ODM locks down thermal tuning beyond
what is usually done on the given platform.

In that case user space calibration tools should not try
to adjust the thermal configuration of the system.

By adding new DCFG (Device Configuration) it allows the
OEM/ODM to control this thermal tuning mechanism. They can
configure it by adding dcfg config under overridetree.cb file.
The default value for all bits is 0 to ensure default behavior
and backwards compatibility.

For an example if Bit 0 being set represents Generic DTT UI
access control is disabled and Bit 2 being set represents DTT
shell access control is disabled.
Each bit represents different configuration access control
for DTT as per BIOS specification document #640237.

It also gives the provision for user space to check the current
mode. This mode value is based on BIOS specification document
number #640237.

BUG=b:272382080
TEST=Build, boot on rex board and dump SSDT to check DCFG value.
 Also, verified the newly added sysfs attribute "production_mode"
 present under /sys/bus/platform/devices/INTC1042:00 path.

Change-Id: I507c4d6eee565d39b2f42950d888d110ab94de64
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78386
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Sumeet Pawnikar 2023-10-12 17:53:37 +05:30 committed by Felix Held
parent e4e29c9e78
commit d4d6d6c8d0
2 changed files with 10 additions and 0 deletions

View File

@ -73,6 +73,9 @@ struct drivers_intel_dptf_config {
/* Rest of platform Power */ /* Rest of platform Power */
uint32_t prop; uint32_t prop;
/* Device Configuration */
uint32_t dcfg;
bool dptf_multifan_support; bool dptf_multifan_support;
}; };

View File

@ -158,6 +158,12 @@ static void write_imok(void)
acpigen_emit_byte(ARG0_OP); acpigen_emit_byte(ARG0_OP);
acpigen_write_method_end(); acpigen_write_method_end();
} }
static void write_dcfg_variable(const struct drivers_intel_dptf_config *config)
{
acpigen_write_name_integer("DCFG", config->dcfg);
}
/* \_SB.DPTF */ /* \_SB.DPTF */
static void write_oem_variables(const struct drivers_intel_dptf_config *config) static void write_oem_variables(const struct drivers_intel_dptf_config *config)
{ {
@ -520,6 +526,7 @@ static void write_device_definitions(const struct device *dev)
} else } else
write_fan(config, platform_info, DPTF_FAN); write_fan(config, platform_info, DPTF_FAN);
write_dcfg_variable(config);
write_oem_variables(config); write_oem_variables(config);
write_imok(); write_imok();
write_generic_devices(config, platform_info); write_generic_devices(config, platform_info);