diff options
Diffstat (limited to 'arch/arm/mach-imx/clk-imx51-imx53.c')
-rw-r--r-- | arch/arm/mach-imx/clk-imx51-imx53.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index b8a382defb23..fcd94f3b0f0e 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -31,6 +31,11 @@ static const char *per_lp_apm_sel[] = { "main_bus", "lp_apm", }; | |||
31 | static const char *per_root_sel[] = { "per_podf", "ipg", }; | 31 | static const char *per_root_sel[] = { "per_podf", "ipg", }; |
32 | static const char *esdhc_c_sel[] = { "esdhc_a_podf", "esdhc_b_podf", }; | 32 | static const char *esdhc_c_sel[] = { "esdhc_a_podf", "esdhc_b_podf", }; |
33 | static const char *esdhc_d_sel[] = { "esdhc_a_podf", "esdhc_b_podf", }; | 33 | static const char *esdhc_d_sel[] = { "esdhc_a_podf", "esdhc_b_podf", }; |
34 | static const char *ssi_apm_sels[] = { "ckih1", "lp_amp", "ckih2", }; | ||
35 | static const char *ssi_clk_sels[] = { "pll1_sw", "pll2_sw", "pll3_sw", "ssi_apm", }; | ||
36 | static const char *ssi3_clk_sels[] = { "ssi1_root_gate", "ssi2_root_gate", }; | ||
37 | static const char *ssi_ext1_com_sels[] = { "ssi_ext1_podf", "ssi1_root_gate", }; | ||
38 | static const char *ssi_ext2_com_sels[] = { "ssi_ext2_podf", "ssi2_root_gate", }; | ||
34 | static const char *emi_slow_sel[] = { "main_bus", "ahb", }; | 39 | static const char *emi_slow_sel[] = { "main_bus", "ahb", }; |
35 | static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", }; | 40 | static const char *usb_phy_sel_str[] = { "osc", "usb_phy_podf", }; |
36 | static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", }; | 41 | static const char *mx51_ipu_di0_sel[] = { "di_pred", "osc", "ckih1", "tve_di", }; |
@@ -71,6 +76,11 @@ enum imx5_clks { | |||
71 | pll3_sw, ipu_di0_sel, ipu_di1_sel, tve_ext_sel, mx51_mipi, pll4_sw, | 76 | pll3_sw, ipu_di0_sel, ipu_di1_sel, tve_ext_sel, mx51_mipi, pll4_sw, |
72 | ldb_di1_sel, di_pll4_podf, ldb_di0_sel, ldb_di0_gate, usb_phy1_gate, | 77 | ldb_di1_sel, di_pll4_podf, ldb_di0_sel, ldb_di0_gate, usb_phy1_gate, |
73 | usb_phy2_gate, per_lp_apm, per_pred1, per_pred2, per_podf, per_root, | 78 | usb_phy2_gate, per_lp_apm, per_pred1, per_pred2, per_podf, per_root, |
79 | ssi_apm, ssi1_root_sel, ssi2_root_sel, ssi3_root_sel, ssi_ext1_sel, | ||
80 | ssi_ext2_sel, ssi_ext1_com_sel, ssi_ext2_com_sel, ssi1_root_pred, | ||
81 | ssi1_root_podf, ssi2_root_pred, ssi2_root_podf, ssi_ext1_pred, | ||
82 | ssi_ext1_podf, ssi_ext2_pred, ssi_ext2_podf, ssi1_root_gate, | ||
83 | ssi2_root_gate, ssi3_root_gate, ssi_ext1_gate, ssi_ext2_gate, | ||
74 | clk_max | 84 | clk_max |
75 | }; | 85 | }; |
76 | 86 | ||
@@ -195,6 +205,28 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
195 | clk[uart5_per_gate] = imx_clk_gate2("uart5_per_gate", "uart_root", MXC_CCM_CCGR7, 14); | 205 | clk[uart5_per_gate] = imx_clk_gate2("uart5_per_gate", "uart_root", MXC_CCM_CCGR7, 14); |
196 | clk[gpc_dvfs] = imx_clk_gate2("gpc_dvfs", "dummy", MXC_CCM_CCGR5, 24); | 206 | clk[gpc_dvfs] = imx_clk_gate2("gpc_dvfs", "dummy", MXC_CCM_CCGR5, 24); |
197 | 207 | ||
208 | clk[ssi_apm] = imx_clk_mux("ssi_apm", MXC_CCM_CSCMR1, 8, 2, ssi_apm_sels, ARRAY_SIZE(ssi_apm_sels)); | ||
209 | clk[ssi1_root_sel] = imx_clk_mux("ssi1_root_sel", MXC_CCM_CSCMR1, 14, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels)); | ||
210 | clk[ssi2_root_sel] = imx_clk_mux("ssi2_root_sel", MXC_CCM_CSCMR1, 12, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels)); | ||
211 | clk[ssi3_root_sel] = imx_clk_mux("ssi3_root_sel", MXC_CCM_CSCMR1, 11, 1, ssi3_clk_sels, ARRAY_SIZE(ssi3_clk_sels)); | ||
212 | clk[ssi_ext1_sel] = imx_clk_mux("ssi_ext1_sel", MXC_CCM_CSCMR1, 28, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels)); | ||
213 | clk[ssi_ext2_sel] = imx_clk_mux("ssi_ext2_sel", MXC_CCM_CSCMR1, 30, 2, ssi_clk_sels, ARRAY_SIZE(ssi_clk_sels)); | ||
214 | clk[ssi_ext1_com_sel] = imx_clk_mux("ssi_ext1_com_sel", MXC_CCM_CSCMR1, 0, 1, ssi_ext1_com_sels, ARRAY_SIZE(ssi_ext1_com_sels)); | ||
215 | clk[ssi_ext2_com_sel] = imx_clk_mux("ssi_ext2_com_sel", MXC_CCM_CSCMR1, 1, 1, ssi_ext2_com_sels, ARRAY_SIZE(ssi_ext2_com_sels)); | ||
216 | clk[ssi1_root_pred] = imx_clk_divider("ssi1_root_pred", "ssi1_root_sel", MXC_CCM_CS1CDR, 6, 3); | ||
217 | clk[ssi1_root_podf] = imx_clk_divider("ssi1_root_podf", "ssi1_root_pred", MXC_CCM_CS1CDR, 0, 6); | ||
218 | clk[ssi2_root_pred] = imx_clk_divider("ssi2_root_pred", "ssi2_root_sel", MXC_CCM_CS2CDR, 6, 3); | ||
219 | clk[ssi2_root_podf] = imx_clk_divider("ssi2_root_podf", "ssi2_root_pred", MXC_CCM_CS2CDR, 0, 6); | ||
220 | clk[ssi_ext1_pred] = imx_clk_divider("ssi_ext1_pred", "ssi_ext1_sel", MXC_CCM_CS1CDR, 22, 3); | ||
221 | clk[ssi_ext1_podf] = imx_clk_divider("ssi_ext1_podf", "ssi_ext1_pred", MXC_CCM_CS1CDR, 16, 6); | ||
222 | clk[ssi_ext2_pred] = imx_clk_divider("ssi_ext2_pred", "ssi_ext2_sel", MXC_CCM_CS2CDR, 22, 3); | ||
223 | clk[ssi_ext2_podf] = imx_clk_divider("ssi_ext2_podf", "ssi_ext2_pred", MXC_CCM_CS2CDR, 16, 6); | ||
224 | clk[ssi1_root_gate] = imx_clk_gate2("ssi1_root_gate", "ssi1_root_podf", MXC_CCM_CCGR3, 18); | ||
225 | clk[ssi2_root_gate] = imx_clk_gate2("ssi2_root_gate", "ssi2_root_podf", MXC_CCM_CCGR3, 22); | ||
226 | clk[ssi3_root_gate] = imx_clk_gate2("ssi3_root_gate", "ssi3_root_sel", MXC_CCM_CCGR3, 26); | ||
227 | clk[ssi_ext1_gate] = imx_clk_gate2("ssi_ext1_gate", "ssi_ext1_com_sel", MXC_CCM_CCGR3, 28); | ||
228 | clk[ssi_ext2_gate] = imx_clk_gate2("ssi_ext2_gate", "ssi_ext2_com_sel", MXC_CCM_CCGR3, 30); | ||
229 | |||
198 | for (i = 0; i < ARRAY_SIZE(clk); i++) | 230 | for (i = 0; i < ARRAY_SIZE(clk); i++) |
199 | if (IS_ERR(clk[i])) | 231 | if (IS_ERR(clk[i])) |
200 | pr_err("i.MX5 clk %d: register failed with %ld\n", | 232 | pr_err("i.MX5 clk %d: register failed with %ld\n", |
@@ -237,6 +269,8 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
237 | clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); | 269 | clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "imx-ssi.0"); |
238 | clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); | 270 | clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "imx-ssi.1"); |
239 | clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2"); | 271 | clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "imx-ssi.2"); |
272 | clk_register_clkdev(clk[ssi_ext1_gate], "ssi_ext1", NULL); | ||
273 | clk_register_clkdev(clk[ssi_ext2_gate], "ssi_ext2", NULL); | ||
240 | clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); | 274 | clk_register_clkdev(clk[sdma_gate], NULL, "imx35-sdma"); |
241 | clk_register_clkdev(clk[cpu_podf], "cpu", NULL); | 275 | clk_register_clkdev(clk[cpu_podf], "cpu", NULL); |
242 | clk_register_clkdev(clk[iim_gate], "iim", NULL); | 276 | clk_register_clkdev(clk[iim_gate], "iim", NULL); |
@@ -320,6 +354,9 @@ int __init mx51_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, | |||
320 | clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx51.3"); | 354 | clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx51.3"); |
321 | clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.3"); | 355 | clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx51.3"); |
322 | clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx51.3"); | 356 | clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx51.3"); |
357 | clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "83fcc000.ssi"); | ||
358 | clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "70014000.ssi"); | ||
359 | clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "83fe8000.ssi"); | ||
323 | 360 | ||
324 | /* set the usboh3 parent to pll2_sw */ | 361 | /* set the usboh3 parent to pll2_sw */ |
325 | clk_set_parent(clk[usboh3_sel], clk[pll2_sw]); | 362 | clk_set_parent(clk[usboh3_sel], clk[pll2_sw]); |
@@ -406,6 +443,9 @@ int __init mx53_clocks_init(unsigned long rate_ckil, unsigned long rate_osc, | |||
406 | clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx53.3"); | 443 | clk_register_clkdev(clk[esdhc4_ipg_gate], "ipg", "sdhci-esdhc-imx53.3"); |
407 | clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.3"); | 444 | clk_register_clkdev(clk[dummy], "ahb", "sdhci-esdhc-imx53.3"); |
408 | clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx53.3"); | 445 | clk_register_clkdev(clk[esdhc4_per_gate], "per", "sdhci-esdhc-imx53.3"); |
446 | clk_register_clkdev(clk[ssi1_ipg_gate], NULL, "63fcc000.ssi"); | ||
447 | clk_register_clkdev(clk[ssi2_ipg_gate], NULL, "50014000.ssi"); | ||
448 | clk_register_clkdev(clk[ssi3_ipg_gate], NULL, "63fd0000.ssi"); | ||
409 | 449 | ||
410 | /* set SDHC root clock to 200MHZ*/ | 450 | /* set SDHC root clock to 200MHZ*/ |
411 | clk_set_rate(clk[esdhc_a_podf], 200000000); | 451 | clk_set_rate(clk[esdhc_a_podf], 200000000); |