diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2014-03-11 14:55:46 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@freescale.com> | 2014-05-16 10:51:34 -0400 |
commit | 46ae42498ef6febdaa6b51359f1ede38cd6b5a47 (patch) | |
tree | 832ebfc269f8a197c7047f7d0003af1c25c8ac42 /arch/arm/mach-imx | |
parent | d559cecc7700e0a1335b075068fcff70e72e96a4 (diff) |
ARM: mx25: Add CLKO support
CLKO support is a clock output on mx25 which can output many of the internal
clock sources. It is useful for debugging purpose or also for driving the
audio codec for example.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/clk-imx25.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index 269c4d47630e..ae578c096ad8 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
@@ -62,6 +62,10 @@ static struct clk_onecell_data clk_data; | |||
62 | 62 | ||
63 | static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", }; | 63 | static const char *cpu_sel_clks[] = { "mpll", "mpll_cpu_3_4", }; |
64 | static const char *per_sel_clks[] = { "ahb", "upll", }; | 64 | static const char *per_sel_clks[] = { "ahb", "upll", }; |
65 | static const char *cko_sel_clks[] = { "dummy", "osc", "cpu", "ahb", | ||
66 | "ipg", "dummy", "dummy", "dummy", | ||
67 | "dummy", "dummy", "per0", "per2", | ||
68 | "per13", "per14", "usbotg_ahb", "dummy",}; | ||
65 | 69 | ||
66 | enum mx25_clks { | 70 | enum mx25_clks { |
67 | dummy, osc, mpll, upll, mpll_cpu_3_4, cpu_sel, cpu, ahb, usb_div, ipg, | 71 | dummy, osc, mpll, upll, mpll_cpu_3_4, cpu_sel, cpu, ahb, usb_div, ipg, |
@@ -82,7 +86,7 @@ enum mx25_clks { | |||
82 | pwm2_ipg, pwm3_ipg, pwm4_ipg, rngb_ipg, reserved16, scc_ipg, sdma_ipg, | 86 | pwm2_ipg, pwm3_ipg, pwm4_ipg, rngb_ipg, reserved16, scc_ipg, sdma_ipg, |
83 | sim1_ipg, sim2_ipg, slcdc_ipg, spba_ipg, ssi1_ipg, ssi2_ipg, tsc_ipg, | 87 | sim1_ipg, sim2_ipg, slcdc_ipg, spba_ipg, ssi1_ipg, ssi2_ipg, tsc_ipg, |
84 | uart1_ipg, uart2_ipg, uart3_ipg, uart4_ipg, uart5_ipg, reserved17, | 88 | uart1_ipg, uart2_ipg, uart3_ipg, uart4_ipg, uart5_ipg, reserved17, |
85 | wdt_ipg, clk_max | 89 | wdt_ipg, cko_div, cko_sel, cko, clk_max |
86 | }; | 90 | }; |
87 | 91 | ||
88 | static struct clk *clk[clk_max]; | 92 | static struct clk *clk[clk_max]; |
@@ -117,6 +121,9 @@ static int __init __mx25_clocks_init(unsigned long osc_rate) | |||
117 | clk[per13_sel] = imx_clk_mux("per13_sel", ccm(CCM_MCR), 13, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks)); | 121 | clk[per13_sel] = imx_clk_mux("per13_sel", ccm(CCM_MCR), 13, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks)); |
118 | clk[per14_sel] = imx_clk_mux("per14_sel", ccm(CCM_MCR), 14, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks)); | 122 | clk[per14_sel] = imx_clk_mux("per14_sel", ccm(CCM_MCR), 14, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks)); |
119 | clk[per15_sel] = imx_clk_mux("per15_sel", ccm(CCM_MCR), 15, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks)); | 123 | clk[per15_sel] = imx_clk_mux("per15_sel", ccm(CCM_MCR), 15, 1, per_sel_clks, ARRAY_SIZE(per_sel_clks)); |
124 | clk[cko_div] = imx_clk_divider("cko_div", "cko_sel", ccm(CCM_MCR), 24, 6); | ||
125 | clk[cko_sel] = imx_clk_mux("cko_sel", ccm(CCM_MCR), 20, 4, cko_sel_clks, ARRAY_SIZE(cko_sel_clks)); | ||
126 | clk[cko] = imx_clk_gate("cko", "cko_div", ccm(CCM_MCR), 30); | ||
120 | clk[per0] = imx_clk_divider("per0", "per0_sel", ccm(CCM_PCDR0), 0, 6); | 127 | clk[per0] = imx_clk_divider("per0", "per0_sel", ccm(CCM_PCDR0), 0, 6); |
121 | clk[per1] = imx_clk_divider("per1", "per1_sel", ccm(CCM_PCDR0), 8, 6); | 128 | clk[per1] = imx_clk_divider("per1", "per1_sel", ccm(CCM_PCDR0), 8, 6); |
122 | clk[per2] = imx_clk_divider("per2", "per2_sel", ccm(CCM_PCDR0), 16, 6); | 129 | clk[per2] = imx_clk_divider("per2", "per2_sel", ccm(CCM_PCDR0), 16, 6); |
@@ -230,6 +237,12 @@ static int __init __mx25_clocks_init(unsigned long osc_rate) | |||
230 | clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); | 237 | clk_register_clkdev(clk[ipg], "ipg", "imx-gpt.0"); |
231 | clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); | 238 | clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); |
232 | 239 | ||
240 | /* | ||
241 | * Let's initially set up CLKO parent as ipg, since this configuration | ||
242 | * is used on some imx25 board designs to clock the audio codec. | ||
243 | */ | ||
244 | clk_set_parent(clk[cko_sel], clk[ipg]); | ||
245 | |||
233 | return 0; | 246 | return 0; |
234 | } | 247 | } |
235 | 248 | ||