Skip to contentSkip to conversation

ARM: imx clk: Implement pllv1 set_rate

RFC New Alexander Shiyan 1 participant 1 message Jul 13, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 ARM: imx clk: Implement pllv1 set_rate

This patch implements frequency change for i.MX clk v1 PLL. Selection of the values of the registers is not optimal, since is made by simple enumeration of all possible values. Comments are welcome.

---
 arch/arm/mach-imx/clk-imx27.c |   2 +-
 arch/arm/mach-imx/clk-pllv1.c | 109 ++++++++++++++++++++++++++++++++++--------
 arch/arm/mach-imx/mx27.h      |   4 +-
 3 files changed, 94 insertions(+), 21 deletions(-)
arch/arm/mach-imx/clk-imx27.c +1 -1
index c3cfa41..2b363d9 100644
@@ -125,7 +125,7 @@ int __init mx27_clocks_init(unsigned long fref)
 	clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks));
 	clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6);
 	clk[usb_div] = imx_clk_divider("usb_div", "spll_gate", CCM_CSCR, 28, 3);
-	clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks));
+	clk[cpu_sel] = imx_clk_mux_flags("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks), CLK_SET_RATE_PARENT);
 	clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks));
 	if (mx27_revision() >= IMX_CHIP_REVISION_2_0)
 		clk[cpu_div] = imx_clk_divider("cpu_div", "cpu_sel", CCM_CSCR, 12, 2);
arch/arm/mach-imx/clk-pllv1.c +90 -19

136 lines not on this page · raw message

arch/arm/mach-imx/mx27.h +3 -1
index 8a65f19..6835e23 100644
@@ -231,8 +231,10 @@
 #define MX27_DMA_REQ_SDHC3	36
 #define MX27_DMA_REQ_NFC	37
 
-#ifndef __ASSEMBLY__
+#ifdef CONFIG_SOC_IMX27
 extern int mx27_revision(void);
+#else
+static int mx27_revision(void) { }
 #endif
 
 #endif /* ifndef __MACH_MX27_H__ */
Signature · 1 line
1.8.1.5