3.3.5. Low Power Modes

3.3.5.1. Overview

The following sections describe a high-level description of the different low power modes (LPM) of the device. If your application requires inactive power management, you must determine which low power mode described below satisfies your requirements. Each mode must be evaluated based on power consumption and latency (the time it takes to wakeup to Active mode) requirements. Specific values are detailed in the device-specific data sheet. As part of this SDK offering, Texas Instruments has added support for the following low power modes:

  1. Deep Sleep

  2. MCU Only

  3. Partial I/O

TI SDK 10.0 (ti-linux-6.6.y kernel and 10.0 DM firmware) adds support for an updated LPM Software Architecture that seamlessly manages the various Suspend-to-RAM modes supported by AM62 family of devices. More details about this architecture can be found in LPM constraints framework section.

3.3.5.2. Deep Sleep

Deep Sleep AKA Suspend-to-RAM is a low-power mode that allows an embedded device to retain its state in RAM while the processor is turned off. This can save a significant amount of power, especially in devices that are battery-powered.

The benefits of using deep sleep in embedded devices:

  1. Faster wake-up: devices can wake up from this low-power state much faster than a complete power cycle.

  2. Better efficiency: deep sleep can help to improve the efficiency of embedded devices by reducing the amount of time that the processor is idle. This is because the processor can be kept in a low-power state when it is not needed.

In order to enter deep sleep, use the following command:

root@am62xx-evm:~# echo mem > /sys/power/state
[  444.719520] PM: suspend entry (deep)
[  444.723374] Filesystems sync: 0.000 seconds
[  444.751309] Freezing user space processes
[  444.756923] Freezing user space processes completed (elapsed 0.001 seconds)
[  444.763924] OOM killer disabled.
[  444.767141] Freezing remaining freezable tasks
[  444.772908] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[  444.780328] printk: Suspending console(s) (use no_console_suspend to debug)
[  444.796853] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
[  444.797037] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
[  444.805604] omap8250 2800000.serial: PM domain pd:146 will not be powered off
[  444.806188] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
[  444.816592] remoteproc remoteproc0: stopped remote processor 5000000.m4fss
[  444.820627] Disabling non-boot CPUs ...
[  444.822859] psci: CPU1 killed (polled 0 ms)
[  444.826567] psci: CPU2 killed (polled 0 ms)
[  444.830170] psci: CPU3 killed (polled 0 ms)

This partially indicates that linux has finished it’s deep sleep sequence. For further confirmation, one can take a look at the PMIC_LPM_EN pin on the EVM (after programming the PMCTRL_SYS register (0x43018080) to 0x15). Here, if the pin is 3.3V when active and 0V when in deep sleep.

Note

The system will enter deep sleep mode only if DM selects it based on existing constraints.

Refer to the Wakeup Sources section for information on how to wakeup the device from Deep Sleep mode using one of the supported wakeup sources.

3.3.5.3. MCU Only

Similar to Deep Sleep, with the major distinction being that the MCU core is kept alive to run applications. The benefits of using MCU Only mode:

  1. Low power consumption: MCU Only mode can save a significant amount of power, especially in battery-powered devices. This is because The rest of the SoC status is the same as Deep Sleep and DDR is in self-refresh.

  2. Run background tasks: This mode can be used to run background tasks that do not require the full power of the system. For example, you could use the firmware on the MCU core to run a watchdog timer, a sensor polling loop, or a network communication task.

  3. Respond to interrupts: This allows the system to still respond to external events, while it is in a low-power state.

To enter MCU Only mode, set 100 usec resume latency for CPU0 in linux:

root@<machine>:~# echo 100 > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

Important

Note that the step below to set “enabled” won’t work for SDK 10.00 and will be supported in future release

To enter MCU Only mode, enable MCU M4 core as a wakeup source in linux:

root@am62xx-evm:~# echo enabled > /sys/bus/platform/devices/5000000.m4fss/power/wakeup

Now, the SoC can be suspended using the following command:

