[PATCH 2/5] arm/mxc: add clk members to ease dt clock support
shawn.guo at freescale.com
Tue Mar 8 03:56:34 UTC 2011
On Mon, Mar 07, 2011 at 10:53:37AM -0700, Grant Likely wrote:
> On Mon, Mar 7, 2011 at 9:22 AM, Shawn Guo <shawn.guo at linaro.org> wrote:
> > The 'rate' is added for fixed-clock support, while 'pll_base' is for
> > pll clock. These two particular type of clocks are supposed to be
> > gracefully supported by the common clk api when it gets ready.
> How does the current imx clock code handle fixed and pll clocks?
For fixed-clock, the current code gets several variables holding the
rate and then return the rate from several get_rate functions.
static unsigned long external_high_reference, external_low_reference;
static unsigned long oscillator_reference, ckih2_reference;
static unsigned long get_high_reference_clock_rate(struct clk *clk)
static unsigned long get_low_reference_clock_rate(struct clk *clk)
static unsigned long get_oscillator_reference_clock_rate(struct clk *clk)
static unsigned long get_ckih2_reference_clock_rate(struct clk *clk)
With this new rate member added, all these can be consolidated into one.
For base address of pll, the current code uses the reference to clocks
statically defined to know which pll is the one.
static inline void __iomem *_mx51_get_pll_base(struct clk *pll)
if (pll == &pll1_main_clk)
else if (pll == &pll2_sw_clk)
else if (pll == &pll3_sw_clk)
static inline void __iomem *_get_pll_base(struct clk *pll)
> Using the dt shouldn't require any special treatment in this regard.
I would say these two members were added to make dt clock code simple
More information about the linaro-dev