Message ID | 87fxbzclyl.fsf@deeprootsystems.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
On Tue, Aug 11, 2009 at 04:31:38, Kevin Hilman wrote: > Sekhar Nori <nsekhar@ti.com> writes: > > > add basic CPUFreq support for DA850/OMAP-L138 > > > > Currently, frequency scaling only on PLL0 is supported. No scaling of PLL1 > > or voltage levels as yet. > > > > Peripherals like MMC/SD which have a clock input synchronous with > > ARM clock will not work well since the clock will change behind their backs. > > Support for notification to such devices to adjust themselves to the > > new frequency will be added in later patches. Current defconfigs keep > > CPUFreq disabled so it will not affect normal operation. > > > > The patch moves Async3 clock source to PLL1 so that frequency scaling > > on PLL0 does not affect those peripherals. Without this the console on UART2 > > goes for a toss the moment CPUFreq kicks in. > > Can you break this change of ASYNC3 modules out into a separate patch? > > Also, I'd rather see this done in a function in da850.c that changes > the parents of these clocks instead of changing them statically. This > way, when other clocks in ASYNC3 are added, this function will need to > be updated. Agreed to this and all other comments on the patch set. Will post updated patches soon. Thanks, Sekhar
On Tue, Aug 11, 2009 at 04:31:38, Kevin Hilman wrote: > Sekhar Nori <nsekhar@ti.com> writes: > > [...] > > +static int da850_set_armrate(struct clk *clk, unsigned long rate) > > +{ > > + [...] > > + /* Propogate new rate */ > > + pllclk->rate = pllclk->parent->rate; > > + pllclk->rate /= prediv; > > + pllclk->rate *= mult; > > + pllclk->rate /= postdiv; > > + > > + /* FIXME: unnecessarily re-calculates rates for PLL1 as well */ > > + davinci_clk_recalc_rates(da850_clks); > > > Hmm, possible update for PATCH 1/3, I'll hold off on pushing 1/3 until > I hear back. > > maybe have another flag in the PLL which says that one of the child > clocks has been changed. Any calls to clk_set_rate() or set_pllrate() > will set that flag in the PLL. If that flag is not set, then > recalc_rates() can check if that flag is set and only recalc rates as > necessary. > Kevin, I implemented this little differently as I thought getting to PLL data for each clock for checking the 'rate changed' flag will incur high runtime overhead during frequency transitions. So, I shifted that computation to init time and now maintain another list of clocks whose rates need to be re-computed when PLL0 rate changes. Thanks, Sekhar
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h index f772e6e..beb96f8 100644 --- a/arch/arm/mach-davinci/clock.h +++ b/arch/arm/mach-davinci/clock.h @@ -79,7 +79,7 @@ struct clk { int (*round_rate) (struct clk *clk, unsigned long rate); }; -/* Clock flags */ +/* Clock flags: SoC-specific flags start at BIT(16) */ #define ALWAYS_ENABLED BIT(1) #define CLK_PSC BIT(2) #define PSC_DSP BIT(3) /* PSC uses DSP domain, not ARM */ diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index fe71f13..ebb90d8 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -31,6 +31,9 @@ #include "clock.h" #include "mux.h" +/* SoC specific clock flags */ +#define DA850_CLK_ASYNC3 BIT(16) + #define DA850_PLL1_BASE 0x01e1a000 #define DA850_TIMER64P2_BASE 0x01f0c000 #define DA850_TIMER64P3_BASE 0x01f0d000