]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MLK-10103-1 ARM: imx: add VPU 352M for i.mx6q
authorAnson Huang <b20788@freescale.com>
Fri, 16 Jan 2015 10:42:08 +0000 (18:42 +0800)
committerAnson Huang <b20788@freescale.com>
Fri, 16 Jan 2015 13:41:39 +0000 (21:41 +0800)
When VPU freq is set to 352MHz, it needs to source clk
from PLL2_PFD2_396M, and PLL2_PFD2_396M need to change
freq to 352M, cpufreq's 396M setpoint will be removed.

Busfreq will be disabled as it needs PLL2_PFD2 to be
as 396MHz to achieve low power audio freq setpoint.

To enable VPU 352MHz feature, select it in menuconfig,
it is disabled by default.

Signed-off-by: Anson Huang <b20788@freescale.com>
arch/arm/mach-imx/clk-imx6q.c
arch/arm/mach-imx/mach-imx6q.c

index a363ed5f3b0bb5a4b6af36625867842e7cb22731..e453bff04f870dc6de9529ee203d6061b8b23e55 100644 (file)
@@ -545,6 +545,21 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
                imx_clk_prepare_enable(clk[IMX6QDL_CLK_USBPHY2_GATE]);
        }
 
+#ifdef CONFIG_MX6_VPU_352M
+       /*
+        * If VPU 352M is enabled, then PLL2_PDF2 need to be
+        * set to 352M, cpufreq will be disabled as VDDSOC/PU
+        * need to be at highest voltage, scaling cpu freq is
+        * not saving any power, and busfreq will be also disabled
+        * as the PLL2_PFD2 is not at default freq, in a word,
+        * all modules that sourceing clk from PLL2_PFD2 will
+        * be impacted.
+        */
+       imx_clk_set_rate(clk[IMX6QDL_CLK_PLL2_PFD2_396M], 352000000);
+       imx_clk_set_parent(clk[IMX6QDL_CLK_VPU_AXI_SEL], clk[IMX6QDL_CLK_PLL2_PFD2_396M]);
+       pr_info("VPU 352M is enabled!\n");
+#endif
+
        /* Set initial power mode */
        imx6q_set_lpm(WAIT_CLOCKED);
 
index 478a6c2ed7adc7d0929ad443285c6b5b8bea2d73..28ab56fd3c4b228aa90a4dbc36d6e40cdda38235 100644 (file)
@@ -513,6 +513,12 @@ static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev)
                                pr_warn("failed to disable 852 MHz OPP\n");
        }
 
+       if (IS_ENABLED(CONFIG_MX6_VPU_352M)) {
+               if (dev_pm_opp_disable(cpu_dev, 396000000))
+                       pr_warn("failed to disable 396MHz OPP\n");
+               pr_info("remove 396MHz OPP for VPU running at 352MHz!\n");
+       }
+
 put_node:
        of_node_put(np);
 }