Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

- RT Kernel : Real-Time Linux Interrupt Latency numbers here :ref:`RT Interrupt Latencies <RT-linux-performance>`
- Support for streaming from OV2312 camera with `DS90UB954-Q1EVM <https://www.ti.com/tool/DS90UB954-Q1EVM>`_
- Power Management: :ref:`I/O Only Plus DDR <pm_io_only_plus_ddr>` mode
- How standby power mode works - :ref:`CPUIdle Documentation <cpuidle-guide>`

Check warning on line 56 in source/devices/AM62AX/linux/Release_Specific_Release_Notes.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.UserReplacedValues] Separate words by underscores in user-replaced values. Raw Output: {"message": "[RedHat.UserReplacedValues] Separate words by underscores in user-replaced values.", "location": {"path": "source/devices/AM62AX/linux/Release_Specific_Release_Notes.rst", "range": {"start": {"line": 56, "column": 64}}}, "severity": "INFO"}

**Component version:**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
- RT Kernel : Real-Time Linux Interrupt Latency numbers here - :ref:`RT Interrupt Latencies <RT-linux-performance>`
- Support for streaming from multiple 0V5640 cameras with `Arducam V3Link (Fusion Mini) <https://www.arducam.com/product/arducam-v3link-camera-kit-for-ti-development-boards/>`_
- TISCI: A53 hosts default priv_id value updated to 1 from 4 (to match all other SOCs)
- Power Management: :ref:`I/O Only Plus DDR <pm_io_only_plus_ddr>` mode
- How standby power mode works - :ref:`CPUIdle Documentation <cpuidle-guide>`

Check warning on line 58 in source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'SOCs'. It is not in the American English spelling dictionary used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'SOCs'. It is not in the American English spelling dictionary used by Vale.", "location": {"path": "source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst", "range": {"start": {"line": 58, "column": 84}}}, "severity": "WARNING"}

Check warning on line 58 in source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'SOCs') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message": "[RedHat.Definitions] Define acronyms and abbreviations (such as 'SOCs') on first occurrence if they're likely to be unfamiliar.", "location": {"path": "source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst", "range": {"start": {"line": 58, "column": 84}}}, "severity": "INFO"}

Check warning on line 58 in source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'priv_id'. It is not in the American English spelling dictionary used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'priv_id'. It is not in the American English spelling dictionary used by Vale.", "location": {"path": "source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst", "range": {"start": {"line": 58, "column": 30}}}, "severity": "WARNING"}

Check warning on line 58 in source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'TISCI') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message": "[RedHat.Definitions] Define acronyms and abbreviations (such as 'TISCI') on first occurrence if they're likely to be unfamiliar.", "location": {"path": "source/devices/AM62PX/linux/Release_Specific_Release_Notes.rst", "range": {"start": {"line": 58, "column": 5}}}, "severity": "INFO"}
- Out-of-Box TI Apps Launcher Application with Qt6 Framework - :ref:`TI Apps Launcher <TI-Apps-Launcher-User-Guide-label>`
- Snagfactory Support - :ref:`Snagfactory Tool <Flash-via-Fastboot>`
- Support for M2 CC33xx cards on Debian - `How to Enable M.2-CC33x1 in Linux <https://software-dl.ti.com/processor-sdk-linux/esd/AM62PX/10_01_10_04_Debian/exports/docs/linux/How_to_Guides/Target/How_To_Enable_M2CC3301_in_linux.html>`__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ What's new
- Snagfactory Support - :ref:`Snagfactory Tool <Flash-via-Fastboot>`
- Support for M2 CC33xx cards on Debian - `How to Enable M.2-CC33x1 in Linux <https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_01_10_04_Debian/exports/docs/linux/How_to_Guides/Target/How_To_Enable_M2CC3301_in_linux.html>`__
- How to Enable PRU RPMsg - `Read FAQ <https://e2e.ti.com/support/processors-group/processors/f/791/t/1494495>`__
- How standby power mode works - :ref:`CPUIdle Documentation <cpuidle-guide>`