root@<machine>:~# rtcwake -s 5 -m mem
rtcwake: wakeup from "mem" using /dev/rtc0 at Thu Jan  1 00:01:02 1970
[   45.548480] PM: suspend entry (deep)
[   45.552187] Filesystems sync: 0.000 seconds
[   45.566606] Freezing user space processes
[   45.572093] Freezing user space processes completed (elapsed 0.001 seconds)
[   45.579083] OOM killer disabled.
[   45.582309] Freezing remaining freezable tasks
[   45.587984] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   45.595432] printk: Suspending console(s) (use no_console_suspend to debug)
[   45.627136] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
[   45.640758] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
[   45.648341] omap8250 2800000.serial: PM domain pd:146 will not be powered off
[   45.648892] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
[   45.648993] cpu cpu3: ti_sci_suspend: sending max CPU latency=100
[   45.649033] ti-sci 44043000.system-controller: ti_sci_cmd_set_latency_constraint: latency: 100: state: 1: ret 0
[   45.669270] Disabling non-boot CPUs ...
[   45.671353] psci: CPU1 killed (polled 0 ms)
[   45.674819] psci: CPU2 killed (polled 0 ms)
[   45.676640] psci: CPU3 killed (polled 4 ms)
[   45.677311] Enabling non-boot CPUs ...
[   45.677632] Detected VIPT I-cache on CPU1
[   45.677672] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
[   45.677724] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[   45.678694] CPU1 is up
[   45.678934] Detected VIPT I-cache on CPU2
[   45.678962] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
[   45.679002] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[   45.679778] CPU2 is up
[   45.680016] Detected VIPT I-cache on CPU3
[   45.680045] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
[   45.680088] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[   45.680939] CPU3 is up
[   45.681332] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x50
[   45.703650] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
[   45.719704] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=POLL)
[   45.719730] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
[   46.004264] OOM killer enabled.
[   46.007406] Restarting tasks ... done.
[   46.012454] random: crng reseeded on system resumption
[   46.026923] platform 79000000.r5f: Core is on in resume
[   46.032206] platform 79000000.r5f: received echo reply from 79000000.r5f
[   46.032262] PM: suspend exit

Once the SoC enters MCU Only mode, the following log should be printed on the MCU UART (in most cases it will be /dev/ttyUSB3)

[IPC RPMSG ECHO] Next MCU mode is 1
[IPC RPMSG ECHO] Suspend request to MCU-only mode received
[IPC RPMSG ECHO] Press a sinlge key on this terminal to resume the kernel from MCU only mode

Note

The system will enter MCU Only mode only if DM selects it based on existing constraints.

Refer to the Wakeup Sources section for information on how to wakeup the device from MCU Only mode using one of the supported wakeup sources.

3.3.5.4. Partial I/O

In Partial I/O, only the I/O pins and a small digital logic in the CANUART I/O Bank are active, while the rest of the SoC is turned off. The user can use the I/O pins to aggregate multiple I/O wakeup events and toggle PMIC_LPM_EN pin to enable PMIC or discrete power solution when an I/O wakeup event is triggered.

Note

The system looses nearly all its state as DDR is also turned-off. Partial I/O is comparable with a Linux poweroff state.

Important

Only AM62 LP-SK EVM supports Partial I/O mode.

The reference implementation in this SDK implements Partial I/O as a poweroff state. On poweroff, Linux ti_sci driver checks the potential Partial I/O wakeup sources for being enabled. If one of the wakeup sources is found to be enabled, Partial I/O is entered instead of poweroff.

The following wakeup sources have been configured for Partial I/O: mcu_uart0, mcu_mcan0, and mcu_mcan1. Partial I/O mode can only be tested when k3-am62x-sk-lpm-wkup-sources.dtso overlay is loaded. Please refer to How to enable DT overlays for more details.

After Linux boots, the MCAN wakeup for Partial I/O is enabled using the wake on PHY activity option of ethtool. For example, the following command enables mcu_mcan0 wakeup:

root@<machine>:~# ethtool -s mcu_mcan0 wol p

To enable mcu_mcan1 wakeup:

root@<machine>:~# ethtool -s mcu_mcan1 wol p

To enable UART wakeup:

root@<machine>:~# echo enabled > /sys/class/tty/ttyS0/device/power/wakeup

Note

UART wakeup from Partial I/O is currently being debugged on the EVM.

With at least one of the wakeup sources enabled, Partial I/O mode can be entered with the following command:

root@<machine>:~# poweroff

At this point, Linux kernel will go through its poweroff process and the console output will stop at the following lines:

[   51.698039] systemd-shutdown[1]: Powering off.
[   51.769478] reboot: Power down

The system has entered Partial I/O and can only be woken up with an activity on the I/O pin programmed for wakeup. For example, if mcu_mcan0 wakeup was enabled, grounding Pin 22 of J8 MCU Header will wakeup the system and it will go through a normal Linux boot process.

Note

The capability to detect whether system is resuming from Partial I/O or doing a normal cold boot will be added in future release.

3.3.5.5. Limitations

HWRNG support on GP devices is incompatible with Deep Sleep and MCU Only modes. To test LPM on GP devices, HWRNG has to be unloaded one-time before running the Suspend-to-RAM command:

root@<machine>:@~# modprobe -r optee_rng

3.3.5.5.1. Compatibility

The compatibility between Kernel version and firmware version to enter low power mode is listed in the below table:

LPM

Firmware v10.0

Firmware < v10.0

TI Kernel 6.6

All low power modes supported

Only Deep Sleep supported

TI Kernel < 6.6

All low power modes supported

All low power modes supported

Important

In case of Kernel 6.6 and Firmware < v10.0, the firmware is unaware of the constraints framework. Hence, the system will always enter deep sleep low power mode irrespective of the constraints set.

Note

All low power mode supported implies all low power mode supported by the firmware as per firmware capabilities. TISCI_MSG_QUERY_FW_CAPS can be sent to firmware to get the low power modes supported by firmware.