k1:cpufreq: delete the boost related node for k1

Change-Id: I4ed3d9517d8769f57c49c02187f5a8632775fc3c
This commit is contained in:
Nell
2024-08-31 12:46:41 +08:00
committed by zhangmeng
parent 2f79a53e2b
commit f74a75a78a
4 changed files with 41 additions and 2 deletions

View File

@@ -193,6 +193,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy)
#ifdef CONFIG_SOC_SPACEMIT_K1X
extern int spacmeit_cpufreq_veritfy(struct cpufreq_policy_data *policy);
extern void spacemit_cpufreq_ready(struct cpufreq_policy *policy);
#endif
static struct cpufreq_driver dt_cpufreq_driver = {
@@ -202,6 +203,7 @@ static struct cpufreq_driver dt_cpufreq_driver = {
.verify = cpufreq_generic_frequency_table_verify,
#else
.verify = spacmeit_cpufreq_veritfy,
.ready = spacemit_cpufreq_ready,
#endif
.target_index = set_target,
.get = cpufreq_generic_get,

View File

@@ -2811,11 +2811,31 @@ static int create_boost_sysfs_file(void)
return ret;
}
#ifndef CONFIG_SOC_SPACEMIT_K1X
static void remove_boost_sysfs_file(void)
{
if (cpufreq_boost_supported())
sysfs_remove_file(cpufreq_global_kobject, &boost.attr);
}
#else
void remove_boost_sysfs_file(void)
{
if (cpufreq_boost_supported())
sysfs_remove_file(cpufreq_global_kobject, &boost.attr);
}
void remove_policy_boost_sysfs_file(struct cpufreq_policy *policy)
{
if (cpufreq_driver->attr[CPUFREQ_BOOST_FREQ]) {
sysfs_remove_file(&policy->kobj,
&((cpufreq_driver->attr[CPUFREQ_BOOST_FREQ])->attr));
}
if (cpufreq_boost_supported()) {
sysfs_remove_file(&policy->kobj, &local_boost.attr);
}
}
#endif
int cpufreq_enable_boost_support(void)
{

View File

@@ -57,7 +57,9 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
* If the driver has set its own cpuinfo.max_freq above max_freq, leave
* it as is.
*/
#ifndef CONFIG_SOC_SPACEMIT_K1X
if (policy->cpuinfo.max_freq < max_freq)
#endif
policy->max = policy->cpuinfo.max_freq = max_freq;
if (policy->min == ~0)

View File

@@ -426,12 +426,12 @@ int spacmeit_cpufreq_veritfy(struct cpufreq_policy_data *policy)
if (!policy->freq_table)
return -ENODEV;
if ((wafer_prop << 16 | product_prop) == PRODUCT_ID_M1) {
/* M1 */
/* can update to 1.8G */
policy->max = policy->max > M1_MAX_FREQ_LIMITATION ? M1_MAX_FREQ_LIMITATION : policy->max;
cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
M1_MAX_FREQ_LIMITATION);
policy->cpuinfo.max_freq);
} else {
/* K1 */
/* only 1.6G allowed max */
@@ -461,6 +461,21 @@ int spacmeit_cpufreq_veritfy(struct cpufreq_policy_data *policy)
policy->min, policy->max, policy->cpu);
return 0;
}
extern void remove_boost_sysfs_file(void);
extern void remove_policy_boost_sysfs_file(struct cpufreq_policy *policy);
void spacemit_cpufreq_ready(struct cpufreq_policy *policy)
{
if ((wafer_prop << 16 | product_prop) == PRODUCT_ID_M1) {
/* M1 */
} else {
/* K1 or other */
remove_policy_boost_sysfs_file(policy);
remove_boost_sysfs_file();
}
}
#endif
static int spacemit_dt_cpufreq_pre_probe(struct platform_device *pdev)