diff options
author | Rajendra Nayak <rnayak@ti.com> | 2009-12-08 20:47:17 -0500 |
---|---|---|
committer | paul <paul@twilight.(none)> | 2009-12-11 19:00:47 -0500 |
commit | 911bd7395c4aa4e74b13aab790ca1500c59fae02 (patch) | |
tree | 6fdca6b205015558663dcfa523f87d6c6ffa7afa /arch/arm | |
parent | 16975a79c8e6ee424331f52649f2351d33c7b972 (diff) |
ARM: OMAP4: PM: Add init api for DPLL nodes
An api at init for all dpll nodes seem to be
needed to reparent the dpll clk node to its
bypass clk in case the dpll is in bypass.
If not done this causes sequencing issues at init
during propogate_rate.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 34 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock44xx_data.c | 7 |
3 files changed, 41 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 61ee23596ea8..759c72a48f7f 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -70,9 +70,41 @@ | |||
70 | u8 cpu_mask; | 70 | u8 cpu_mask; |
71 | 71 | ||
72 | /*------------------------------------------------------------------------- | 72 | /*------------------------------------------------------------------------- |
73 | * OMAP2/3 specific clock functions | 73 | * OMAP2/3/4 specific clock functions |
74 | *-------------------------------------------------------------------------*/ | 74 | *-------------------------------------------------------------------------*/ |
75 | 75 | ||
76 | void omap2_init_dpll_parent(struct clk *clk) | ||
77 | { | ||
78 | u32 v; | ||
79 | struct dpll_data *dd; | ||
80 | |||
81 | dd = clk->dpll_data; | ||
82 | if (!dd) | ||
83 | return; | ||
84 | |||
85 | /* Return bypass rate if DPLL is bypassed */ | ||
86 | v = __raw_readl(dd->control_reg); | ||
87 | v &= dd->enable_mask; | ||
88 | v >>= __ffs(dd->enable_mask); | ||
89 | |||
90 | /* Reparent in case the dpll is in bypass */ | ||
91 | if (cpu_is_omap24xx()) { | ||
92 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
93 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
94 | clk_reparent(clk, dd->clk_bypass); | ||
95 | } else if (cpu_is_omap34xx()) { | ||
96 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
97 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
98 | clk_reparent(clk, dd->clk_bypass); | ||
99 | } else if (cpu_is_omap44xx()) { | ||
100 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
101 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
102 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
103 | clk_reparent(clk, dd->clk_bypass); | ||
104 | } | ||
105 | return; | ||
106 | } | ||
107 | |||
76 | /** | 108 | /** |
77 | * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware | 109 | * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware |
78 | * @clk: struct clk * | 110 | * @clk: struct clk * |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 8418f3a22e60..93c48df3b5b1 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -82,6 +82,7 @@ unsigned long omap2_fixed_divisor_recalc(struct clk *clk); | |||
82 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); | 82 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); |
83 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); | 83 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); |
84 | u32 omap2_get_dpll_rate(struct clk *clk); | 84 | u32 omap2_get_dpll_rate(struct clk *clk); |
85 | void omap2_init_dpll_parent(struct clk *clk); | ||
85 | int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); | 86 | int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); |
86 | void omap2_clk_prepare_for_reboot(void); | 87 | void omap2_clk_prepare_for_reboot(void); |
87 | int omap2_dflt_clk_enable(struct clk *clk); | 88 | int omap2_dflt_clk_enable(struct clk *clk); |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 9ae526ee0daf..2210e227d78a 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -278,6 +278,7 @@ static struct clk dpll_abe_ck = { | |||
278 | .name = "dpll_abe_ck", | 278 | .name = "dpll_abe_ck", |
279 | .parent = &abe_dpll_refclk_mux_ck, | 279 | .parent = &abe_dpll_refclk_mux_ck, |
280 | .dpll_data = &dpll_abe_dd, | 280 | .dpll_data = &dpll_abe_dd, |
281 | .init = &omap2_init_dpll_parent, | ||
281 | .ops = &clkops_noncore_dpll_ops, | 282 | .ops = &clkops_noncore_dpll_ops, |
282 | .recalc = &omap3_dpll_recalc, | 283 | .recalc = &omap3_dpll_recalc, |
283 | .round_rate = &omap2_dpll_round_rate, | 284 | .round_rate = &omap2_dpll_round_rate, |
@@ -439,6 +440,7 @@ static struct clk dpll_core_ck = { | |||
439 | .name = "dpll_core_ck", | 440 | .name = "dpll_core_ck", |
440 | .parent = &dpll_sys_ref_clk, | 441 | .parent = &dpll_sys_ref_clk, |
441 | .dpll_data = &dpll_core_dd, | 442 | .dpll_data = &dpll_core_dd, |
443 | .init = &omap2_init_dpll_parent, | ||
442 | .ops = &clkops_null, | 444 | .ops = &clkops_null, |
443 | .recalc = &omap3_dpll_recalc, | 445 | .recalc = &omap3_dpll_recalc, |
444 | .flags = CLOCK_IN_OMAP4430, | 446 | .flags = CLOCK_IN_OMAP4430, |
@@ -665,6 +667,7 @@ static struct clk dpll_iva_ck = { | |||
665 | .name = "dpll_iva_ck", | 667 | .name = "dpll_iva_ck", |
666 | .parent = &dpll_sys_ref_clk, | 668 | .parent = &dpll_sys_ref_clk, |
667 | .dpll_data = &dpll_iva_dd, | 669 | .dpll_data = &dpll_iva_dd, |
670 | .init = &omap2_init_dpll_parent, | ||
668 | .ops = &clkops_noncore_dpll_ops, | 671 | .ops = &clkops_noncore_dpll_ops, |
669 | .recalc = &omap3_dpll_recalc, | 672 | .recalc = &omap3_dpll_recalc, |
670 | .round_rate = &omap2_dpll_round_rate, | 673 | .round_rate = &omap2_dpll_round_rate, |
@@ -727,6 +730,7 @@ static struct clk dpll_mpu_ck = { | |||
727 | .name = "dpll_mpu_ck", | 730 | .name = "dpll_mpu_ck", |
728 | .parent = &dpll_sys_ref_clk, | 731 | .parent = &dpll_sys_ref_clk, |
729 | .dpll_data = &dpll_mpu_dd, | 732 | .dpll_data = &dpll_mpu_dd, |
733 | .init = &omap2_init_dpll_parent, | ||
730 | .ops = &clkops_noncore_dpll_ops, | 734 | .ops = &clkops_noncore_dpll_ops, |
731 | .recalc = &omap3_dpll_recalc, | 735 | .recalc = &omap3_dpll_recalc, |
732 | .round_rate = &omap2_dpll_round_rate, | 736 | .round_rate = &omap2_dpll_round_rate, |
@@ -802,6 +806,7 @@ static struct clk dpll_per_ck = { | |||
802 | .name = "dpll_per_ck", | 806 | .name = "dpll_per_ck", |
803 | .parent = &dpll_sys_ref_clk, | 807 | .parent = &dpll_sys_ref_clk, |
804 | .dpll_data = &dpll_per_dd, | 808 | .dpll_data = &dpll_per_dd, |
809 | .init = &omap2_init_dpll_parent, | ||
805 | .ops = &clkops_noncore_dpll_ops, | 810 | .ops = &clkops_noncore_dpll_ops, |
806 | .recalc = &omap3_dpll_recalc, | 811 | .recalc = &omap3_dpll_recalc, |
807 | .round_rate = &omap2_dpll_round_rate, | 812 | .round_rate = &omap2_dpll_round_rate, |
@@ -924,6 +929,7 @@ static struct clk dpll_unipro_ck = { | |||
924 | .name = "dpll_unipro_ck", | 929 | .name = "dpll_unipro_ck", |
925 | .parent = &dpll_sys_ref_clk, | 930 | .parent = &dpll_sys_ref_clk, |
926 | .dpll_data = &dpll_unipro_dd, | 931 | .dpll_data = &dpll_unipro_dd, |
932 | .init = &omap2_init_dpll_parent, | ||
927 | .ops = &clkops_noncore_dpll_ops, | 933 | .ops = &clkops_noncore_dpll_ops, |
928 | .recalc = &omap3_dpll_recalc, | 934 | .recalc = &omap3_dpll_recalc, |
929 | .round_rate = &omap2_dpll_round_rate, | 935 | .round_rate = &omap2_dpll_round_rate, |
@@ -981,6 +987,7 @@ static struct clk dpll_usb_ck = { | |||
981 | .name = "dpll_usb_ck", | 987 | .name = "dpll_usb_ck", |
982 | .parent = &dpll_sys_ref_clk, | 988 | .parent = &dpll_sys_ref_clk, |
983 | .dpll_data = &dpll_usb_dd, | 989 | .dpll_data = &dpll_usb_dd, |
990 | .init = &omap2_init_dpll_parent, | ||
984 | .ops = &clkops_noncore_dpll_ops, | 991 | .ops = &clkops_noncore_dpll_ops, |
985 | .recalc = &omap3_dpll_recalc, | 992 | .recalc = &omap3_dpll_recalc, |
986 | .round_rate = &omap2_dpll_round_rate, | 993 | .round_rate = &omap2_dpll_round_rate, |