Skip to content

Commit

Permalink
exynos-acme: Allow to overclock the CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
flar2 authored and prashantpaddune committed Aug 3, 2019
1 parent 3a19ef5 commit 5c50f0d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions drivers/cpufreq/exynos-acme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,40 @@ static int init_dm(struct exynos_cpufreq_domain *domain,
return register_exynos_dm_freq_scaler(domain->dm_type, dm_scaler);
}

static unsigned long arg_cpu_max_c1 = 1586000;

static int __init cpufreq_read_cpu_max_c1(char *cpu_max_c1)
{
unsigned long ui_khz;
int ret;

ret = kstrtoul(cpu_max_c1, 0, &ui_khz);
if (ret)
return -EINVAL;

arg_cpu_max_c1 = ui_khz;
printk("cpu_max_c1=%lu\n", arg_cpu_max_c1);
return ret;
}
__setup("cpu_max_c1=", cpufreq_read_cpu_max_c1);

unsigned long arg_cpu_max_c2 = 2184000;

static __init int cpufreq_read_cpu_max_c2(char *cpu_max_c2)
{
unsigned long ui_khz;
int ret;

ret = kstrtoul(cpu_max_c2, 0, &ui_khz);
if (ret)
return -EINVAL;

arg_cpu_max_c2 = ui_khz;
printk("cpu_max_c2=%lu\n", arg_cpu_max_c2);
return ret;
}
__setup("cpu_max_c2=", cpufreq_read_cpu_max_c2);

static __init int init_domain(struct exynos_cpufreq_domain *domain,
struct device_node *dn)
{
Expand All @@ -1109,6 +1143,12 @@ static __init int init_domain(struct exynos_cpufreq_domain *domain,
if (!of_property_read_u32(dn, "min-freq", &val))
domain->min_freq = max(domain->min_freq, val);

if (domain->id == 0) {
domain->max_freq = arg_cpu_max_c1;
} else if (domain->id == 1) {
domain->max_freq = arg_cpu_max_c2;
}

domain->boot_freq = cal_dfs_get_boot_freq(domain->cal_id);
domain->resume_freq = cal_dfs_get_resume_freq(domain->cal_id);

Expand Down

0 comments on commit 5c50f0d

Please sign in to comment.