mb/google/nissa/var/joxer: support DPTF oem_variables
1. Joxer uses dptf.dv to distinguish 6W/15W by setting OEM variable. 2. Update passive policy and critical policy. BUG=b:285477026, b:293540179 TEST=emerge-nissa coreboot and check the OEM variable. Signed-off-by: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com> Change-Id: I4e52ac624f7d7628cce3035a2bac67fc527bc167 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76773 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com> Reviewed-by: Derek Huang <derekhuang@google.com> Reviewed-by: Ivan Chen <yulunchen@google.com>
This commit is contained in:
parent
6af7261b2b
commit
7333901701
|
@ -1,4 +1,8 @@
|
||||||
fw_config
|
fw_config
|
||||||
|
field THERMAL 2 2
|
||||||
|
option THERMAL_FANLESS 0
|
||||||
|
option THERMAL_FAN 1
|
||||||
|
end
|
||||||
field WIFI_SAR_ID 6 6
|
field WIFI_SAR_ID 6 6
|
||||||
option WIFI_GFP2_SAR_ID_0 0
|
option WIFI_GFP2_SAR_ID_0 0
|
||||||
option WIFI_GFP2_SAR_ID_1 1
|
option WIFI_GFP2_SAR_ID_1 1
|
||||||
|
@ -88,22 +92,22 @@ chip soc/intel/alderlake
|
||||||
## Passive Policy
|
## Passive Policy
|
||||||
register "policies.passive" = "{
|
register "policies.passive" = "{
|
||||||
[0] = DPTF_PASSIVE(CPU, CPU, 95, 5000),
|
[0] = DPTF_PASSIVE(CPU, CPU, 95, 5000),
|
||||||
[1] = DPTF_PASSIVE(CPU, TEMP_SENSOR_0, 75, 5000),
|
[1] = DPTF_PASSIVE(CPU, TEMP_SENSOR_0, 65, 5000),
|
||||||
[2] = DPTF_PASSIVE(CHARGER, TEMP_SENSOR_1, 75, 5000),
|
[2] = DPTF_PASSIVE(CHARGER, TEMP_SENSOR_1, 65, 5000),
|
||||||
[3] = DPTF_PASSIVE(CPU, TEMP_SENSOR_2, 75, 5000),
|
[3] = DPTF_PASSIVE(CPU, TEMP_SENSOR_2, 65, 5000),
|
||||||
}"
|
}"
|
||||||
|
|
||||||
## Critical Policy
|
## Critical Policy
|
||||||
register "policies.critical" = "{
|
register "policies.critical" = "{
|
||||||
[0] = DPTF_CRITICAL(CPU, 105, SHUTDOWN),
|
[0] = DPTF_CRITICAL(CPU, 105, SHUTDOWN),
|
||||||
[1] = DPTF_CRITICAL(TEMP_SENSOR_0, 85, SHUTDOWN),
|
[1] = DPTF_CRITICAL(TEMP_SENSOR_0, 75, SHUTDOWN),
|
||||||
[2] = DPTF_CRITICAL(TEMP_SENSOR_1, 85, SHUTDOWN),
|
[2] = DPTF_CRITICAL(TEMP_SENSOR_1, 75, SHUTDOWN),
|
||||||
[3] = DPTF_CRITICAL(TEMP_SENSOR_2, 85, SHUTDOWN),
|
[3] = DPTF_CRITICAL(TEMP_SENSOR_2, 75, SHUTDOWN),
|
||||||
}"
|
}"
|
||||||
|
|
||||||
register "controls.power_limits" = "{
|
register "controls.power_limits" = "{
|
||||||
.pl1 = {
|
.pl1 = {
|
||||||
.min_power = 3000,
|
.min_power = 6000,
|
||||||
.max_power = 6000,
|
.max_power = 6000,
|
||||||
.time_window_min = 28 * MSECS_PER_SEC,
|
.time_window_min = 28 * MSECS_PER_SEC,
|
||||||
.time_window_max = 32 * MSECS_PER_SEC,
|
.time_window_max = 32 * MSECS_PER_SEC,
|
||||||
|
@ -126,7 +130,11 @@ chip soc/intel/alderlake
|
||||||
[3] = { 8, 500 }
|
[3] = { 8, 500 }
|
||||||
}"
|
}"
|
||||||
|
|
||||||
device generic 0 on end
|
register "oem_data.oem_variables" = "{
|
||||||
|
[1] = 0x1
|
||||||
|
}"
|
||||||
|
|
||||||
|
device generic 0 alias dptf_policy on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref i2c1 on
|
device ref i2c1 on
|
||||||
|
|
|
@ -3,10 +3,34 @@
|
||||||
#include <baseboard/variants.h>
|
#include <baseboard/variants.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
|
#include <device/pci.h>
|
||||||
|
#include <drivers/intel/dptf/chip.h>
|
||||||
#include <fw_config.h>
|
#include <fw_config.h>
|
||||||
#include <soc/bootblock.h>
|
#include <soc/bootblock.h>
|
||||||
#include <sar.h>
|
#include <sar.h>
|
||||||
|
|
||||||
|
WEAK_DEV_PTR(dptf_policy);
|
||||||
|
|
||||||
|
static void update_oem_variables(void)
|
||||||
|
{
|
||||||
|
const struct device *policy_dev = DEV_PTR(dptf_policy);
|
||||||
|
struct drivers_intel_dptf_config *config = policy_dev->chip_info;
|
||||||
|
|
||||||
|
if (fw_config_probe(FW_CONFIG(THERMAL, THERMAL_FANLESS))) {
|
||||||
|
config->oem_data.oem_variables[0] = 0;
|
||||||
|
config->oem_data.oem_variables[1] = 1;
|
||||||
|
printk(BIOS_INFO, "Set OEM Variable [0] to 0.\n");
|
||||||
|
printk(BIOS_INFO, "Set OEM Variable [1] to 1.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fw_config_probe(FW_CONFIG(THERMAL, THERMAL_FAN))) {
|
||||||
|
config->oem_data.oem_variables[0] = 1;
|
||||||
|
config->oem_data.oem_variables[1] = 0;
|
||||||
|
printk(BIOS_INFO, "Set OEM Variable [0] to 1.\n");
|
||||||
|
printk(BIOS_INFO, "Set OEM Variable [1] to 0.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const char *get_wifi_sar_cbfs_filename(void)
|
const char *get_wifi_sar_cbfs_filename(void)
|
||||||
{
|
{
|
||||||
return get_wifi_sar_fw_config_filename(FW_CONFIG_FIELD(WIFI_SAR_ID));
|
return get_wifi_sar_fw_config_filename(FW_CONFIG_FIELD(WIFI_SAR_ID));
|
||||||
|
@ -18,6 +42,8 @@ void variant_devtree_update(void)
|
||||||
struct device *ufs = DEV_PTR(ufs);
|
struct device *ufs = DEV_PTR(ufs);
|
||||||
struct device *ish = DEV_PTR(ish);
|
struct device *ish = DEV_PTR(ish);
|
||||||
|
|
||||||
|
update_oem_variables();
|
||||||
|
|
||||||
if (!fw_config_is_provisioned()) {
|
if (!fw_config_is_provisioned()) {
|
||||||
printk(BIOS_INFO, "fw_config unprovisioned so enable all storage devices\n");
|
printk(BIOS_INFO, "fw_config unprovisioned so enable all storage devices\n");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue