[Letux-kernel] Idle-osc-off questions

H. Nikolaus Schaller hns at goldelico.com
Tue Feb 27 09:01:41 CET 2018


> Am 26.02.2018 um 23:22 schrieb Andreas Kemnade <andreas at kemnade.info>:
> Hi,
> I am stumbling across another thing I do not understand:
> What does this idle-osc-thing really?
> If I understand the code correctly,
>                .compatible = "ti,twl4030-power-idle-osc-off",

Well as usual documentation is a little unspecific:


"does not work on all boards depending on how the external oscillator is wired"
instead of telling how it should be wired to make it work...

> enables this part of the sleep script (in twl4030-power.c)
> which should control the CLKEN pin to power off (tps65950 TRM p. 238)
> the oscillator.

Yes, this is my understanding that it should turn off the oscillator.

> But CLKEN is not connected.
> Then there is the comment in the source
> /* Disable 32 KiHz oscillator during idle */
> which does not make sense. Disabling a 32khz osc?
> Especially since rtc wakeup works.
> Looking at the changes in the schematic, I see that the enable
> pin of that 26Mhz osc is connected to vpll1. According to this line,
> It seems to be switched off in suspend. Switching a 26Mhz osc off when
> it is not
> needed seems to be sane.
> But that rises even more questions.
> VPLL1 out is just connected to a capacitor and the oscillator enable
> pin. But how is that capacitor discharged? Across leakages in the
> oscillator and the internal regulator feedback loop probably. Well,
> if we have discharges around 1uA, then it will go down after some time.

AFAIR this setup was inspired/recommended by the Neo900 schematics.

So probably we have a board where idle-osc-off does not work as expected?

> But the idle-osc-off thing has influences. 
> - some mA lower suspend currents
> - strange behaviour on idle currents
>  -> sometimes even 6mA below the currents in the same state
>     as without idle-osc-off, sometimes up to 20mA higher,
>     generally not worse when everything is loaded than without
>     that osc-off thing.
> - strange behaviour when suspending while charging
>   -> immediate wakeup with strange errors.
> The behaviour feels like floating pins

Well, does it also gate the HFCLK out clock from the twl4030 to the omap3?
Then some subsystems (even the audio part inside the twl4030) may be turned
completely off.

And there may be floating pins. If I remember correctly, Neil did suspect
the ULPI connection for the modem not being pulled down during suspend. 

> or some clown has randomly
> changed some macro parameter order.
> Can someone enlighten me what is going on here?

I have found a very old mail by Russ Dill. Here are some

> Am 21.02.2012 um 04:22 schrieb Russ Dill <russ.dill at gmail.com>:
> On Fri, Feb 17, 2012, Paul Walmsley wrote:
>> The main one that I am thinking about is adding an LDO to control the
>> external HF clock oscillator.  In the TRM, you can find some documentation
>> about this by searching for AUTOEXTCLKMODE.  This can save quite a bit of
>> power when your devices are completely idle, at the cost of wakeup
>> latency.
> On Fri, Feb 17, 2012, NeilBrown wrote:
>> In the GTA04, we have the 26MHz crystal connected to the TWL4030.  It is
>> always on.  So the OMAP3 runs in 'bypass mode'.
>> The crystal has an 'EN' input that is tied high.  Maybe it would be
>> sufficient to tie this to CLKEN output from TWL4030?
> On Beagle, I was able to tie VPLL1 to the enable line of the clock
> rather than using a separate GPIO or enable line. I then turned off
> VPLL1 in the power scripts if I wanted the high speed clock disabled
> (VPLL1 also powers the PLL circuitry of the OMAP). And as you say,
> once the oscillator is disabled, the draw is in the microwatt range.
> On Fri, Feb 17, 2012, Paul Walmsley wrote:
>> Another important thing is to implement TWL5030 or TPS6-whatever scripts
>> to implement voltage scaling in retention and off mode.  It's important to
>> get the TWL/TPS TRM for this to understand how to program the sequencer.
>> That used to be an NDA-only document.  Hopefully it's not any more now
>> that there's an ASP variant of it.  Also see
>> arch/arm/mach-omap2/board-rx51-peripherals.c and
>> drivers/mfd/twl4030-power.c.
> One thing I notice that the GTA04 scripts do not do is utilize is the
> sleep state for power supplies. As long as a certain supply is using
> less than a certain amount of power, it can be configured in a lower
> power state (RES_STATE_SLEEP in the scripts). Also, it becomes much
> easier to manage the script if you group things together rather than
> address them individually. The old omap2 specific twl code had some
> good sample scripts too.

So I read this that the canonical way would be to use CLKEN (idle-off-code)
but using VPLL1 is equally good. And VPLL1 has an internal power consumer
which quickly discharges the capacitor.

Hope this gives some enlightenment.


More information about the Letux-kernel mailing list