diff options
author | Zhang Rui <rui.zhang@intel.com> | 2022-08-08 20:52:23 +0800 |
---|---|---|
committer | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2023-03-22 13:36:50 -0700 |
commit | a30cbd2270865136fbdcf0fbf7fadda707f32bba (patch) | |
tree | 9d673c74013e25f33de02605661ff353fe7e3c40 /tools/power | |
parent | e4cbd0f13f9ab3b3aefe79c45ab4d01984c37551 (diff) | |
download | linux-a30cbd2270865136fbdcf0fbf7fadda707f32bba.tar.gz |
tools/power/x86/intel-speed-select: Abstract get_tjmax_info
Allow platform specific implementation to get the Tjmax info for a
given SST-PP level.
No functional changes are expected.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
[srinivas.pandruvada@linux.intel.com: changelog edits]
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-core-mbox.c | 13 | ||||
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-core.c | 24 |
2 files changed, 12 insertions, 25 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-core-mbox.c b/tools/power/x86/intel-speed-select/isst-core-mbox.c index 40c856f4c708..2ae46aa7f9c4 100644 --- a/tools/power/x86/intel-speed-select/isst-core-mbox.c +++ b/tools/power/x86/intel-speed-select/isst-core-mbox.c @@ -122,6 +122,18 @@ static int mbox_get_tdp_info(struct isst_id *id, int config_index, "cpu:%d ctdp:%d CONFIG_TDP_GET_TDP_INFO resp:%x tdp_ratio:%d pkg_tdp:%d\n", id->cpu, config_index, resp, ctdp_level->tdp_ratio, ctdp_level->pkg_tdp); + + ret = isst_send_mbox_command(id->cpu, CONFIG_TDP, CONFIG_TDP_GET_TJMAX_INFO, + 0, config_index, &resp); + if (ret) + return ret; + + ctdp_level->t_proc_hot = resp & GENMASK(7, 0); + + debug_printf( + "cpu:%d ctdp:%d CONFIG_TDP_GET_TJMAX_INFO resp:%x t_proc_hot:%d\n", + id->cpu, config_index, resp, ctdp_level->t_proc_hot); + return 0; } @@ -147,7 +159,6 @@ static int mbox_get_pwr_info(struct isst_id *id, int config_index, return 0; } - static struct isst_platform_ops mbox_ops = { .get_disp_freq_multiplier = mbox_get_disp_freq_multiplier, .get_trl_max_levels = mbox_get_trl_max_levels, diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c index 9b993b00cd7d..d93735fbecea 100644 --- a/tools/power/x86/intel-speed-select/isst-core.c +++ b/tools/power/x86/intel-speed-select/isst-core.c @@ -312,26 +312,6 @@ int isst_get_pwr_info(struct isst_id *id, int config_index, return isst_ops->get_pwr_info(id, config_index, ctdp_level); } -int isst_get_tjmax_info(struct isst_id *id, int config_index, - struct isst_pkg_ctdp_level_info *ctdp_level) -{ - unsigned int resp; - int ret; - - ret = isst_send_mbox_command(id->cpu, CONFIG_TDP, CONFIG_TDP_GET_TJMAX_INFO, - 0, config_index, &resp); - if (ret) - return ret; - - ctdp_level->t_proc_hot = resp & GENMASK(7, 0); - - debug_printf( - "cpu:%d ctdp:%d CONFIG_TDP_GET_TJMAX_INFO resp:%x t_proc_hot:%d\n", - id->cpu, config_index, resp, ctdp_level->t_proc_hot); - - return 0; -} - int isst_get_coremask_info(struct isst_id *id, int config_index, struct isst_pkg_ctdp_level_info *ctdp_level) { @@ -1001,10 +981,6 @@ int isst_get_process_ctdp(struct isst_id *id, int tdp_level, struct isst_pkg_ctd if (ret) return ret; - ret = isst_get_tjmax_info(id, i, ctdp_level); - if (ret) - return ret; - ctdp_level->core_cpumask_size = alloc_cpu_set(&ctdp_level->core_cpumask); ret = isst_get_coremask_info(id, i, ctdp_level); |