Skip to content

Commit

Permalink
ARM i.MX53: Some bug fix about MX53 MSL code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yong Shen authored and Sascha Hauer committed Jan 4, 2011
1 parent 96de6d4 commit 644b1d5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
25 changes: 24 additions & 1 deletion arch/arm/mach-mx5/clock-mx51-mx53.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,28 @@ static inline u32 _get_mux(struct clk *parent, struct clk *m0,
return -EINVAL;
}

static inline void __iomem *_get_pll_base(struct clk *pll)
static inline void __iomem *_mx51_get_pll_base(struct clk *pll)
{
if (pll == &pll1_main_clk)
return MX51_DPLL1_BASE;
else if (pll == &pll2_sw_clk)
return MX51_DPLL2_BASE;
else if (pll == &pll3_sw_clk)
return MX51_DPLL3_BASE;
else
BUG();

return NULL;
}

static inline void __iomem *_mx53_get_pll_base(struct clk *pll)
{
if (pll == &pll1_main_clk)
return MX53_DPLL1_BASE;
else if (pll == &pll2_sw_clk)
return MX53_DPLL2_BASE;
else if (pll == &pll3_sw_clk)
return MX53_DPLL3_BASE;
else if (pll == &mx53_pll4_sw_clk)
return MX53_DPLL4_BASE;
else
Expand All @@ -143,6 +157,14 @@ static inline void __iomem *_get_pll_base(struct clk *pll)
return NULL;
}

static inline void __iomem *_get_pll_base(struct clk *pll)
{
if (cpu_is_mx51())
return _mx51_get_pll_base(pll);
else
return _mx53_get_pll_base(pll);
}

static unsigned long clk_pll_get_rate(struct clk *clk)
{
long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
Expand Down Expand Up @@ -1341,6 +1363,7 @@ int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,

clk_tree_init();

clk_set_parent(&uart_root_clk, &pll3_sw_clk);
clk_enable(&cpu_clk);
clk_enable(&main_bus_clk);

Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-mx5/crm_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR)

/*MX53*/
#define MX53_CCM_BASE MX53_IO_ADDRESS(MX53_CCM_BASE_ADDR)
#define MX53_DPLL1_BASE MX53_IO_ADDRESS(MX53_PLL1_BASE_ADDR)
#define MX53_DPLL2_BASE MX53_IO_ADDRESS(MX53_PLL2_BASE_ADDR)
#define MX53_DPLL3_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR)
#define MX53_DPLL4_BASE MX53_IO_ADDRESS(MX53_PLL3_BASE_ADDR)

/* PLL Register Offsets */
Expand Down

0 comments on commit 644b1d5

Please sign in to comment.