mb/starlabs/*: Move powercap configuration to common dir
Move the code that configures power limits, tcc and other power related settings into common code. The end result is the same, but the PL4 is set by reading the battery capacity, rather than being hardcoded. This patch also appends `_group` to each form group, to avoid conflicts with objects now visible with the extra headers. Change-Id: I41235039bc984686fa43f5c712e836d0b8d5d24a Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89775 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
a198e7b8d6
commit
cb08e29ba7
25 changed files with 171 additions and 501 deletions
|
|
@ -85,8 +85,7 @@ config ME_BIN_PATH
|
|||
|
||||
config PL4_WATTS
|
||||
int
|
||||
default 65 if BOARD_STARLABS_BYTE_TWL
|
||||
default 36
|
||||
default 65
|
||||
|
||||
config POWER_STATE_DEFAULT_ON_AFTER_FAILURE
|
||||
default n
|
||||
|
|
@ -98,6 +97,10 @@ config EDK2_BOOTSPLASH_FILE
|
|||
config SOC_INTEL_CSE_SEND_EOP_EARLY
|
||||
default n
|
||||
|
||||
config TJ_MAX
|
||||
int
|
||||
default 105
|
||||
|
||||
config UART_FOR_CONSOLE
|
||||
default 0
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <variants.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
static struct sm_obj_form performance = {
|
||||
static struct sm_obj_form performance_group = {
|
||||
.ui_name = "Performance",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth_rtd3,
|
||||
|
|
@ -18,7 +18,7 @@ static struct sm_obj_form performance = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form processor = {
|
||||
static struct sm_obj_form processor_group = {
|
||||
.ui_name = "Processor",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&me_state,
|
||||
|
|
@ -29,7 +29,7 @@ static struct sm_obj_form processor = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form power = {
|
||||
static struct sm_obj_form power_group = {
|
||||
.ui_name = "Power",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&power_on_after_fail_bool,
|
||||
|
|
@ -37,7 +37,7 @@ static struct sm_obj_form power = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form devices = {
|
||||
static struct sm_obj_form devices_group = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth,
|
||||
|
|
@ -47,7 +47,7 @@ static struct sm_obj_form devices = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form pci = {
|
||||
static struct sm_obj_form pci_group = {
|
||||
.ui_name = "PCI",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&pciexp_clk_pm,
|
||||
|
|
@ -57,7 +57,7 @@ static struct sm_obj_form pci = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form coreboot = {
|
||||
static struct sm_obj_form coreboot_group = {
|
||||
.ui_name = "coreboot",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&debug_level,
|
||||
|
|
@ -66,12 +66,12 @@ static struct sm_obj_form coreboot = {
|
|||
};
|
||||
|
||||
static struct sm_obj_form *sm_root[] = {
|
||||
&performance,
|
||||
&processor,
|
||||
&power,
|
||||
&devices,
|
||||
&pci,
|
||||
&coreboot,
|
||||
&performance_group,
|
||||
&processor_group,
|
||||
&power_group,
|
||||
&devices_group,
|
||||
&pci_group,
|
||||
&coreboot_group,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,49 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 105
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_4core =
|
||||
&cfg->power_limits_config[ADL_N_041_6W_CORE];
|
||||
struct soc_power_limits_config *soc_conf_8core =
|
||||
&cfg->power_limits_config[ADL_N_041_15W_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_4core->tdp_pl4 = CONFIG_PL4_WATTS;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl2_override / 2) & ~1;
|
||||
soc_conf_8core->tdp_pl1_override = (soc_conf_8core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(70);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
soc_conf_8core->tdp_pl1_override = (soc_conf_8core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_8core->tdp_pl2_override = (soc_conf_8core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#define _STARLABS_CMN_CFR_H_
|
||||
|
||||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <soc/soc_chip.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
void cfr_card_reader_update(struct sm_object *new_obj);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
#ifndef _STARLABS_CMN_POWERCAP_H_
|
||||
#define _STARLABS_CMN_POWERCAP_H_
|
||||
|
||||
#include <soc/soc_chip.h>
|
||||
|
||||
#define TCC(temp) (CONFIG_TJ_MAX - temp)
|
||||
|
||||
enum cmos_power_profile {
|
||||
PP_POWER_SAVER = 0,
|
||||
PP_BALANCED = 1,
|
||||
|
|
@ -10,6 +14,6 @@ enum cmos_power_profile {
|
|||
};
|
||||
#define NUM_POWER_PROFILES 3
|
||||
|
||||
enum cmos_power_profile get_power_profile(enum cmos_power_profile fallback);
|
||||
void update_power_limits(config_t *cfg);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,10 +1,56 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <option.h>
|
||||
#include <types.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
enum cmos_power_profile get_power_profile(enum cmos_power_profile fallback)
|
||||
static enum cmos_power_profile get_power_profile(enum cmos_power_profile fallback)
|
||||
{
|
||||
const unsigned int power_profile = get_uint_option("power_profile", fallback);
|
||||
return power_profile < NUM_POWER_PROFILES ? power_profile : fallback;
|
||||
}
|
||||
|
||||
|
||||
void update_power_limits(config_t *cfg)
|
||||
{
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
struct soc_power_limits_config *limits =
|
||||
(struct soc_power_limits_config *)&cfg->power_limits_config;
|
||||
size_t limit_count = sizeof(cfg->power_limits_config) /
|
||||
sizeof(struct soc_power_limits_config);
|
||||
|
||||
for (size_t i = 0; i < limit_count; i++) {
|
||||
struct soc_power_limits_config *entry = &limits[i];
|
||||
|
||||
entry->tdp_pl4 = (uint16_t)CONFIG_PL4_WATTS;
|
||||
|
||||
if (!entry->tdp_pl2_override)
|
||||
continue;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
entry->tdp_pl1_override = (entry->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
if (performance_scale == 100)
|
||||
continue;
|
||||
|
||||
entry->tdp_pl1_override = ((entry->tdp_pl1_override * performance_scale) / 100);
|
||||
entry->tdp_pl2_override = ((entry->tdp_pl2_override * performance_scale) / 100);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,14 @@ config MAINBOARD_SMBIOS_PRODUCT_NAME
|
|||
config POWER_STATE_DEFAULT_ON_AFTER_FAILURE
|
||||
default n
|
||||
|
||||
config TJ_MAX
|
||||
int
|
||||
default 100
|
||||
|
||||
config PL4_WATTS
|
||||
int
|
||||
default 45
|
||||
|
||||
config TRACKPAD_INTERRUPT
|
||||
hex
|
||||
default 0x1 if BOARD_STARLABS_LITE_GLK
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <variants.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
static struct sm_obj_form performance = {
|
||||
static struct sm_obj_form performance_group = {
|
||||
.ui_name = "Performance",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&power_profile,
|
||||
|
|
@ -16,7 +16,7 @@ static struct sm_obj_form performance = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form processor = {
|
||||
static struct sm_obj_form processor_group = {
|
||||
.ui_name = "Processor",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&s0ix_enable,
|
||||
|
|
@ -25,7 +25,7 @@ static struct sm_obj_form processor = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form power = {
|
||||
static struct sm_obj_form power_group = {
|
||||
.ui_name = "Power",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&power_on_after_fail_bool,
|
||||
|
|
@ -33,7 +33,7 @@ static struct sm_obj_form power = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form keyboard = {
|
||||
static struct sm_obj_form keyboard_group = {
|
||||
.ui_name = "Keyboard",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&kbl_timeout,
|
||||
|
|
@ -42,7 +42,7 @@ static struct sm_obj_form keyboard = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form devices = {
|
||||
static struct sm_obj_form devices_group = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth,
|
||||
|
|
@ -54,7 +54,7 @@ static struct sm_obj_form devices = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form pci = {
|
||||
static struct sm_obj_form pci_group = {
|
||||
.ui_name = "PCI",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
#if CONFIG(SOC_INTEL_ALDERLAKE)
|
||||
|
|
@ -66,7 +66,7 @@ static struct sm_obj_form pci = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form coreboot = {
|
||||
static struct sm_obj_form coreboot_group = {
|
||||
.ui_name = "coreboot",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&debug_level,
|
||||
|
|
@ -75,13 +75,13 @@ static struct sm_obj_form coreboot = {
|
|||
};
|
||||
|
||||
static struct sm_obj_form *sm_root[] = {
|
||||
&performance,
|
||||
&processor,
|
||||
&power,
|
||||
&keyboard,
|
||||
&devices,
|
||||
&pci,
|
||||
&coreboot,
|
||||
&performance_group,
|
||||
&processor_group,
|
||||
&power_group,
|
||||
&keyboard_group,
|
||||
&devices_group,
|
||||
&pci_group,
|
||||
&coreboot_group,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -15,38 +15,9 @@ void devtree_update(void)
|
|||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf =
|
||||
&cfg->power_limits_config;
|
||||
|
||||
struct device *wifi_dev = pcidev_on_root(0x0c, 0);
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf->tdp_pl4 = 31;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = 15;
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = 10;
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
performance_scale += 25;
|
||||
cfg->tcc_offset = 5;
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -197,6 +197,17 @@ config POWER_STATE_DEFAULT_ON_AFTER_FAILURE
|
|||
config SOC_INTEL_CSE_SEND_EOP_EARLY
|
||||
default n
|
||||
|
||||
config TJ_MAX
|
||||
int
|
||||
default 100 if BOARD_STARLABS_LABTOP_KBL || BOARD_STARLABS_LABTOP_CML || BOARD_STARLABS_STARBOOK_TGL
|
||||
default 105 if BOARD_STARLABS_STARBOOK_ADL_N
|
||||
default 110
|
||||
|
||||
config PL4_WATTS
|
||||
int
|
||||
default 45 if BOARD_STARLABS_LABTOP_KBL || BOARD_STARLABS_LABTOP_CML
|
||||
default 65
|
||||
|
||||
config TME_KEY_REGENERATION_ON_WARM_BOOT
|
||||
default n
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <intelblocks/cfr.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
static struct sm_obj_form performance = {
|
||||
static struct sm_obj_form performance_group = {
|
||||
.ui_name = "Performance",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth_rtd3,
|
||||
|
|
@ -17,7 +17,7 @@ static struct sm_obj_form performance = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form processor = {
|
||||
static struct sm_obj_form processor_group = {
|
||||
.ui_name = "Processor",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&me_state,
|
||||
|
|
@ -31,7 +31,7 @@ static struct sm_obj_form processor = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form power = {
|
||||
static struct sm_obj_form power_group = {
|
||||
.ui_name = "Power",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&max_charge,
|
||||
|
|
@ -45,7 +45,7 @@ static struct sm_obj_form power = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form keyboard = {
|
||||
static struct sm_obj_form keyboard_group = {
|
||||
.ui_name = "Keyboard",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&kbl_timeout,
|
||||
|
|
@ -54,7 +54,7 @@ static struct sm_obj_form keyboard = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form devices = {
|
||||
static struct sm_obj_form devices_group = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth,
|
||||
|
|
@ -84,7 +84,7 @@ static struct sm_obj_form devices = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form pci = {
|
||||
static struct sm_obj_form pci_group = {
|
||||
.ui_name = "PCI",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
#if CONFIG(BOARD_STARLABS_STARBOOK_ADL)
|
||||
|
|
@ -103,7 +103,7 @@ static struct sm_obj_form pci = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form coreboot = {
|
||||
static struct sm_obj_form coreboot_group = {
|
||||
.ui_name = "coreboot",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&debug_level,
|
||||
|
|
@ -112,13 +112,13 @@ static struct sm_obj_form coreboot = {
|
|||
};
|
||||
|
||||
static struct sm_obj_form *sm_root[] = {
|
||||
&performance,
|
||||
&processor,
|
||||
&power,
|
||||
&keyboard,
|
||||
&devices,
|
||||
&pci,
|
||||
&coreboot,
|
||||
&performance_group,
|
||||
&processor_group,
|
||||
&power_group,
|
||||
&keyboard_group,
|
||||
&devices_group,
|
||||
&pci_group,
|
||||
&coreboot_group,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,50 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 110
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_10core =
|
||||
&cfg->power_limits_config[ADL_P_282_442_482_28W_CORE];
|
||||
|
||||
struct soc_power_limits_config *soc_conf_12core =
|
||||
&cfg->power_limits_config[ADL_P_682_28W_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_10core->tdp_pl4 = 65;
|
||||
soc_conf_12core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_10core->tdp_pl1_override = (soc_conf_10core->tdp_pl2_override / 2) & ~1;
|
||||
soc_conf_12core->tdp_pl1_override = (soc_conf_12core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_10core->tdp_pl1_override = (soc_conf_10core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_10core->tdp_pl2_override = (soc_conf_10core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
soc_conf_12core->tdp_pl1_override = (soc_conf_12core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_12core->tdp_pl2_override = (soc_conf_12core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,42 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 105
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_4core =
|
||||
&cfg->power_limits_config[ADL_N_041_6W_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_4core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,41 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 100
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf = &cfg->power_limits_config;
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf->tdp_pl4 = 45;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,41 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 100
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf = &cfg->power_limits_config;
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf->tdp_pl4 = 45;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,42 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 110
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_20core =
|
||||
&cfg->power_limits_config[MTL_P_682_482_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_20core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_20core->tdp_pl1_override = (soc_conf_20core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_20core->tdp_pl1_override = (soc_conf_20core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_20core->tdp_pl2_override = (soc_conf_20core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,50 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 110
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_6core =
|
||||
&cfg->power_limits_config[RPL_P_282_242_142_15W_CORE];
|
||||
|
||||
struct soc_power_limits_config *soc_conf_12core =
|
||||
&cfg->power_limits_config[RPL_P_682_482_282_28W_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_6core->tdp_pl4 = 65;
|
||||
soc_conf_12core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_6core->tdp_pl1_override = (soc_conf_6core->tdp_pl2_override / 2) & ~1;
|
||||
soc_conf_12core->tdp_pl1_override = (soc_conf_12core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_6core->tdp_pl1_override = (soc_conf_6core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_6core->tdp_pl2_override = (soc_conf_6core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
soc_conf_12core->tdp_pl1_override = (soc_conf_12core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_12core->tdp_pl2_override = (soc_conf_12core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,50 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 100
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_2core =
|
||||
&cfg->power_limits_config[POWER_LIMITS_U_2_CORE];
|
||||
|
||||
struct soc_power_limits_config *soc_conf_4core =
|
||||
&cfg->power_limits_config[POWER_LIMITS_U_4_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_2core->tdp_pl4 = 65;
|
||||
soc_conf_4core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_2core->tdp_pl1_override = (soc_conf_2core->tdp_pl2_override / 2) & ~1;
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_2core->tdp_pl1_override = (soc_conf_2core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_2core->tdp_pl2_override = (soc_conf_2core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -122,6 +122,14 @@ config SOC_INTEL_CSE_SEND_EOP_EARLY
|
|||
config TME_KEY_REGENERATION_ON_WARM_BOOT
|
||||
default n
|
||||
|
||||
config TJ_MAX
|
||||
int
|
||||
default 110
|
||||
|
||||
config PL4_WATTS
|
||||
int
|
||||
default 80
|
||||
|
||||
config TPM_PIRQ
|
||||
depends on MAINBOARD_HAS_TPM2
|
||||
default 0x3d if BOARD_STARLABS_STARFIGHTER_MTL
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#include <variants.h>
|
||||
#include <common/cfr.h>
|
||||
|
||||
static struct sm_obj_form performance = {
|
||||
static struct sm_obj_form performance_group = {
|
||||
.ui_name = "Performance",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth_rtd3,
|
||||
|
|
@ -18,7 +18,7 @@ static struct sm_obj_form performance = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form processor = {
|
||||
static struct sm_obj_form processor_group = {
|
||||
.ui_name = "Processor",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&me_state,
|
||||
|
|
@ -30,7 +30,7 @@ static struct sm_obj_form processor = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form power = {
|
||||
static struct sm_obj_form power_group = {
|
||||
.ui_name = "Power",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&max_charge,
|
||||
|
|
@ -44,7 +44,7 @@ static struct sm_obj_form power = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form keyboard = {
|
||||
static struct sm_obj_form keyboard_group = {
|
||||
.ui_name = "Keyboard",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&kbl_timeout,
|
||||
|
|
@ -53,7 +53,7 @@ static struct sm_obj_form keyboard = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form devices = {
|
||||
static struct sm_obj_form devices_group = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
#if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE)
|
||||
|
|
@ -73,7 +73,7 @@ static struct sm_obj_form devices = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form pci = {
|
||||
static struct sm_obj_form pci_group = {
|
||||
.ui_name = "PCI",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
#if CONFIG(SOC_INTEL_COMMON_BLOCK_ASPM)
|
||||
|
|
@ -88,7 +88,7 @@ static struct sm_obj_form pci = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form coreboot = {
|
||||
static struct sm_obj_form coreboot_group = {
|
||||
.ui_name = "coreboot",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&debug_level,
|
||||
|
|
@ -97,13 +97,13 @@ static struct sm_obj_form coreboot = {
|
|||
};
|
||||
|
||||
static struct sm_obj_form *sm_root[] = {
|
||||
&performance,
|
||||
&processor,
|
||||
&power,
|
||||
&keyboard,
|
||||
&devices,
|
||||
&pci,
|
||||
&coreboot,
|
||||
&performance_group,
|
||||
&processor_group,
|
||||
&power_group,
|
||||
&keyboard_group,
|
||||
&devices_group,
|
||||
&pci_group,
|
||||
&coreboot_group,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,42 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 110
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_20core =
|
||||
&cfg->power_limits_config[MTL_P_682_482_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_20core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_20core->tdp_pl1_override = (soc_conf_20core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_20core->tdp_pl1_override = (soc_conf_20core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_20core->tdp_pl2_override = (soc_conf_20core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
if (get_uint_option("webcam", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -10,50 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 110
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_6core =
|
||||
&cfg->power_limits_config[RPL_P_282_242_142_15W_CORE];
|
||||
|
||||
struct soc_power_limits_config *soc_conf_14core =
|
||||
&cfg->power_limits_config[RPL_P_682_642_482_45W_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_6core->tdp_pl4 = 65;
|
||||
soc_conf_14core->tdp_pl4 = 65;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_6core->tdp_pl1_override = (soc_conf_6core->tdp_pl2_override / 2) & ~1;
|
||||
soc_conf_14core->tdp_pl1_override = (soc_conf_14core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(100);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_6core->tdp_pl1_override = (soc_conf_6core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_6core->tdp_pl2_override = (soc_conf_6core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
soc_conf_14core->tdp_pl1_override = (soc_conf_14core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_14core->tdp_pl2_override = (soc_conf_14core->tdp_pl2_override * performance_scale) / 100;
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
|
|
|
|||
|
|
@ -100,6 +100,14 @@ config EDK2_BOOTSPLASH_FILE
|
|||
config SOC_INTEL_CSE_SEND_EOP_EARLY
|
||||
default n
|
||||
|
||||
config TJ_MAX
|
||||
int
|
||||
default 105
|
||||
|
||||
config PL4_WATTS
|
||||
int
|
||||
default 37
|
||||
|
||||
config UART_FOR_CONSOLE
|
||||
default 0
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ void cfr_card_reader_update(struct sm_object *new_obj)
|
|||
new_obj->sm_bool.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
}
|
||||
|
||||
static struct sm_obj_form performance = {
|
||||
static struct sm_obj_form performance_group = {
|
||||
.ui_name = "Performance",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth_rtd3,
|
||||
|
|
@ -29,7 +29,7 @@ static struct sm_obj_form performance = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form processor = {
|
||||
static struct sm_obj_form processor_group = {
|
||||
.ui_name = "Processor",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&me_state,
|
||||
|
|
@ -40,7 +40,7 @@ static struct sm_obj_form processor = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form power = {
|
||||
static struct sm_obj_form power_group = {
|
||||
.ui_name = "Power",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&max_charge,
|
||||
|
|
@ -54,7 +54,7 @@ static struct sm_obj_form power = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form devices = {
|
||||
static struct sm_obj_form devices_group = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&accelerometer,
|
||||
|
|
@ -75,7 +75,7 @@ static struct sm_obj_form devices = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form pci = {
|
||||
static struct sm_obj_form pci_group = {
|
||||
.ui_name = "PCI",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
#if CONFIG(SOC_INTEL_COMMON_BLOCK_ASPM)
|
||||
|
|
@ -87,7 +87,7 @@ static struct sm_obj_form pci = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct sm_obj_form coreboot = {
|
||||
static struct sm_obj_form coreboot_group = {
|
||||
.ui_name = "coreboot",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&debug_level,
|
||||
|
|
@ -96,12 +96,12 @@ static struct sm_obj_form coreboot = {
|
|||
};
|
||||
|
||||
static struct sm_obj_form *sm_root[] = {
|
||||
&performance,
|
||||
&processor,
|
||||
&power,
|
||||
&devices,
|
||||
&pci,
|
||||
&coreboot,
|
||||
&performance_group,
|
||||
&processor_group,
|
||||
&power_group,
|
||||
&devices_group,
|
||||
&pci_group,
|
||||
&coreboot_group,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,43 +10,10 @@
|
|||
#include <variants.h>
|
||||
#include <common/powercap.h>
|
||||
|
||||
#define TJ_MAX 105
|
||||
#define TCC(temp) (TJ_MAX - temp)
|
||||
|
||||
void devtree_update(void)
|
||||
{
|
||||
config_t *cfg = config_of_soc();
|
||||
|
||||
struct soc_power_limits_config *soc_conf_4core =
|
||||
&cfg->power_limits_config[ADL_N_041_6W_CORE];
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
/* Set PL4 to 1.0C */
|
||||
soc_conf_4core->tdp_pl4 = 37;
|
||||
|
||||
/* Set PL1 to 50% of PL2 */
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl2_override / 2) & ~1;
|
||||
|
||||
/* Scale PL1 & PL2 based on CMOS settings */
|
||||
switch (get_power_profile(PP_POWER_SAVER)) {
|
||||
case PP_POWER_SAVER:
|
||||
performance_scale -= 50;
|
||||
cfg->tcc_offset = TCC(70);
|
||||
break;
|
||||
case PP_BALANCED:
|
||||
performance_scale -= 25;
|
||||
cfg->tcc_offset = TCC(80);
|
||||
break;
|
||||
case PP_PERFORMANCE:
|
||||
/* Use the Intel defaults */
|
||||
cfg->tcc_offset = TCC(90);
|
||||
break;
|
||||
}
|
||||
|
||||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
update_power_limits(cfg);
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue