2.9.6. Low Power Mode

Linux on AM62x supports system low power mode. The system can be suspended to RAM while it is not in use, and resumed when there are some tasks to be done.

This section demonstrates how to use the Linux suspend/resume feature.

Follow Create a Linux Bootable SD Card to create a bootable SD card from the Processor SDK package, and follow Boot Linux from SD Card to boot the AM62x EVM.

When the following U-Boot message appears on the UART console, press any key on the keyboard to stop at the U-Boot prompt:

U-Boot 2021.01-g4c04b0465c (Jan 19 2022 - 22:48:48 +0000)

SoC:   AM62X SR1.0
Model: Texas Instruments AM625 SK
EEPROM not available at 0x50, trying to read at 0x51
Board: AM62-SKEVM rev E1
DRAM:  2 GiB
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Net:   eth0: ethernet@8000000
Hit any key to stop autoboot:  0
=>

Run the following commands on the U-Boot prompt to boot into Linux:

=> run envboot; setenv name_fdt k3-am625-sk-lpmdemo.dtb; run init_mmc; run get_kern_mmc;run get_fdt_mmc;run get_overlay_mmc; booti ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr}

Once the UART console shows the Linux login prompt, type ‘root’ to login. Now the Linux system suspend/resume feature can be tested. Run the following command at the Linux prompt to put the system into suspend:

# echo 1250000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
# rtcwake -m mem -s 10
# echo 200000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq

Note

Currently there is a known issue of a performance drop after resuming from deep sleep. The two “echo” commands above around the “rtcwake” command are to work around the issue by temporarily disabling DFS and cycling through deep sleep.

The system enters suspend state. The following Linux message appears on the UART console:

wakeup from "mem" at Wed Jan 19 23:04:55 2022
[   46.945696] PM: suspend entry (deep)
[   46.949326] Filesystems sync: 0.000 seconds
[   46.954616] Freezing user space processes ... (elapsed 0.001 seconds) done.
[   46.962885] OOM killer disabled.
[   46.966125] Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done.
[   46.974410] printk: Suspending console(s) (use no_console_suspend to debug)

After about 10 seconds (which is specified as ‘-s 10’ in the command above), the system resumes and the following message appears on the UART console:

[   46.982620] Disabling non-boot CPUs ...
[   46.987647] OOM killer enabled.
[   46.990779] Restarting tasks ... done.
[   46.995438] PM: suspend exit

The Linux now is ready to execute any task.