**Component version:**

Expand Down
139 changes: 124 additions & 15 deletions source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _cpuidle-guide:

Check warning on line 1 in source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'cpuidle'. It is not in the American English spelling dictionary used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'cpuidle'. It is not in the American English spelling dictionary used by Vale.", "location": {"path": "source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst", "range": {"start": {"line": 1, "column": 5}}}, "severity": "WARNING"}

#######
CPUIdle
#######
Expand All @@ -20,6 +22,114 @@
C-state. This state gets enabled by default in the CPUIdle driver without
requiring any additional DT configuration.

.. rubric:: Standby Mode

On |__PART_FAMILY_DEVICE_NAMES__| platforms, "Standby" mode is implemented through the Linux CPUIdle
framework. Standby is the default low-power state that the system enters automatically when idle,
using the WFI (Wait For Interrupt) C-state. This power-saving mechanism activates whenever the
system is "just sitting idle" without requiring any special configuration or activation from
the user.

When your device appears inactive, it is actually cycling in and out of this standby state
many times per second, seamlessly managing power while remaining responsive.

.. rubric:: Standby Implementation Architecture

For |__PART_FAMILY_DEVICE_NAMES__|, the Standby implementation involves a multi-layer architecture:

1. **Linux CPUIdle Framework**:
- Determines when to place CPUs into idle states based on system activity
- Uses governors (like the menu governor) to predict how long CPUs will be idle
- Invokes platform-specific drivers to transition to appropriate C-states

2. **ARM Generic CPUIdle Driver**:
- Implements the Linux CPUIdle driver interface for ARM platforms
- Communicates with TF-A through PSCI SMC (Secure Monitor Call) interface

3. **PSCI Interface in Linux**:
- Provides a standardized method for the kernel to request power management operations
- Translates Linux-side requests into PSCI calls to TF-A

4. **TF-A PSCI Implementation**:
- Runs in secure world (EL3)
- Implements the PSCI specification
- Provides platform-specific handlers via the ``plat_psci_ops`` structure

When your system goes idle, the following sequence occurs:

- Linux idle loop detects no runnable tasks
- CPUIdle governor selects the appropriate C-state ("stby" for these platforms)
- CPUIdle driver communicates with TF-A via the PSCI interface
- TF-A's PSCI implementation validates the requested power state through ``validate_power_state()``
- TF-A executes the ``cpu_standby()`` handler from ``plat_psci_ops``
- The actual WFI instruction is executed within the TF-A's standby handler
- On interrupt: CPU automatically exits WFI state
- Control returns to Linux

This automated process happens continuously during system operation, seamlessly
transitioning between active and idle states to save power whenever possible.

.. rubric:: Standby vs. Deep Sleep: Understanding the Difference

It's important to distinguish between the lightweight "standby" provided by CPUIdle and deeper sleep states:

* **CPUIdle Standby (WFI)**:
- Processor-level power saving only
- Very fast entry and exit (microseconds)
- Occurs automatically hundreds of times per second
- No user intervention required
- All peripherals remain operational
- Perfect for normal "idle" periods

* **Deep Sleep Modes**:
- System-wide power saving
- Slower entry and exit (milliseconds to seconds)
- Requires explicit software requests
- May require peripheral reconfiguration
- Suitable for extended inactive periods

.. rubric:: Source Location

**Linux Side**:

- :file:`drivers/cpuidle/cpuidle-arm.c` - ARM CPU idle driver
- :file:`drivers/cpuidle/dt_idle_states.c` - Device tree parsing for idle states
- :file:`drivers/cpuidle/cpuidle.c` - Core CPUIdle framework
- :file:`kernel/sched/idle.c` - Kernel idle loop implementation
- :file:`drivers/firmware/psci.c` - PSCI interface to TF-A

