John Su has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46377 )
Change subject: soc/amd/picasso: Add STAPM_TIME_CONSTANT DPTC parameter support ......................................................................
soc/amd/picasso: Add STAPM_TIME_CONSTANT DPTC parameter support
Add STAPM_TIME_CONSTANT DPTC parameter for clamshell/tablet mode.
BUG=b:170696020 BRANCH=zork TEST=build
Signed-off-by: John Su john_su@compal.corp-partner.google.com Change-Id: I42956efbb95e21e4e8d86a209e64d3b33bdefba8 --- M src/soc/amd/picasso/chip.h M src/soc/amd/picasso/root_complex.c 2 files changed, 11 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/46377/1
diff --git a/src/soc/amd/picasso/chip.h b/src/soc/amd/picasso/chip.h index 3098a81..2f207ba 100644 --- a/src/soc/amd/picasso/chip.h +++ b/src/soc/amd/picasso/chip.h @@ -114,6 +114,7 @@ /* STAPM Configuration for tablet mode (need enable dptc_enable first) */ uint32_t fast_ppt_limit_tablet_mode; uint32_t slow_ppt_limit_tablet_mode; + uint32_t stapm_time_constant_tablet_mode; uint32_t sustained_power_limit_tablet_mode;
/* PROCHOT_L de-assertion Ramp Time */ diff --git a/src/soc/amd/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c index 174cddc..f61b33c 100644 --- a/src/soc/amd/picasso/root_complex.c +++ b/src/soc/amd/picasso/root_complex.c @@ -17,11 +17,12 @@
enum { ALIB_DPTCI_FUNCTION_ID = 0xc, + STAPM_TIME_CONSTANT = 0x1, THERMAL_CONTROL_LIMIT_ID = 0x3, SUSTAINED_POWER_LIMIT_PARAM_ID = 0x5, FAST_PPT_LIMIT_PARAM_ID = 0x6, SLOW_PPT_LIMIT_PARAM_ID = 0x7, - DPTC_TOTAL_UPDATE_PARAMS = 4, + DPTC_TOTAL_UPDATE_PARAMS = 5, };
struct dptc_param { @@ -34,11 +35,15 @@ struct dptc_param params[DPTC_TOTAL_UPDATE_PARAMS]; } __packed;
-#define DPTC_INPUTS(_thermctllmit, _sustained, _fast, _slow) \ +#define DPTC_INPUTS(_stapmtimeconstant, _thermctllmit, _sustained, _fast, _slow)\ { \ .size = sizeof(struct dptc_input), \ .params = { \ { \ + .id = STAPM_TIME_CONSTANT, \ + .value = _stapmtimeconstant, \ + }, \ + { \ .id = THERMAL_CONTROL_LIMIT_ID, \ .value = _thermctllmit, \ }, \ @@ -200,11 +205,13 @@ if (!config->dptc_enable) return;
- struct dptc_input default_input = DPTC_INPUTS(config->thermctl_limit, + struct dptc_input default_input = DPTC_INPUTS(config->stapm_time_constant, + config->thermctl_limit, config->sustained_power_limit, config->fast_ppt_limit, config->slow_ppt_limit); struct dptc_input tablet_mode_input = DPTC_INPUTS( + config->stapm_time_constant_tablet_mode, config->thermctl_limit_tablet_mode, config->sustained_power_limit_tablet_mode, config->fast_ppt_limit_tablet_mode,