aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cclock44xx_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/cclock44xx_data.c')
-rw-r--r--arch/arm/mach-omap2/cclock44xx_data.c78
1 files changed, 65 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/cclock44xx_data.c b/arch/arm/mach-omap2/cclock44xx_data.c
index aa56c3e5bb34..5789a5e25563 100644
--- a/arch/arm/mach-omap2/cclock44xx_data.c
+++ b/arch/arm/mach-omap2/cclock44xx_data.c
@@ -40,6 +40,14 @@
40#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0 40#define OMAP4430_MODULEMODE_HWCTRL_SHIFT 0
41#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1 41#define OMAP4430_MODULEMODE_SWCTRL_SHIFT 1
42 42
43/*
44 * OMAP4 ABE DPLL default frequency. In OMAP4460 TRM version V, section
45 * "3.6.3.2.3 CM1_ABE Clock Generator" states that the "DPLL_ABE_X2_CLK
46 * must be set to 196.608 MHz" and hence, the DPLL locked frequency is
47 * half of this value.
48 */
49#define OMAP4_DPLL_ABE_DEFFREQ 98304000
50
43/* Root clocks */ 51/* Root clocks */
44 52
45DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0); 53DEFINE_CLK_FIXED_RATE(extalt_clkin_ck, CLK_IS_ROOT, 59000000, 0x0);
@@ -124,6 +132,8 @@ static struct dpll_data dpll_abe_dd = {
124 .enable_mask = OMAP4430_DPLL_EN_MASK, 132 .enable_mask = OMAP4430_DPLL_EN_MASK,
125 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, 133 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
126 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, 134 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
135 .m4xen_mask = OMAP4430_DPLL_REGM4XEN_MASK,
136 .lpmode_mask = OMAP4430_DPLL_LPMODE_EN_MASK,
127 .max_multiplier = 2047, 137 .max_multiplier = 2047,
128 .max_divider = 128, 138 .max_divider = 128,
129 .min_divider = 1, 139 .min_divider = 1,
@@ -233,7 +243,7 @@ static struct dpll_data dpll_core_dd = {
233 243
234 244
235static const char *dpll_core_ck_parents[] = { 245static const char *dpll_core_ck_parents[] = {
236 "sys_clkin_ck", 246 "sys_clkin_ck", "core_hsd_byp_clk_mux_ck"
237}; 247};
238 248
239static struct clk dpll_core_ck; 249static struct clk dpll_core_ck;
@@ -286,9 +296,9 @@ DEFINE_CLK_DIVIDER(div_core_ck, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 0x0,
286 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT, 296 OMAP4430_CM_CLKSEL_CORE, OMAP4430_CLKSEL_CORE_SHIFT,
287 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL); 297 OMAP4430_CLKSEL_CORE_WIDTH, 0x0, NULL);
288 298
289DEFINE_CLK_OMAP_HSDIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", 299DEFINE_CLK_DIVIDER(div_iva_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
290 &dpll_core_m5x2_ck, 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, 300 0x0, OMAP4430_CM_BYPCLK_DPLL_IVA, OMAP4430_CLKSEL_0_1_SHIFT,
291 OMAP4430_CLKSEL_0_1_MASK); 301 OMAP4430_CLKSEL_0_1_WIDTH, CLK_DIVIDER_POWER_OF_TWO, NULL);
292 302
293DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, 303DEFINE_CLK_DIVIDER(div_mpu_hs_clk, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck,
294 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT, 304 0x0, OMAP4430_CM_BYPCLK_DPLL_MPU, OMAP4430_CLKSEL_0_1_SHIFT,
@@ -363,8 +373,21 @@ static struct dpll_data dpll_iva_dd = {
363 .min_divider = 1, 373 .min_divider = 1,
364}; 374};
365 375
376static const char *dpll_iva_ck_parents[] = {
377 "sys_clkin_ck", "iva_hsd_byp_clk_mux_ck"
378};
379
366static struct clk dpll_iva_ck; 380static struct clk dpll_iva_ck;
367 381
382static const struct clk_ops dpll_ck_ops = {
383 .enable = &omap3_noncore_dpll_enable,
384 .disable = &omap3_noncore_dpll_disable,
385 .recalc_rate = &omap3_dpll_recalc,
386 .round_rate = &omap2_dpll_round_rate,
387 .set_rate = &omap3_noncore_dpll_set_rate,
388 .get_parent = &omap2_init_dpll_parent,
389};
390
368static struct clk_hw_omap dpll_iva_ck_hw = { 391static struct clk_hw_omap dpll_iva_ck_hw = {
369 .hw = { 392 .hw = {
370 .clk = &dpll_iva_ck, 393 .clk = &dpll_iva_ck,
@@ -373,7 +396,7 @@ static struct clk_hw_omap dpll_iva_ck_hw = {
373 .ops = &clkhwops_omap3_dpll, 396 .ops = &clkhwops_omap3_dpll,
374}; 397};
375 398
376DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 399DEFINE_STRUCT_CLK(dpll_iva_ck, dpll_iva_ck_parents, dpll_ck_ops);
377 400
378static const char *dpll_iva_x2_ck_parents[] = { 401static const char *dpll_iva_x2_ck_parents[] = {
379 "dpll_iva_ck", 402 "dpll_iva_ck",
@@ -416,6 +439,10 @@ static struct dpll_data dpll_mpu_dd = {
416 .min_divider = 1, 439 .min_divider = 1,
417}; 440};
418 441
442static const char *dpll_mpu_ck_parents[] = {
443 "sys_clkin_ck", "div_mpu_hs_clk"
444};
445
419static struct clk dpll_mpu_ck; 446static struct clk dpll_mpu_ck;
420 447
421static struct clk_hw_omap dpll_mpu_ck_hw = { 448static struct clk_hw_omap dpll_mpu_ck_hw = {
@@ -426,7 +453,7 @@ static struct clk_hw_omap dpll_mpu_ck_hw = {
426 .ops = &clkhwops_omap3_dpll, 453 .ops = &clkhwops_omap3_dpll,
427}; 454};
428 455
429DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 456DEFINE_STRUCT_CLK(dpll_mpu_ck, dpll_mpu_ck_parents, dpll_ck_ops);
430 457
431DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2); 458DEFINE_CLK_FIXED_FACTOR(mpu_periphclk, "dpll_mpu_ck", &dpll_mpu_ck, 0x0, 1, 2);
432 459
@@ -464,6 +491,9 @@ static struct dpll_data dpll_per_dd = {
464 .min_divider = 1, 491 .min_divider = 1,
465}; 492};
466 493
494static const char *dpll_per_ck_parents[] = {
495 "sys_clkin_ck", "per_hsd_byp_clk_mux_ck"
496};
467 497
468static struct clk dpll_per_ck; 498static struct clk dpll_per_ck;
469 499
@@ -475,7 +505,7 @@ static struct clk_hw_omap dpll_per_ck_hw = {
475 .ops = &clkhwops_omap3_dpll, 505 .ops = &clkhwops_omap3_dpll,
476}; 506};
477 507
478DEFINE_STRUCT_CLK(dpll_per_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 508DEFINE_STRUCT_CLK(dpll_per_ck, dpll_per_ck_parents, dpll_ck_ops);
479 509
480DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0, 510DEFINE_CLK_DIVIDER(dpll_per_m2_ck, "dpll_per_ck", &dpll_per_ck, 0x0,
481 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT, 511 OMAP4430_CM_DIV_M2_DPLL_PER, OMAP4430_DPLL_CLKOUT_DIV_SHIFT,
@@ -559,6 +589,10 @@ static struct dpll_data dpll_usb_dd = {
559 .min_divider = 1, 589 .min_divider = 1,
560}; 590};
561 591
592static const char *dpll_usb_ck_parents[] = {
593 "sys_clkin_ck", "usb_hs_clk_div_ck"
594};
595
562static struct clk dpll_usb_ck; 596static struct clk dpll_usb_ck;
563 597
564static struct clk_hw_omap dpll_usb_ck_hw = { 598static struct clk_hw_omap dpll_usb_ck_hw = {
@@ -569,7 +603,7 @@ static struct clk_hw_omap dpll_usb_ck_hw = {
569 .ops = &clkhwops_omap3_dpll, 603 .ops = &clkhwops_omap3_dpll,
570}; 604};
571 605
572DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_core_ck_parents, dpll_abe_ck_ops); 606DEFINE_STRUCT_CLK(dpll_usb_ck, dpll_usb_ck_parents, dpll_ck_ops);
573 607
574static const char *dpll_usb_clkdcoldo_ck_parents[] = { 608static const char *dpll_usb_clkdcoldo_ck_parents[] = {
575 "dpll_usb_ck", 609 "dpll_usb_ck",
@@ -696,9 +730,13 @@ DEFINE_CLK_DIVIDER(syc_clk_div_ck, "sys_clkin_ck", &sys_clkin_ck, 0x0,
696 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT, 730 OMAP4430_CM_ABE_DSS_SYS_CLKSEL, OMAP4430_CLKSEL_0_0_SHIFT,
697 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL); 731 OMAP4430_CLKSEL_0_0_WIDTH, 0x0, NULL);
698 732
733static const char *dbgclk_mux_ck_parents[] = {
734 "sys_clkin_ck"
735};
736
699static struct clk dbgclk_mux_ck; 737static struct clk dbgclk_mux_ck;
700DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL); 738DEFINE_STRUCT_CLK_HW_OMAP(dbgclk_mux_ck, NULL);
701DEFINE_STRUCT_CLK(dbgclk_mux_ck, dpll_core_ck_parents, 739DEFINE_STRUCT_CLK(dbgclk_mux_ck, dbgclk_mux_ck_parents,
702 dpll_usb_clkdcoldo_ck_ops); 740 dpll_usb_clkdcoldo_ck_ops);
703 741
704/* Leaf clocks controlled by modules */ 742/* Leaf clocks controlled by modules */
@@ -1935,10 +1973,10 @@ static struct omap_clk omap44xx_clks[] = {
1935 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X), 1973 CLK("4803e000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1936 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X), 1974 CLK("48086000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1937 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X), 1975 CLK("48088000.timer", "timer_sys_ck", &sys_clkin_ck, CK_443X),
1938 CLK("49038000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1976 CLK("40138000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1939 CLK("4903a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1977 CLK("4013a000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1940 CLK("4903c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1978 CLK("4013c000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1941 CLK("4903e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X), 1979 CLK("4013e000.timer", "timer_sys_ck", &syc_clk_div_ck, CK_443X),
1942 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X), 1980 CLK(NULL, "cpufreq_ck", &dpll_mpu_ck, CK_443X),
1943}; 1981};
1944 1982
@@ -1955,6 +1993,7 @@ int __init omap4xxx_clk_init(void)
1955{ 1993{
1956 u32 cpu_clkflg; 1994 u32 cpu_clkflg;
1957 struct omap_clk *c; 1995 struct omap_clk *c;
1996 int rc;
1958 1997
1959 if (cpu_is_omap443x()) { 1998 if (cpu_is_omap443x()) {
1960 cpu_mask = RATE_IN_4430; 1999 cpu_mask = RATE_IN_4430;
@@ -1983,5 +2022,18 @@ int __init omap4xxx_clk_init(void)
1983 omap2_clk_enable_init_clocks(enable_init_clks, 2022 omap2_clk_enable_init_clocks(enable_init_clks,
1984 ARRAY_SIZE(enable_init_clks)); 2023 ARRAY_SIZE(enable_init_clks));
1985 2024
2025 /*
2026 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
2027 * state when turning the ABE clock domain. Workaround this by
2028 * locking the ABE DPLL on boot.
2029 */
2030 if (cpu_is_omap446x()) {
2031 rc = clk_set_parent(&abe_dpll_refclk_mux_ck, &sys_32k_ck);
2032 if (!rc)
2033 rc = clk_set_rate(&dpll_abe_ck, OMAP4_DPLL_ABE_DEFFREQ);
2034 if (rc)
2035 pr_err("%s: failed to configure ABE DPLL!\n", __func__);
2036 }
2037
1986 return 0; 2038 return 0;
1987} 2039}