From wookey@wookware.org Thu May 01 03:23:23 2008
Received: from [213.165.225.113] (helo=knossos.aleph1.co.uk ident=Debian-exim)
	by stoneboat.aleph1.co.uk with esmtps
	(TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63)
	(envelope-from <wookey@wookware.org>) id 1JrORz-0000Rz-GU
	for balloon@balloonboard.org; Thu, 01 May 2008 03:23:23 +0100
Received: from wookey by knossos.aleph1.co.uk with local (Exim 4.63)
	(envelope-from <wookey@wookware.org>) id 1JrORm-0000mP-JN
	for balloon@balloonboard.org; Thu, 01 May 2008 03:22:58 +0100
Date: Thu, 1 May 2008 03:22:58 +0100
From: Wookey <wookey@wookware.org>
To: balloon@balloonboard.org
Message-ID: <20080501022258.GD17242@knossos.aleph1.co.uk>
Mail-Followup-To: balloon@balloonboard.org
References: <00f301c8aaf5$b5034920$1f09db60$@com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <00f301c8aaf5$b5034920$1f09db60$@com>
User-Agent: Mutt/1.5.13 (2006-08-11)
X-Aleph_One-MailScanner: Found to be clean
X-Aleph_One-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,
	score=-2.592, required 6, autolearn=not spam, AWL 0.01,
	BAYES_00 -2.60, NO_RELAYS -0.00)
X-Aleph_One-MailScanner-From: wookey@wookware.org
X-SA-Exim-Connect-IP: 213.165.225.113
X-SA-Exim-Mail-From: wookey@wookware.org
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE
	autolearn=no version=3.2.3
X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Subject: Re: [Balloon] Backup Battery, RTC and Deep sleep....
X-BeenThere: balloon@balloonboard.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Balloon List <balloon.balloonboard.org>
List-Unsubscribe: <http://balloonboard.org/mailman/listinfo/balloon>,
	<mailto:balloon-request@balloonboard.org?subject=unsubscribe>
List-Archive: <http://balloonboard.org/lurker/list/balloon.html>
List-Post: <mailto:balloon@balloonboard.org>
List-Help: <mailto:balloon-request@balloonboard.org?subject=help>
List-Subscribe: <http://balloonboard.org/mailman/listinfo/balloon>,
	<mailto:balloon-request@balloonboard.org?subject=subscribe>
X-List-Received-Date: Thu, 01 May 2008 02:23:24 -0000

On 2008-04-30 20:09 +0100, David Bisset wrote:
> 
> Therefore to maintain the RTC registers we need the PXA to enter "Sleep" or
> "Deep Sleep" modes (to reduce the current consumption to a few micro amps
> provided by the backup battery), however this must be done by *software*
> (not by just pulling the power) and there is a strict sequence to follow.
> 
> {We will also need to make sure that all the other bits of the L3 board also
> shut down suitably. However this should happen because nearly everything
> else is powered from VCC_IO which is turned off when the system goes into
> sleep/deep-sleep, but I'm sure there will be things we need to look at.}
> 
> So I need to know how to put the PXA into deep sleep. Is this implemented in
> the kernel power modes?

We have basic pm support - standby and sleep (S1 and S3) (see
Documenation/power/states.txt in the kernel sources).

There is also some device support, but it probably not complete - e.g.
the audio driver resume and suspend functions are null, and should
probably be doing something like turning the audio amp on/off.

> Is there a proc interface (too easy....:-)).

there is a /sys interface in /sys/power/state

echo /sys/power/state enmumerates the available states (we appear to
only have 'mem' or 'sleep to memory - S3' appearing here)

echo "mem" > /sys/power/state puts the balloon into sleep.

That's as far as I've got just now as I don't know how to get it out
again. I guess there is a 'reset, but not too hard' wire to wiggle somewhere?

> Finally can we do voltage scaling?

In principle yes - but there doesn't seem to be any obvious support
for it in the pxa code (there is in strongarm).

> I will configure the next rev of L3 to work both with the backup battery and
> without (may need a link change) but I can't test any of this till we can
> sleep the processor from software.
> 
> Thoughts, comments welcome.

I've built a kernel with power management debug and timer stats
enabled and will see what works tomorrow, along with checking Nick's
new udev-friendly minipug code on hardware that actually has a minipug
attached.

Which of the 10-odd PXA docs has best overview of PM state management?

Wookey
-- 
Principal hats:  Balloonz - Toby Churchill - Aleph One - Debian
http://wookware.org/

