Skip to content

Commit 0749484

Browse files
ti-scariapraneethbajjuri
authored andcommitted
feat(linux): Add standby mode docs for AM62L
Introduce standby mode in AM62L and how it is used. Extending the CPUidle documentation for AM62L. Signed-off-by: Scaria Kochidanadu <s-kochidanadu@ti.com>
1 parent 29049c0 commit 0749484

4 files changed

Lines changed: 262 additions & 11 deletions

File tree

configs/AM62LX/AM62LX_linux_toc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ linux/Foundational_Components/Kernel/Kernel_Drivers/Watchdog
7575
linux/Foundational_Components_Power_Management
7676
linux/Foundational_Components/Power_Management/pm_overview
7777
linux/Foundational_Components/Power_Management/pm_cpuidle
78+
linux/Foundational_Components/Power_Management/pm_am62l_standby
7879
linux/Foundational_Components/Power_Management/pm_am62lx_low_power_modes
7980
linux/Foundational_Components/Power_Management/pm_psci_s2idle
8081
linux/Foundational_Components/Power_Management/pm_wakeup_sources
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
.. _am62l_standby_mode:
2+
3+
##################
4+
AM62L Standby Mode
5+
##################
6+
7+
********
8+
Overview
9+
********
10+
11+
Unlike system suspend modes that require explicit user intervention, Standby Mode operates transparently
12+
during normal system operation. The system continuously evaluates the idle state of processor clusters and
13+
automatically adjusts clock frequencies, disables non-critical power domains, and enables DDR auto-self-refresh
14+
when all cores are idle. On receiving an interrupt, quickly restores full operational state.
15+
16+
Key characteristics of this opportunistic approach:
17+
18+
* **Automatic Operation**: No user configuration required; the system continuously monitors CPU activity and automatically enters power-saving states when cores are idle, then exits when work resumes. This contrasts with system suspend modes that require explicit commands.
19+
* **Transparent**: Happens silently in the background during normal idle periods
20+
* **Fast Response**: Wakeup latency is in microseconds, meaning the system can instantly resume full performance when an interrupt arrives. This makes standby suitable for real-time responsiveness.
21+
* **Hierarchical Power Management**: The system optimizes power at multiple levels: first at individual CPU cores (via CPU idle states), then at the cluster level (via cluster standby). This multi-level approach allows fine-grained control, reducing power consumption incrementally based on the number of active cores.
22+
23+
*************************
24+
Device Tree Configuration
25+
*************************
26+
27+
Idle states
28+
===========
29+
30+
The AM62L Standby Mode configuration includes the following idle states:
31+
32+
.. list-table:: AM62L Idle States
33+
:widths: 20 50 30
34+
:header-rows: 1
35+
36+
* - Idle State
37+
- Description
38+
- Latency
39+
40+
* - **cpu_sleep_0** (CPU Level)
41+
- Individual CPU WFI (Wait For Interrupt) state
42+
- Very Low (microseconds)
43+
44+
* - **cluster_sleep_0** (Low Latency Cluster standby)
45+
- Cluster low-latency standby mode when all cores are idle, with reduced clock frequencies and non-critical power domains disabled
46+
- Low (milliseconds)
47+
48+
The configuration can be loaded from the device tree overlay :file:`k3-am62l3-evm-idle-states.dtso`, which defines
49+
these states and their power management characteristics.
50+
51+
Power Domain Hierarchy
52+
======================
53+
54+
In addition to idle states, the device tree defines the power domain hierarchy that allows CPUIdle to understand
55+
how different power domains relate to each other:
56+
57+
* **CPU_PD** (CPU Power Domain): Per-CPU power domain
58+
* **CLUSTER_PD** (Cluster Power Domain): Cluster-level power domain that groups multiple CPUs
59+
60+
These power domains inform CPUIdle about which non-critical domains can be disabled when all cores within them are idle.
61+
62+
.. note::
63+
64+
The device tree overlay also includes additional idle states for Suspend-to-Idle (S2Idle) functionality
65+
that can be referred from :ref:`pm_s2idle_psci`.
66+
The Standby Mode uses the **cpu_sleep_0** and **cluster_sleep_0** idle states, coordinated through the
67+
**CPU_PD** and **CLUSTER_PD** power domain hierarchy.
68+
69+
Critical Prerequisites
70+
======================
71+
72+
The AM62L Standby Mode implementation has important prerequisites that must be met for correct operation.
73+
74+
**CPSW (Gigabit Ethernet) Driver Suspension**
75+
76+
The entry into Cluster level standby is conditional on CPSW driver being suspended, since hardware CRC errors
77+
occur when CPSW continues operation during cluster standby. The CPSW is an Always-On IP in the AM62L SoC.
78+
79+
**Display Driver Suspension**
80+
81+
Similarly, the display driver must be in a suspended state for cluster standby due to frame buffer overflow issues.
82+
Ensure display is not actively driving output when testing or relying on Standby Mode for power savings.
83+
84+
.. warning::
85+
86+
Standby Mode only functions correctly when the DISPLAY and CPSW drivers are suspended. The device tree
87+
overlay :file:`k3-am62l3-evm-idle-states.dtso` disables the CPSW driver to ensure this
88+
condition is met. Do not override this configuration without understanding the implications for cluster
89+
idle transitions and hardware stability.
90+
91+
***********************************************
92+
Power Sequencing and Cluster Standby Entry/Exit
93+
***********************************************
94+
95+
When the all cores in a cluster become idle and AM62L system enters Standby Mode:
96+
97+
1. **Detection Phase**:
98+
- CPUIdle monitors per-CPU idle state transitions
99+
- Domain idle state manager tracks core idle status
100+
- When all cores in a cluster are idle, cluster standby opportunity is identified
101+
102+
2. **Coordination Phase**:
103+
- Linux CPUIdle framework signals cluster idle state via PSCI ``CPU_SUSPEND`` call
104+
- PSCI parameter encodes cluster standby request with standby state type (not power-down)
105+
- TF-A receives request in secure monitor
106+
107+
3. **Validation Phase**:
108+
- TF-A validates the PSCI request parameter sent for cluster standby
109+
- Checks all cores in cluster are idle
110+
111+
4. **Standby Entry Phase**:
112+
- TF-A executes cluster standby entry sequence
113+
- Reduces PLL clock frequencies for non-critical subsystems
114+
- Disables non-critical power domains
115+
- Puts DDR into auto-self-refresh mode
116+
- System enters low-power standby state with reduced power consumption
117+
118+
5. **Wake-Up Phase**:
119+
- Incoming interrupt(*any* interrupt can wake the system) triggers wake-up
120+
- TF-A restores normal PLL frequencies and power domains
121+
- DDR exits auto-self-refresh mode
122+
- Cores resume execution with minimal latency
123+
- System returns to active operation
124+
125+
***************************
126+
Monitoring Standby Activity
127+
***************************
128+
129+
Once Standby Mode is enabled, you can monitor idle state activity through the PM generic power domain (genpd)
130+
sysfs interface. The power domain names are derived from the PSCI power domain hierarchy defined in the device
131+
tree overlay.
132+
133+
.. rubric:: CPU Idle Activity
134+
135+
To monitor per-CPU idle state usage:
136+
137+
.. code-block:: console
138+
139+
# View CPU idle state statistics
140+
$ cat /sys/kernel/debug/pm_genpd/power-controller-cpu/idle_states
141+
142+
State Time(ms) Usage Rejected Above Below S2idle
143+
S0 1052189 34224 0 0 0 0
144+
145+
.. rubric:: Cluster Standby Activity (Recommended)
146+
147+
To monitor cluster-level standby mode usage, which is the most useful metric for verifying that the system
148+
is successfully entering the low-latency standby mode when all cores are idle:
149+
150+
.. code-block:: console
151+
152+
# View cluster standby state statistics
153+
$ cat /sys/kernel/debug/pm_genpd/power-controller-cluster/idle_states
154+
155+
State Time(ms) Usage Rejected Above Below S2idle
156+
S0 263595 5415 647 2854 0 0
157+
158+
The ``Usage`` counter shows how many times the cluster entered the standby state, while ``Time(ms)`` shows
159+
the total milliseconds spent in that state. A non-zero Usage count indicates that the cluster standby mode
160+
is being actively used during idle periods.
161+
162+
**********************************
163+
Difference from System Sleep Modes
164+
**********************************
165+
166+
Standby Mode is distinct from deeper system sleep modes like Deep Sleep or RTC-Only+DDR:
167+
168+
.. list-table:: Standby versus Deep Sleep Modes
169+
:widths: 25 35 40
170+
:header-rows: 1
171+
172+
* - Feature
173+
- Standby Mode
174+
- Deep Sleep (mem)
175+
176+
* - **Entry**
177+
- Automatic, opportunistic
178+
- Explicit user request
179+
180+
* - **CPU State**
181+
- Idle in standby state, context preserved
182+
- Offline via hotplug
183+
184+
* - **Wakeup Latency**
185+
- Microseconds
186+
- Milliseconds
187+
188+
* - **PLL/Clock State**
189+
- Reduced frequencies for non-critical subsystems
190+
- Full frequency restoration required
191+
192+
* - **DDR State**
193+
- Auto-self-refresh during cluster standby
194+
- Self-refresh
195+
196+
* - **Wakeup Interrupts**
197+
- Any SoC interrupt event
198+
- Only specific wakeup sources - GPIO, RTC, etc.
199+
200+
* - **Use Case**
201+
- Normal idle periods with fast wakeup
202+
- Extended inactivity periods
203+
204+
****************************************
205+
Platform-Specific Implementation Details
206+
****************************************
207+
208+
The AM62L Standby Mode implementation uses platform-specific handlers in TF-A:
209+
210+
* :file:`plat/ti/k3low/common/am62l_psci.c` - AM62L PSCI implementation
211+
* :file:`plat/ti/k3low/board/am62lx/lpm/standby.c` - Cluster standby handler and power sequencing logic
212+
213+
These files implement the ``validate_power_state()`` and ``am62l_entry/exit_standby()`` PSCI platform operations that
214+
coordinate the idle state requests and manage the actual hardware sequencing for cluster standby entry/exit,
215+
including clock frequency adjustments and power domain transitions.
216+
217+
**References**
218+
219+
* :ref:`cpuidle-guide` - General CPUIdle framework documentation
220+
* :ref:`pm_s2idle_psci` - To understand PSCI and OSI mode
221+
* :ref:`lpm_modes` - Low power modes overview
222+
* :ref:`howto_dt_overlays` - Device Tree Overlay Documentation

