From 860fff5aa3f901b724d03b6bfbf5b7ceb78a6e0f Mon Sep 17 00:00:00 2001 From: Anson Huang Date: Thu, 25 Aug 2016 20:50:07 +0800 Subject: [PATCH] MLK-13119-3 cpufreq: imx6q: support VPU 396MHz When VPU runs at 396MHz, VDDSOC_CAP's voltage should be set to 1.275V for all set-points, add VPU clock rate check to support this case. Signed-off-by: Anson Huang --- drivers/cpufreq/imx6q-cpufreq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 8887b1d92af1..bd79927b01f5 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -283,11 +283,13 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) { struct device_node *np; struct dev_pm_opp *opp; + struct clk *vpu_axi_podf; unsigned long min_volt, max_volt; int num, ret; const struct property *prop; const __be32 *val; u32 nr, j, i = 0; + u32 vpu_axi_rate = 0; cpu_dev = get_cpu_device(0); if (!cpu_dev) { @@ -327,6 +329,10 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) } } + vpu_axi_podf = devm_clk_get(cpu_dev, "vpu_axi_podf"); + if (!IS_ERR(vpu_axi_podf)) + vpu_axi_rate = clk_get_rate(vpu_axi_podf); + arm_reg = devm_regulator_get(cpu_dev, "arm"); pu_reg = devm_regulator_get_optional(cpu_dev, "pu"); soc_reg = devm_regulator_get(cpu_dev, "soc"); @@ -419,6 +425,13 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) imx6_soc_volt[soc_opp_count - 1] = 1250000; } #endif + if (vpu_axi_rate == 396000000) { + if (freq <= 996000) { + pr_info("increase SOC/PU voltage for VPU396MHz at %ld MHz\n", + freq / 1000); + imx6_soc_volt[soc_opp_count - 1] = 1275000; + } + } break; } } -- 2.17.1