Search by Tags

Suspend registry settings

 

Compare with Revision




Subscribe for this article updates

Wakeup Sources

The Colibri modules support to configure the events that wake up the system from suspend. The following table explains the required registry settings in [HKLM\System\PM\Suspend].

[HKLM\System\PM\Suspend] PXA270 PXA300 PXA310 PXA320 T20 VF50/61 Description
WakeupSources = sodimm` x x x x Pins on SODIMM connnector
WakeupSources = pin<pin><condition> x x Pins on SODIMM connector
WakeupSources = extconn<pin><condition> x x x x Pins on Extension Connector (X3)
WakeupSources = gpio<io><condition> x x x x GPIOs
WakeupSources = rtc x x x x x x internal RTC
WakeupSources = touch x x x x x touch screen

<pin> is an SODIMM pin number
<io> is a GPIO number
<condition> is a wakeup condition defined in the table below

Condition Description PXA270 PXA300 PXA310 PXA320 T20 VF50/60
r rising edge x x x x x
f falling edge x x x x x
rf any edge x x x x
l low level x
h high level x
t toggling x

Information about which pins support wakeup functionality can be found in the PXA Datasheet and in the article Wakeup sources.

Examples:

[HKLM\System\PM\Suspend]
"WakeupSources" = "sodimm69r,sodimm30rf"
"WakeupSources" = "extconn2r"
"WakeupSources" = "gpio0rf,gpio14rf"
"WakeupSources" = "RTC,TOUCH,pin43h"
 
"WakeupSources" = "rtc, touch, sodimm43rf, sodimm63rf, sodimm69rf" ; this is the default on all Colibri PXAxxx modules
"WakeupSources" = "rtc" ; this is the default on Colibri T20, Image V1.1Beta4. This is subject to change.

Real Time Clock as a Wakeup Source

The example below shows how to wake up the system at a specific time. Please note that the alarm must be set at least 11 seconds ahead of current system time. Otherwise the alarm will be ignored by the system.

BOOL SuspendResumeAfter(int sec)
{
    SYSTEMTIME  st;
    FILETIME    ft;             
    CE_USER_NOTIFICATION un = {0};
 
    // add 20 seconds to the current time
    GetLocalTime(&st);
    SystemTimeToFileTime(&st, &ft); 
    (*((DWORD64*)&ft)) += 10000000 * sec;   // 1 unit = 100ns
    FileTimeToSystemTime(&ft, &st);
 
    // setup alarm at least 11sec in the future
    if(!CeSetUserNotification(NULL, L"", &st, &un))  
        return FALSE;
 
    // enter suspend mode
    if(SetSystemPowerState(NULL, POWER_STATE_SUSPEND, POWER_FORCE))  
         return FALSE;
 
    return TRUE;
}

Pin Level During Suspend

The pin levels of SODIMM pins during suspend mode can be defined by registry settings.

[HKLM\System\PM\Suspend] PXA270 PXA300 PXA310 PXA320 Description
PinStates = sodimm<pin><level> x x x x Pins on SODIMM connnector
PinStates = extconn<pin><level> x x x x Pins on Extension connector (X3)
PinStates = gpio<io><level> x GPIOs

<pin> is an SODIMM pin number
<io> is a GPIO number
<level> is a level defined in the table below

Level Description PXA270 PXA300 PXA310 PXA320
o0 Output Low x x x x
o1 Output High x x x x
p0 pulldown 40k to 200k x x x
p1 pullup 40k to 200k x x x
z high impedance (input) x x x x

Examples:

[HKLM\System\PM\Suspend]
"PinStates" = "sodimm55o1,sodimm63z,sodimm49p1"   ; defining SODIMM pin states
"PinStates" = "extconn1o,extconn2z,extconn6p0"    ; defining X3 pin states
"PinStates" = "gpio11o1,gpio16z"                  ; defining GPIO pin states

The default settings for Colibri PXA270 are: PCCard pins and Chipselects are set to high impedance. All other GPIOs preserve the level they had before entering suspend mode.

Timers to Change Power States

Automatic changes of the power states (e.g. transition to idle mode) is controlled by activity timers.

These timeouts are stored in the registry. They can be changed by either modifying the registry, or using the Power control panel applet. The registry values are given in seconds. There are two sets of timeouts - one for battery operation, one for AC operation.

[HKLM\System\CurrentControlSet\Control\Power\Timeouts]
"ACUserIdle"    = dword:600
"ACSystemIdle"  = dword:600
"ACSuspend"     = dword:600
"BattUserIdle"  = dword:300
"BattSystemIdle"= dword:300
"BattSuspend"   = dword:300

Changing the registry values has no immediate effect. To reload the registry settings into the power manager, you need to create a particular named event, and set it:

{
...
Evt = CreateEvent(NULL, FALSE, FALSE, _T("PowerManager/ReloadActivityTimeouts"));
...
SetEvent(Evt);
...
}

PXA's internal SRAM

By default, the PXA's internal SRAM is powered off in suspend mode. In order to keep the SRAM contents through suspend, the following registry value needs to be set:

[HKLM\System\PM\Suspend]
"RetainSRAM"    = dword:0   ;define SRAM Banks to be retained. Default = 0 = do not retain any SRAM

The following values are valid for RetainSRAM:

CPU Values to
retain all SRAM
Values to
power off SRAM
PXA270 0x0f 0x00
PXA300 / PXA310 0x09 0x00
PXA320 0x3f 0x00

Other values are possible to retain only selected memory banks. Please refer to the register description of registers PSLR (PXA270) and AD3R (PXA3xx).

Update Suspend Settings at Runtime

This feature is supported on Colibri PXA modules, but not on Colibri Tegra modules.
It is possible to make suspend registry modifications effective without reboot:
Call IOCTL_HAL_RELOADPMPARAMS to activate the latest suspend registry settings.