source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ C-state. Governor decides whether to continue in current state/
1616
transition to a different state. Current 'driver' is called to
1717
transition to the selected state.
1818

19-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX', 'J722S', 'AM62DX')
19+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX', 'J722S', 'AM62DX', 'AM62LX')
2020

2121
.. rubric:: Standby Mode
2222

@@ -31,9 +31,21 @@ transition to the selected state.
3131

3232
.. rubric:: Enable Standby
3333

34-
In order to enable Standby the `k3-am62x-sk-lpm-standby.dtso
35-
<https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-standby.dtso?h=12.00.00.07>`__
36-
overlay should be applied. Refer to :ref:`How to enable DT overlays
34+
In order to enable Standby, apply the appropriate device tree overlay for your platform.
35+
36+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX', 'J722S', 'AM62DX')
37+
38+
Use the `k3-am62x-sk-lpm-standby.dtso
39+
<https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-standby.dtso?h=12.00.00.07>`__
40+
overlay.
41+
42+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
43+
44+
Use the `k3-am62l3-evm-idle-states.dtso
45+
<https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62l3-evm-idle-states.dtso?h=12.00.00.07>`__
46+
overlay for cluster standby support.
47+
48+
Refer to :ref:`How to enable DT overlays
3749
<howto_dt_overlays>` for more details. More information on what the overlay
3850
does is in the :ref:`linux-device-tree-label` section.
3951

@@ -77,15 +89,15 @@ transition to the selected state.
7789

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

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

88-
* **Deep Sleep Modes**:
100+
**Deep Sleep Modes**:
89101
- System-wide power saving
90102
- Slower entry and exit (milliseconds to seconds)
91103
- Requires explicit software requests
@@ -104,16 +116,31 @@ transition to the selected state.
104116

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

107-
- :file:`plat/ti/k3/common/k3_psci.c` - PSCI implementation for K3 platforms
119+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX', 'J722S', 'AM62DX')
120+
121+
- :file:`plat/ti/k3/common/k3_psci.c` - PSCI implementation for K3 platforms
122+
123+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
124+
125+
- :file:`plat/ti/k3low/common/am62l_psci.c` - PSCI implementation for AM62LX
108126

109127
.. _linux-device-tree-label:
110128

111129
.. rubric:: Linux Device Tree Implementation
112130

113-
In order to implement Standby in Linux, an idle-states node has to be added
114-
and then referenced by the CPU node. The `k3-am62x-sk-lpm-standby.dtso
115-
<https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-standby.dtso?h=12.00.00.07>`__
116-
can be used as a reference.
131+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX', 'J722S', 'AM62DX')
132+
133+
In order to implement Standby in Linux, an idle-states node has to be added
134+
and then referenced by the CPU node. The `k3-am62x-sk-lpm-standby.dtso
135+
<https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-standby.dtso?h=12.00.00.07>`__
136+
can be used as a reference.
137+
138+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
139+
140+
In order to implement Standby in Linux, an idle-states node has to be added
141+
and then referenced by the CPU node. The `k3-am62l3-evm-idle-states.dtso
142+
<https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62l3-evm-idle-states.dtso?h=12.00.00.07>`__
143+
can be used as a reference.
117144

118145
.. code-block:: dts
119146

source/linux/Foundational_Components_Power_Management.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Power Management
88
Foundational_Components/Power_Management/pm_dvfs
99
Foundational_Components/Power_Management/pm_dfs
1010
Foundational_Components/Power_Management/pm_cpuidle
11+
Foundational_Components/Power_Management/pm_am62l_standby
1112
Foundational_Components/Power_Management/pm_runtime_pm
1213
Foundational_Components/Power_Management/pm_smartreflex
1314
Foundational_Components/Power_Management/pm_suspend_resume

0 commit comments

Comments
 (0)