From 2decfb3f7cf763e42ac9885a998892156b2e18c7 Mon Sep 17 00:00:00 2001 From: dkl Date: Sat, 15 Dec 2012 10:54:22 +0800 Subject: [PATCH] RK292X:add VPU dvfs --- arch/arm/mach-rk2928/cpufreq.c | 6 ++++++ arch/arm/mach-rk2928/dvfs.c | 13 +++++++++++++ 2 files changed, 19 insertions(+) mode change 100644 => 100755 arch/arm/mach-rk2928/cpufreq.c mode change 100644 => 100755 arch/arm/mach-rk2928/dvfs.c diff --git a/arch/arm/mach-rk2928/cpufreq.c b/arch/arm/mach-rk2928/cpufreq.c old mode 100644 new mode 100755 index b9172a2bd6d2..099d24ea6931 --- a/arch/arm/mach-rk2928/cpufreq.c +++ b/arch/arm/mach-rk2928/cpufreq.c @@ -236,6 +236,8 @@ static int rk30_cpu_init(struct cpufreq_policy *policy) if (policy->cpu == 0) { int i; struct clk *ddr_clk; + struct clk *aclk_vepu_clk; + gpu_clk = clk_get(NULL, "gpu"); if (!IS_ERR(gpu_clk)) clk_enable_dvfs(gpu_clk); @@ -277,6 +279,10 @@ static int rk30_cpu_init(struct cpufreq_policy *policy) clk_enable_dvfs(ddr_clk); } + aclk_vepu_clk = clk_get(NULL, "aclk_vepu"); + if (!IS_ERR(aclk_vepu_clk)) + clk_enable_dvfs(aclk_vepu_clk); + freq_wq = create_singlethread_workqueue("rk30_cpufreqd"); #ifdef CONFIG_RK30_CPU_FREQ_LIMIT_BY_TEMP if (rk30_cpufreq_is_ondemand_policy(policy)) { diff --git a/arch/arm/mach-rk2928/dvfs.c b/arch/arm/mach-rk2928/dvfs.c old mode 100644 new mode 100755 index f3b669a080f2..e8d086ddf102 --- a/arch/arm/mach-rk2928/dvfs.c +++ b/arch/arm/mach-rk2928/dvfs.c @@ -1289,6 +1289,13 @@ static struct cpufreq_frequency_table peri_aclk_dvfs_table[] = { {.frequency = CPUFREQ_TABLE_END}, }; +static struct cpufreq_frequency_table vpu_dvfs_table[] = { + {.frequency = 266 * DVFS_KHZ, .index = 1100 * DVFS_MV}, + {.frequency = 300 * DVFS_KHZ, .index = 1100 * DVFS_MV}, + {.frequency = 400 * DVFS_KHZ, .index = 1200 * DVFS_MV}, + {.frequency = CPUFREQ_TABLE_END}, +}; + static struct cpufreq_frequency_table dep_cpu2core_table[] = { // {.frequency = 252 * DVFS_KHZ, .index = 1025 * DVFS_MV}, // {.frequency = 504 * DVFS_KHZ, .index = 1025 * DVFS_MV}, @@ -1413,6 +1420,11 @@ static struct pds_list aclk_periph_pds[] = { CLK_PDS(NULL), }; +static struct pds_list aclk_vepu_pds[] = { + CLK_PDS(&pd_video), + CLK_PDS(NULL), +}; + #define RK_CLKS(_clk_name, _ppds, _dvfs_table, _dvfs_nb) \ { \ .name = _clk_name, \ @@ -1425,6 +1437,7 @@ static struct clk_node rk30_clks[] = { RK_CLKS("cpu", cpu_pds, cpu_dvfs_table, &rk_dvfs_clk_notifier), RK_CLKS("ddr", ddr_pds, ddr_dvfs_table, &rk_dvfs_clk_notifier), RK_CLKS("gpu", gpu_pds, gpu_dvfs_table, &rk_dvfs_clk_notifier), + RK_CLKS("aclk_vepu", aclk_vepu_pds, vpu_dvfs_table, &rk_dvfs_clk_notifier), //RK_CLKS("aclk_periph", aclk_periph_pds, peri_aclk_dvfs_table, &rk_dvfs_clk_notifier), }; -- 2.34.1