**TF-A Side** (not part of Linux kernel):

- :file:`plat/ti/k3/common/k3_psci.c` - PSCI implementation for K3 platforms

.. rubric:: Driver Usage

CPUIdle works automatically once enabled in the kernel, with no user intervention required.
The CPUIdle framework statistics can be accessed through the sysfs interface:

.. code-block:: console

# ls -l /sys/devices/system/cpu/cpu0/cpuidle/
drwxr-xr-x 2 root root 0 Jan 1 00:01 state0
drwxr-xr-x 2 root root 0 Jan 1 00:01 state1

# ls -l /sys/devices/system/cpu/cpu0/cpuidle/state1/
-r--r--r-- 1 root root 4096 Jan 1 00:02 desc
-r--r--r-- 1 root root 4096 Jan 1 00:02 latency
-r--r--r-- 1 root root 4096 Jan 1 00:02 name
-r--r--r-- 1 root root 4096 Jan 1 00:02 power
-r--r--r-- 1 root root 4096 Jan 1 00:02 time
-r--r--r-- 1 root root 4096 Jan 1 00:02 usage

To view the current C-state statistics:

.. code-block:: console

# cat /sys/devices/system/cpu/cpu0/cpuidle/state1/name
stby
# cat /sys/devices/system/cpu/cpu0/cpuidle/state1/usage
6245738

.. ifconfig:: CONFIG_part_family in ('AM335X_family', 'AM437X_family')

.. rubric:: Driver Features
Expand Down Expand Up @@ -77,7 +187,6 @@
-*- Menu governor (for tickless system)
ARM CPU Idle Drivers ----


.. rubric:: DT Configuration

.. code-block:: dts
Expand Down Expand Up @@ -112,18 +221,18 @@

.. code-block:: console

# ls -l /sys/devices/system/cpu/cpu0/cpuidle/state0/
-r--r--r-- 1 root root 4096 Jan 1 00:02 desc
-r--r--r-- 1 root root 4096 Jan 1 00:02 latency
-r--r--r-- 1 root root 4096 Jan 1 00:02 name
-r--r--r-- 1 root root 4096 Jan 1 00:02 power
-r--r--r-- 1 root root 4096 Jan 1 00:02 time
-r--r--r-- 1 root root 4096 Jan 1 00:02 usage
# ls -l /sys/devices/system/cpu/cpu0/cpuidle/state1/
-r--r--r-- 1 root root 4096 Jan 1 00:05 desc
-r--r--r-- 1 root root 4096 Jan 1 00:05 latency
-r--r--r-- 1 root root 4096 Jan 1 00:03 name
-r--r--r-- 1 root root 4096 Jan 1 00:05 power
-r--r--r-- 1 root root 4096 Jan 1 00:05 time
-r--r--r-- 1 root root 4096 Jan 1 00:02 usage
# ls -l /sys/devices/system/cpu/cpu0/cpuidle/state0/
-r--r--r-- 1 root root 4096 Jan 1 00:02 desc
-r--r--r-- 1 root root 4096 Jan 1 00:02 latency
-r--r--r-- 1 root root 4096 Jan 1 00:02 name
-r--r--r-- 1 root root 4096 Jan 1 00:02 power
-r--r--r-- 1 root root 4096 Jan 1 00:02 time
-r--r--r-- 1 root root 4096 Jan 1 00:02 usage
# ls -l /sys/devices/system/cpu/cpu0/cpuidle/state1/
-r--r--r-- 1 root root 4096 Jan 1 00:05 desc
-r--r--r-- 1 root root 4096 Jan 1 00:05 latency
-r--r--r-- 1 root root 4096 Jan 1 00:03 name
-r--r--r-- 1 root root 4096 Jan 1 00:05 power
-r--r--r-- 1 root root 4096 Jan 1 00:05 time
-r--r--r-- 1 root root 4096 Jan 1 00:02 usage

Loading