aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5/clock-mx51-mx53.c
diff options
context:
space:
mode:
authorYong Shen <yong.shen@linaro.org>2011-01-04 01:22:55 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-04 06:00:23 -0500
commit644b1d586d6670262501057ae99d893fadb012de (patch)
tree429605722f136875036e708c56dde37386bda258 /arch/arm/mach-mx5/clock-mx51-mx53.c
parent96de6d447f40612acb93f81a561a834177cca685 (diff)
ARM i.MX53: Some bug fix about MX53 MSL code
1. pll_base address should return right value 2. uart parent clk is from pll3 Signed-off-by: Yong Shen <yong.shen@linaro.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5/clock-mx51-mx53.c')
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index ba9432c8f843..b21bc47d4827 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -127,7 +127,7 @@ static inline u32 _get_mux(struct clk *parent, struct clk *m0,
127 return -EINVAL; 127 return -EINVAL;
128} 128}
129 129
130static inline void __iomem *_get_pll_base(struct clk *pll) 130static inline void __iomem *_mx51_get_pll_base(struct clk *pll)
131{ 131{
132 if (pll == &pll1_main_clk) 132 if (pll == &pll1_main_clk)
133 return MX51_DPLL1_BASE; 133 return MX51_DPLL1_BASE;
@@ -135,6 +135,20 @@ static inline void __iomem *_get_pll_base(struct clk *pll)
135 return MX51_DPLL2_BASE; 135 return MX51_DPLL2_BASE;
136 else if (pll == &pll3_sw_clk) 136 else if (pll == &pll3_sw_clk)
137 return MX51_DPLL3_BASE; 137 return MX51_DPLL3_BASE;
138 else
139 BUG();
140
141 return NULL;
142}
143
144static inline void __iomem *_mx53_get_pll_base(struct clk *pll)
145{
146 if (pll == &pll1_main_clk)
147 return MX53_DPLL1_BASE;
148 else if (pll == &pll2_sw_clk)
149 return MX53_DPLL2_BASE;
150 else if (pll == &pll3_sw_clk)
151 return MX53_DPLL3_BASE;
138 else if (pll == &mx53_pll4_sw_clk) 152 else if (pll == &mx53_pll4_sw_clk)
139 return MX53_DPLL4_BASE; 153 return MX53_DPLL4_BASE;
140 else 154 else
@@ -143,6 +157,14 @@ static inline void __iomem *_get_pll_base(struct clk *pll)
143 return NULL; 157 return NULL;
144} 158}
145 159
160static inline void __iomem *_get_pll_base(struct clk *pll)
161{
162 if (cpu_is_mx51())
163 return _mx51_get_pll_base(pll);
164 else
165 return _mx53_get_pll_base(pll);
166}
167
146static unsigned long clk_pll_get_rate(struct clk *clk) 168static unsigned long clk_pll_get_rate(struct clk *clk)
147{ 169{
148 long mfi, mfn, mfd, pdf, ref_clk, mfn_abs; 170 long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
@@ -1341,6 +1363,7 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
1341 1363
1342 clk_tree_init(); 1364 clk_tree_init();
1343 1365
1366 clk_set_parent(&uart_root_clk, &pll3_sw_clk);
1344 clk_enable(&cpu_clk); 1367 clk_enable(&cpu_clk);
1345 clk_enable(&main_bus_clk); 1368 clk_enable(&main_bus_clk);
1346 1369