17 #include <mach/hardware.h>
18 #include <mach/common.h>
24 static const char *lp_apm_sel[] = {
"osc", };
27 static const char *standard_pll_sel[] = {
"pll1_sw",
"pll2_sw",
"pll3_sw",
"lp_apm", };
28 static const char *periph_apm_sel[] = {
"pll1_sw",
"pll3_sw",
"lp_apm", };
29 static const char *main_bus_sel[] = {
"pll2_sw",
"periph_apm", };
30 static const char *per_lp_apm_sel[] = {
"main_bus",
"lp_apm", };
31 static const char *per_root_sel[] = {
"per_podf",
"ipg", };
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", };
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", };
39 static const char *
emi_slow_sel[] = {
"main_bus",
"ahb", };
40 static const char *usb_phy_sel_str[] = {
"osc",
"usb_phy_podf", };
41 static const char *mx51_ipu_di0_sel[] = {
"di_pred",
"osc",
"ckih1",
"tve_di", };
42 static const char *mx53_ipu_di0_sel[] = {
"di_pred",
"osc",
"ckih1",
"di_pll4_podf",
"dummy",
"ldb_di0_gate", };
43 static const char *mx53_ldb_di0_sel[] = {
"pll3_sw",
"pll4_sw", };
44 static const char *mx51_ipu_di1_sel[] = {
"di_pred",
"osc",
"ckih1",
"tve_di",
"ipp_di1", };
45 static const char *mx53_ipu_di1_sel[] = {
"di_pred",
"osc",
"ckih1",
"tve_di",
"ipp_di1",
"ldb_di1_gate", };
46 static const char *mx53_ldb_di1_sel[] = {
"pll3_sw",
"pll4_sw", };
47 static const char *mx51_tve_ext_sel[] = {
"osc",
"ckih1", };
48 static const char *mx53_tve_ext_sel[] = {
"pll4_sw",
"ckih1", };
49 static const char *tve_sel[] = {
"tve_pred",
"tve_ext_sel", };
50 static const char *ipu_sel[] = {
"axi_a",
"axi_b",
"emi_slow_gate",
"ahb", };
51 static const char *
vpu_sel[] = {
"axi_a",
"axi_b",
"emi_slow_gate",
"ahb", };
52 static const char *mx53_can_sel[] = {
"ipg",
"ckih1",
"ckih2",
"lp_apm", };
55 dummy,
ckil,
osc,
ckih1,
ckih2,
ahb,
ipg,
axi_a,
axi_b,
uart_pred,
92 static void __init mx5_clocks_common_init(
unsigned long rate_ckil,
93 unsigned long rate_osc,
unsigned long rate_ckih1,
94 unsigned long rate_ckih2)
98 clk[
dummy] = imx_clk_fixed(
"dummy", 0);
99 clk[
ckil] = imx_clk_fixed(
"ckil", rate_ckil);
100 clk[
osc] = imx_clk_fixed(
"osc", rate_osc);
101 clk[
ckih1] = imx_clk_fixed(
"ckih1", rate_ckih1);
102 clk[
ckih2] = imx_clk_fixed(
"ckih2", rate_ckih2);
129 standard_pll_sel,
ARRAY_SIZE(standard_pll_sel));
134 standard_pll_sel,
ARRAY_SIZE(standard_pll_sel));
136 standard_pll_sel,
ARRAY_SIZE(standard_pll_sel));
149 standard_pll_sel,
ARRAY_SIZE(standard_pll_sel));
153 standard_pll_sel,
ARRAY_SIZE(standard_pll_sel));
159 usb_phy_sel_str,
ARRAY_SIZE(usb_phy_sel_str));
162 clk[
tve_di] = imx_clk_fixed(
"tve_di", 65000000);
239 pr_err(
"i.MX5 clk %d: register failed with %ld\n",
302 clk_prepare_enable(clk[gpc_dvfs]);
303 clk_prepare_enable(clk[
ahb_max]);
306 clk_prepare_enable(clk[
spba]);
309 clk_prepare_enable(clk[
tmax1]);
310 clk_prepare_enable(clk[
tmax2]);
311 clk_prepare_enable(clk[
tmax3]);
315 unsigned long rate_ckih1,
unsigned long rate_ckih2)
323 mx51_ipu_di0_sel,
ARRAY_SIZE(mx51_ipu_di0_sel));
325 mx51_ipu_di1_sel,
ARRAY_SIZE(mx51_ipu_di1_sel));
327 mx51_tve_ext_sel,
ARRAY_SIZE(mx51_tve_ext_sel));
343 pr_err(
"i.MX51 clk %d: register failed with %ld\n",
346 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
386 clk_disable_unprepare(clk[iim_gate]);
392 unsigned long rate_ckih1,
unsigned long rate_ckih2)
403 mx53_ldb_di1_sel,
ARRAY_SIZE(mx53_ldb_di1_sel));
404 clk[
ldb_di1_div_3_5] = imx_clk_fixed_factor(
"ldb_di1_div_3_5",
"ldb_di1_sel", 2, 7);
408 mx53_ldb_di0_sel,
ARRAY_SIZE(mx53_ldb_di0_sel));
409 clk[
ldb_di0_div_3_5] = imx_clk_fixed_factor(
"ldb_di0_div_3_5",
"ldb_di0_sel", 2, 7);
414 mx53_ipu_di0_sel,
ARRAY_SIZE(mx53_ipu_di0_sel));
416 mx53_ipu_di1_sel,
ARRAY_SIZE(mx53_ipu_di1_sel));
418 mx53_tve_ext_sel,
ARRAY_SIZE(mx53_tve_ext_sel));
437 pr_err(
"i.MX53 clk %d: register failed with %ld\n",
440 mx5_clocks_common_init(rate_ckil, rate_osc, rate_ckih1, rate_ckih2);
480 clk_disable_unprepare(clk[iim_gate]);
489 static void __init clk_get_freq_dt(
unsigned long *
ckil,
unsigned long *
osc,
495 for_each_compatible_node(np,
NULL,
"fixed-clock") {
497 if (of_property_read_u32(np,
"clock-frequency", &rate))
515 clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);
523 clk_get_freq_dt(&ckil, &osc, &ckih1, &ckih2);