Programmer’s Guide
The process in which the power manager is used is highly dependent on the system’s topology. The following proposes one method for how this can be done.
Assume first the system has the power states described above.
Programmer Sequence for Entering Low Power
- Disable interrupts
- Enable desired wakeup and reset sources in
WAKEUP_EN
andRESET_EN
. - Perform any system-specific low power entry steps, e.g.
- Interrupt checks (if something became pending prior to disable)
- Configure low power mode in
CONTROL
. - Set low power hint in
LOW_POWER_HINT
. - Set and poll
CFG_CDC_SYNC
to ensure above settings propagate across clock domains. - Execute wait-for-interrupt instruction on the processing host.
Possible Exits
Once low power is initiated, the system may exit due to several reasons.
- Graceful low power exit - This exit occurs when some source in the system gracefully wakes up the power manager.
- System reset request - This exit occurs when either software or a peripheral requests the pwrmgr to reset the system.
- Fall through exit - This exit occurs when an interrupt manages to break the wait-for-interrupt loop.
- Aborted entry - This exit occurs when low power entry is attempted with an ongoing non-volatile transaction.
In both fall through exit and aborted entry, the power manager does not actually enter low power. Instead the low power entry is interrupted and the system restored to active state.
Programmer Sequence for Exiting Low Power
There are two separate cases for low power exit. One is exiting from deep sleep, and the other is exiting from normal sleep.
Exiting from Deep Sleep
When exiting from deep sleep, the system begins execution in ROM.
- Complete normal preparation steps.
- Check reset cause in rstmgr
- Re-enable modules that have powered down.
- Disable wakeup recording through
WAKE_INFO_CAPTURE_DIS
. - Check which source woke up the system through
WAKE_INFO
. - Take appropriate steps to handle the wake and resume normal operation.
- Once wake is handled, clear the wake indication in
WAKE_INFO
.
Exiting from Normal Sleep
The handling for fall-through and abort are similar to normal sleep exit. Since in these scenarios the system was not reset, software continues executing the instruction after the wait-for-interrupt invocation.
- Check exit condition to determine appropriate steps.
- Clear low power hints and configuration in
CONTROL
. - Set and poll
CFG_CDC_SYNC
to ensure setting changes have propagated across clock boundaries. - Disable wakeup sources and stop recording.
- Re-enable interrupts for normal operation and wakeup handling.
- Once wake is handled, clear the wake indication in
WAKE_INFO
.
For an in-depth discussion, please see power management programmers model for additional details.