Skip to content

Commit

Permalink
docs(linux): Power_Management: Order modes in inc power consumption o…
Browse files Browse the repository at this point in the history
…rder

Reorder the low power modes from lowest power consuming mode to highest
power consuming mode.

Signed-off-by: Akashdeep Kaur <[email protected]>
  • Loading branch information
akashdeep-ti committed Dec 11, 2024
1 parent 8b71614 commit dcaf361
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 190 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,203 +13,19 @@ device. If your application requires inactive power management, you must determi
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:
Texas Instruments has added support for the following low power modes (ordered from lowest power consumption
to highest power consumption):

#. Deep Sleep
#. MCU Only
#. Partial I/O
#. I/O Only Plus DDR
#. Deep Sleep
#. MCU Only

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 :ref:`LPM constraints framework<pm_constraints_fwk>` section.

**********
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:

#. Faster wake-up: devices can wake up from this low-power state much faster than
a complete power cycle.
#. 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:

.. ifconfig:: CONFIG_part_variant in ('AM62X')

.. code-block:: console
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)
.. ifconfig:: CONFIG_part_variant in ('AM62AX' , 'AM62PX')

.. code-block:: console
root@<machine>:~# echo mem > /sys/power/state
[ 230.181404] PM: suspend entry (deep)
[ 230.185406] Filesystems sync: 0.000 seconds
[ 230.219094] Freezing user space processes
[ 230.224495] Freezing user space processes completed (elapsed 0.001 seconds)
[ 230.231506] OOM killer disabled.
[ 230.234736] Freezing remaining freezable tasks
[ 230.240432] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 230.247825] printk: Suspending console(s) (use no_console_suspend to debug)
[ 230.266309] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
[ 230.266456] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
[ 230.273953] omap8250 2800000.serial: PM domain pd:146 will not be powered off
[ 230.274450] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
[ 230.284177] remoteproc remoteproc1: stopped remote processor 79000000.r5f
[ 230.287440] Disabling non-boot CPUs ...
[ 230.289569] psci: CPU1 killed (polled 0 ms)
[ 230.292413] psci: CPU2 killed (polled 4 ms)
[ 230.295457] 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 :ref:`Wakeup Sources<pm_wakeup_sources>` section for information on how to wakeup the device from
Deep Sleep mode using one of the supported wakeup sources.

.. _pm_mcu_only:

********
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:

#. 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.
#. 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.
#. 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 :code:`100 usec` resume latency for CPU0 in linux:

.. code-block:: console
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

.. ifconfig:: CONFIG_part_variant in ('AM62X')

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

.. code-block:: console
root@am62xx-evm:~# echo enabled > /sys/bus/platform/devices/5000000.m4fss/power/wakeup
.. ifconfig:: CONFIG_part_variant in ('AM62AX', 'AM62PX')

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

.. code-block:: console
root@<machine>:~# echo enabled > /sys/bus/platform/devices/79000000.r5f/power/wakeup
Now, the SoC can be suspended using the following command:

.. code-block:: console
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)

.. code-block:: text
[IPC RPMSG ECHO] Next MCU mode is 1
[IPC RPMSG ECHO] Suspend request to MCU-only mode received
[IPC RPMSG ECHO] Press a single 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 :ref:`Wakeup Sources<pm_wakeup_sources>` section for information on how to wakeup the device from
MCU Only mode using one of the supported wakeup sources.


***********
Partial I/O
***********
Expand Down Expand Up @@ -415,6 +231,190 @@ I/O Only Plus DDR

The system will enter I/O Only plus DDR mode only if DM selects it based on existing constraints.

**********
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:

#. Faster wake-up: devices can wake up from this low-power state much faster than
a complete power cycle.
#. 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:

.. ifconfig:: CONFIG_part_variant in ('AM62X')

.. code-block:: console
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)
.. ifconfig:: CONFIG_part_variant in ('AM62AX' , 'AM62PX')

.. code-block:: console
root@<machine>:~# echo mem > /sys/power/state
[ 230.181404] PM: suspend entry (deep)
[ 230.185406] Filesystems sync: 0.000 seconds
[ 230.219094] Freezing user space processes
[ 230.224495] Freezing user space processes completed (elapsed 0.001 seconds)
[ 230.231506] OOM killer disabled.
[ 230.234736] Freezing remaining freezable tasks
[ 230.240432] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 230.247825] printk: Suspending console(s) (use no_console_suspend to debug)
[ 230.266309] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 179: state: 1: ret 0
[ 230.266456] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 178: state: 1: ret 0
[ 230.273953] omap8250 2800000.serial: PM domain pd:146 will not be powered off
[ 230.274450] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 117: state: 1: ret 0
[ 230.284177] remoteproc remoteproc1: stopped remote processor 79000000.r5f
[ 230.287440] Disabling non-boot CPUs ...
[ 230.289569] psci: CPU1 killed (polled 0 ms)
[ 230.292413] psci: CPU2 killed (polled 4 ms)
[ 230.295457] 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 :ref:`Wakeup Sources<pm_wakeup_sources>` section for information on how to wakeup the device from
Deep Sleep mode using one of the supported wakeup sources.

.. _pm_mcu_only:

********
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:

#. 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.
#. 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.
#. 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 :code:`100 usec` resume latency for CPU0 in linux:

.. code-block:: console
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

.. ifconfig:: CONFIG_part_variant in ('AM62X')

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

.. code-block:: console
root@am62xx-evm:~# echo enabled > /sys/bus/platform/devices/5000000.m4fss/power/wakeup
.. ifconfig:: CONFIG_part_variant in ('AM62AX', 'AM62PX')

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

.. code-block:: console
root@<machine>:~# echo enabled > /sys/bus/platform/devices/79000000.r5f/power/wakeup
Now, the SoC can be suspended using the following command:

.. code-block:: console
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)

.. code-block:: text
[IPC RPMSG ECHO] Next MCU mode is 1
[IPC RPMSG ECHO] Suspend request to MCU-only mode received
[IPC RPMSG ECHO] Press a single 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 :ref:`Wakeup Sources<pm_wakeup_sources>` section for information on how to wakeup the device from
MCU Only mode using one of the supported wakeup sources.

***********
Limitations
***********
Expand Down
Loading

0 comments on commit dcaf361

Please sign in to comment.