tools/power/x86/intel-speed-select: Abstract set_clos
Allow platform specific implementation to set CLOS priority setting. 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>
This commit is contained in:
parent
43314e798c
commit
33dbf360db
tools/power/x86/intel-speed-select
|
@ -732,6 +732,30 @@ static int mbox_pm_get_clos(struct isst_id *id, int clos, struct isst_clos_confi
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mbox_set_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
|
||||||
|
{
|
||||||
|
unsigned int req, resp;
|
||||||
|
unsigned int param;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
req = clos_config->epp & 0x0f;
|
||||||
|
req |= (clos_config->clos_prop_prio & 0x0f) << 4;
|
||||||
|
req |= (clos_config->clos_min & 0xff) << 8;
|
||||||
|
req |= (clos_config->clos_max & 0xff) << 16;
|
||||||
|
req |= (clos_config->clos_desired & 0xff) << 24;
|
||||||
|
|
||||||
|
param = BIT(MBOX_CMD_WRITE_BIT) | clos;
|
||||||
|
|
||||||
|
ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PM_CLOS, param, req,
|
||||||
|
&resp);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
debug_printf("cpu:%d CLOS_PM_CLOS param:%x req:%x\n", id->cpu, param, req);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct isst_platform_ops mbox_ops = {
|
static struct isst_platform_ops mbox_ops = {
|
||||||
.get_disp_freq_multiplier = mbox_get_disp_freq_multiplier,
|
.get_disp_freq_multiplier = mbox_get_disp_freq_multiplier,
|
||||||
.get_trl_max_levels = mbox_get_trl_max_levels,
|
.get_trl_max_levels = mbox_get_trl_max_levels,
|
||||||
|
@ -753,6 +777,7 @@ static struct isst_platform_ops mbox_ops = {
|
||||||
.get_clos_information = mbox_get_clos_information,
|
.get_clos_information = mbox_get_clos_information,
|
||||||
.pm_qos_config = mbox_pm_qos_config,
|
.pm_qos_config = mbox_pm_qos_config,
|
||||||
.pm_get_clos = mbox_pm_get_clos,
|
.pm_get_clos = mbox_pm_get_clos,
|
||||||
|
.set_clos = mbox_set_clos,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct isst_platform_ops *mbox_get_platform_ops(void)
|
struct isst_platform_ops *mbox_get_platform_ops(void)
|
||||||
|
|
|
@ -633,26 +633,8 @@ int isst_pm_get_clos(struct isst_id *id, int clos, struct isst_clos_config *clos
|
||||||
|
|
||||||
int isst_set_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
|
int isst_set_clos(struct isst_id *id, int clos, struct isst_clos_config *clos_config)
|
||||||
{
|
{
|
||||||
unsigned int req, resp;
|
CHECK_CB(set_clos);
|
||||||
unsigned int param;
|
return isst_ops->set_clos(id, clos, clos_config);
|
||||||
int ret;
|
|
||||||
|
|
||||||
req = clos_config->epp & 0x0f;
|
|
||||||
req |= (clos_config->clos_prop_prio & 0x0f) << 4;
|
|
||||||
req |= (clos_config->clos_min & 0xff) << 8;
|
|
||||||
req |= (clos_config->clos_max & 0xff) << 16;
|
|
||||||
req |= (clos_config->clos_desired & 0xff) << 24;
|
|
||||||
|
|
||||||
param = BIT(MBOX_CMD_WRITE_BIT) | clos;
|
|
||||||
|
|
||||||
ret = isst_send_mbox_command(id->cpu, CONFIG_CLOS, CLOS_PM_CLOS, param, req,
|
|
||||||
&resp);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
debug_printf("cpu:%d CLOS_PM_CLOS param:%x req:%x\n", id->cpu, param, req);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int isst_clos_get_assoc_status(struct isst_id *id, int *clos_id)
|
int isst_clos_get_assoc_status(struct isst_id *id, int *clos_id)
|
||||||
|
|
|
@ -202,6 +202,7 @@ struct isst_platform_ops {
|
||||||
int (*get_clos_information)(struct isst_id *id, int *enable, int *type);
|
int (*get_clos_information)(struct isst_id *id, int *enable, int *type);
|
||||||
int (*pm_qos_config)(struct isst_id *id, int enable_clos, int priority_type);
|
int (*pm_qos_config)(struct isst_id *id, int enable_clos, int priority_type);
|
||||||
int (*pm_get_clos)(struct isst_id *id, int clos, struct isst_clos_config *clos_config);
|
int (*pm_get_clos)(struct isst_id *id, int clos, struct isst_clos_config *clos_config);
|
||||||
|
int (*set_clos)(struct isst_id *id, int clos, struct isst_clos_config *clos_config);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int is_cpu_in_power_domain(int cpu, struct isst_id *id);
|
extern int is_cpu_in_power_domain(int cpu, struct isst_id *id);
|
||||||
|
|
Loading…
Reference in New Issue