|
| 1 | +.. _am62l_standby_mode: |
| 2 | + |
| 3 | +######################## |
| 4 | +AM62L Standby Mode |
| 5 | +######################## |
| 6 | + |
| 7 | +**Overview** |
| 8 | + |
| 9 | +The AM62L family of SoCs supports a **Standby Mode** through the Linux CPUIdle framework's support for hierarchical |
| 10 | +idle states. While CPUIdle commonly provides per-CPU idle states using WFI (Wait For Interrupt), it also supports deeper |
| 11 | +states that operate at the CPU **cluster level**. The AM62L platform enables and utilizes these deeper cluster idle states |
| 12 | +to achieve improved standby power savings through reduced PLL frequencies, non-critical power domain disabling, and DDR |
| 13 | +auto-self-refresh when system conditions allow. |
| 14 | + |
| 15 | +***************************** |
| 16 | +Standby Mode: Opportunistic |
| 17 | +***************************** |
| 18 | + |
| 19 | +Unlike scheduled suspend modes that require explicit user intervention, Standby Mode operates transparently |
| 20 | +during normal system operation. The system continuously evaluates the idle state of processor clusters and |
| 21 | +automatically adjusts clock frequencies, disables non-critical power domains, and enables DDR auto-self-refresh |
| 22 | +when all cores are idle, then quickly restores full operational state when needed. |
| 23 | + |
| 24 | +Key characteristics of this opportunistic approach: |
| 25 | + |
| 26 | +* **Automatic Operation**: No user configuration required; the system makes power decisions in real-time |
| 27 | +* **Transparent**: Happens silently in the background during normal idle periods |
| 28 | +* **Fast Response**: Minimal latency to wake up from idle state upon interrupt |
| 29 | +* **Hierarchical Power Management**: Extends from individual CPU idle states to cluster-level standby |
| 30 | + |
| 31 | +***************************** |
| 32 | +Idle States Supported |
| 33 | +***************************** |
| 34 | + |
| 35 | +The AM62L Standby Mode configuration includes the following idle states: |
| 36 | + |
| 37 | +.. list-table:: AM62L Idle States |
| 38 | + :widths: 20 50 30 |
| 39 | + :header-rows: 1 |
| 40 | + |
| 41 | + * - Idle State |
| 42 | + - Description |
| 43 | + - Latency |
| 44 | + |
| 45 | + * - **cpu_sleep_0** (CPU Level) |
| 46 | + - Individual CPU WFI (Wait For Interrupt) state |
| 47 | + - Very Low (microseconds) |
| 48 | + |
| 49 | + * - **cluster_sleep_0** (Low Latency Cluster standby) |
| 50 | + - Cluster low-latency standby mode when all cores are idle, with reduced clock frequencies and non-critical power domains disabled |
| 51 | + - Low (milliseconds) |
| 52 | + |
| 53 | +The configuration is loaded from the device tree overlay :file:`k3-am62l3-evm-idle-states.dtso`, which defines |
| 54 | +these states and their power management characteristics. |
| 55 | + |
| 56 | +**Power Domain Hierarchy** |
| 57 | + |
| 58 | +In addition to idle states, the device tree defines the power domain hierarchy which allows CPUIdle to understand |
| 59 | +how different power domains relate to each other: |
| 60 | + |
| 61 | +* **CPU_PD** (CPU Power Domain): Per-CPU power domain |
| 62 | +* **CLUSTER_PD** (Cluster Power Domain): Cluster-level power domain that groups multiple CPUs |
| 63 | + |
| 64 | +These power domains inform CPUIdle about which non-critical domains can be disabled when all cores within them are idle. |
| 65 | + |
| 66 | +.. note:: |
| 67 | + |
| 68 | + The device tree overlay also includes additional idle states for Suspend-to-Idle (S2Idle) functionality |
| 69 | + can be referred from :ref:`pm_s2idle_psci`. |
| 70 | + The Standby Mode uses the **cpu_sleep_0** and **cluster_sleep_0** idle states, coordinated through the |
| 71 | + **CPU_PD** and **CLUSTER_PD** power domain hierarchy. |
| 72 | + |
| 73 | +**************************** |
| 74 | +Critical Prerequisites |
| 75 | +**************************** |
| 76 | + |
| 77 | +The AM62L Standby Mode implementation has important prerequisites that must be met for correct operation. |
| 78 | + |
| 79 | +**CPSW (Gigabit Ethernet) Driver Suspension** |
| 80 | + |
| 81 | +The entry into Cluster level standby is conditioned on CPSW driver being suspended, since hardware CRC errors |
| 82 | +occur when CPSW continues operation during cluster standby. The CPSW is an Always-On IP in the AM62L SoC. |
| 83 | +For cluster standby mode to be entered safely, the CPSW driver must be suspended/disabled. This is handled |
| 84 | +in the device tree overlay by disabling CPSW during standby transitions. |
| 85 | + |
| 86 | +**Display Driver Suspension** |
| 87 | + |
| 88 | +Similarly, the display driver must be in a suspended state for cluster standby to function correctly. Ensure |
| 89 | +display is not actively driving output when testing or relying on Standby Mode for power savings. |
| 90 | + |
| 91 | +.. warning:: |
| 92 | + |
| 93 | + Standby Mode only functions correctly when the DISPLAY and CPSW drivers are suspended. The device tree |
| 94 | + overlay :file:`k3-am62l3-evm-idle-states.dtso` disables the CPSW driver to ensure this |
| 95 | + condition is met. Do not override this configuration without understanding the implications for cluster |
| 96 | + idle transitions and hardware stability. |
| 97 | + |
| 98 | +**************************** |
| 99 | +Device Tree Configuration |
| 100 | +**************************** |
| 101 | + |
| 102 | +The AM62L Standby Mode is defined in the device tree overlay. Key configuration elements include: |
| 103 | + |
| 104 | +1. **CPU Idle States** (cpu_sleep_0): |
| 105 | + * Definition of per-CPU WFI idle state |
| 106 | + * Entry and exit latencies |
| 107 | + * Minimum residency duration |
| 108 | + |
| 109 | +2. **Domain Idle States** (cluster_sleep_0): |
| 110 | + * Definition of low-latency cluster standby state |
| 111 | + * Entry and exit latencies |
| 112 | + * Minimum residency duration |
| 113 | + |
| 114 | +3. **Power Domain Hierarchy** (CPU_PD, CLUSTER_PD): |
| 115 | + * Definition of CPU and cluster power domains |
| 116 | + * Domain dependencies and relationships |
| 117 | + * Coordination of which domains can enter standby together |
| 118 | + |
| 119 | +Example structure from :file:`k3-am62l3-evm-idle-states.dtso`: |
| 120 | + |
| 121 | +.. code-block:: dts |
| 122 | +
|
| 123 | + idle-states { |
| 124 | + entry-method = "psci"; |
| 125 | +
|
| 126 | + cpu_sleep_0: stby { |
| 127 | + compatible = "arm,idle-state"; |
| 128 | + idle-state-name = "Standby"; |
| 129 | + arm,psci-suspend-param = <0x00000001>; |
| 130 | + entry-latency-us = <25>; |
| 131 | + exit-latency-us = <100>; |
| 132 | + min-residency-us = <1000>; |
| 133 | + }; |
| 134 | + }; |
| 135 | +
|
| 136 | + domain-idle-states { |
| 137 | + cluster_sleep_0: low-latency-stby { |
| 138 | + compatible = "domain-idle-state"; |
| 139 | + arm,psci-suspend-param = <0x01000021>; |
| 140 | + entry-latency-us = <200>; |
| 141 | + exit-latency-us = <300>; |
| 142 | + min-residency-us = <10000>; |
| 143 | + }; |
| 144 | + }; |
| 145 | +
|
| 146 | + /* Power domain hierarchy for cluster standby coordination */ |
| 147 | + &psci { |
| 148 | + CPU_PD: power-controller-cpu { |
| 149 | + #power-domain-cells = <0>; |
| 150 | + power-domains = <&CLUSTER_PD>; |
| 151 | + domain-idle-states = <&cpu_sleep_0>; |
| 152 | + }; |
| 153 | +
|
| 154 | + CLUSTER_PD: power-controller-cluster { |
| 155 | + #power-domain-cells = <0>; |
| 156 | + domain-idle-states = <&cluster_sleep_0>; |
| 157 | + }; |
| 158 | + }; |
| 159 | +
|
| 160 | +**************************** |
| 161 | +Power Sequencing and Cluster Standby Entry/Exit |
| 162 | +**************************** |
| 163 | + |
| 164 | +When the AM62L system enters Standby Mode and all cores in a cluster become idle: |
| 165 | + |
| 166 | +1. **Detection Phase**: |
| 167 | + - CPUIdle monitors per-CPU idle state transitions |
| 168 | + - Domain idle state manager tracks core idle status |
| 169 | + - When all cores in a cluster are idle, cluster standby opportunity is identified |
| 170 | + |
| 171 | +2. **Coordination Phase**: |
| 172 | + - Linux CPUIdle framework signals cluster idle state via PSCI ``CPU_SUSPEND`` call |
| 173 | + - PSCI parameter encodes cluster standby request with standby state type (not power-down) |
| 174 | + - TF-A receives request in secure monitor |
| 175 | + |
| 176 | +3. **Validation Phase**: |
| 177 | + - TF-A validates the PSCI request parameter sent for cluster standby |
| 178 | + - Checks all cores in cluster are idle |
| 179 | + |
| 180 | +4. **Standby Entry Phase**: |
| 181 | + - TF-A executes cluster standby entry sequence |
| 182 | + - Reduces PLL clock frequencies for non-critical subsystems |
| 183 | + - Disables non-critical power domains |
| 184 | + - Puts DDR into auto-self-refresh mode |
| 185 | + - System enters low-power standby state with reduced power consumption |
| 186 | + |
| 187 | +5. **Wake-Up Phase**: |
| 188 | + - Incoming interrupt triggers wake-up |
| 189 | + - TF-A restores normal PLL frequencies and power domains |
| 190 | + - DDR exits auto-self-refresh mode |
| 191 | + - Cores resume execution with minimal latency |
| 192 | + - System returns to active operation |
| 193 | + |
| 194 | +**************************** |
| 195 | +Monitoring Standby Activity |
| 196 | +**************************** |
| 197 | +Once Standby Mode is enabled, you can monitor idle state activity through the PM generic power domain (genpd) |
| 198 | +sysfs interface. The power domain names are derived from the PSCI power domain hierarchy defined in the device |
| 199 | +tree overlay. |
| 200 | + |
| 201 | +**CPU Idle Activity** |
| 202 | + |
| 203 | +To monitor per-CPU idle state usage: |
| 204 | + |
| 205 | +.. code-block:: console |
| 206 | +
|
| 207 | + # View CPU idle state statistics |
| 208 | + $ cat /sys/kernel/debug/pm_genpd/power-controller-cpu/idle_states |
| 209 | +
|
| 210 | + State Time(ms) Usage Rejected Above Below S2idle |
| 211 | + S0 1052189 34224 0 0 0 0 |
| 212 | +
|
| 213 | +**Cluster Standby Activity (Recommended)** |
| 214 | + |
| 215 | +To monitor cluster-level standby mode usage, which is the most useful metric for verifying that the system |
| 216 | +is successfully entering the low-latency standby mode when all cores are idle: |
| 217 | + |
| 218 | +.. code-block:: console |
| 219 | +
|
| 220 | + # View cluster standby state statistics |
| 221 | + $ cat /sys/kernel/debug/pm_genpd/power-controller-cluster/idle_states |
| 222 | +
|
| 223 | + State Time(ms) Usage Rejected Above Below S2idle |
| 224 | + S0 263595 5415 647 2854 0 0 |
| 225 | +
|
| 226 | +The ``Usage`` counter shows how many times the cluster entered the standby state, while ``Time(ms)`` shows |
| 227 | +the total milliseconds spent in that state. A non-zero Usage count indicates that the cluster standby mode |
| 228 | +is being actively used during idle periods. |
| 229 | + |
| 230 | +**************************** |
| 231 | +Power Consumption Expectations |
| 232 | +**************************** |
| 233 | +The AM62L Standby Mode delivers significant power savings when idle states are enabled. The following measurements |
| 234 | +show the power consumption differences: |
| 235 | + |
| 236 | +**Idle Power Consumption without Standby Idle States** |
| 237 | + |
| 238 | +When standby idle states are not enabled, the system maintains full operational clocking: |
| 239 | + |
| 240 | +.. list-table:: Power Consumption Without Idle States |
| 241 | + :widths: 25 20 |
| 242 | + :header-rows: 1 |
| 243 | + |
| 244 | + * - Rail |
| 245 | + - Average Power (mW) |
| 246 | + |
| 247 | + * - vdd_core |
| 248 | + - 302.65 |
| 249 | + * - soc_dvdd_1v8 |
| 250 | + - 27.03 |
| 251 | + * - soc_dvdd_3v3 |
| 252 | + - 3.74 |
| 253 | + * - vdda_1v8 |
| 254 | + - 29.89 |
| 255 | + * - vdd_lpddr4_pmic2 |
| 256 | + - 55.44 |
| 257 | + * - vdd_rtc |
| 258 | + - 0.045 |
| 259 | + * - vdd_rtc_1v8 |
| 260 | + - 0.016 |
| 261 | + * - **Total System Power** |
| 262 | + - **418.84 mW** |
| 263 | + |
| 264 | +**Idle Power Consumption with Cluster Standby Enabled** |
| 265 | + |
| 266 | +When cluster standby idle states are enabled and the system enters standby during idle periods: |
| 267 | + |
| 268 | +.. list-table:: Power Consumption With Cluster Standby |
| 269 | + :widths: 25 20 |
| 270 | + :header-rows: 1 |
| 271 | + |
| 272 | + * - Rail |
| 273 | + - Average Power (mW) |
| 274 | + |
| 275 | + * - vdd_core |
| 276 | + - 145.47 |
| 277 | + * - soc_dvdd_1v8 |
| 278 | + - 21.70 |
| 279 | + * - soc_dvdd_3v3 |
| 280 | + - 3.54 |
| 281 | + * - vdda_1v8 |
| 282 | + - 29.85 |
| 283 | + * - vdd_lpddr4_pmic2 |
| 284 | + - 21.25 |
| 285 | + * - vdd_rtc |
| 286 | + - 0.038 |
| 287 | + * - vdd_rtc_1v8 |
| 288 | + - 0.017 |
| 289 | + * - **Total System Power** |
| 290 | + - **221.88 mW** |
| 291 | + |
| 292 | +**Power Savings Summary** |
| 293 | + |
| 294 | +The AM62L Standby Mode achieves approximately **47% reduction in total system power consumption** during idle periods: |
| 295 | + |
| 296 | +* **Total Power without Idle States**: ~418.84 mW |
| 297 | +* **Total Power with Cluster Standby**: ~221.88 mW |
| 298 | +* **Power Savings**: ~196.96 mW (47%) |
| 299 | + |
| 300 | +**************************** |
| 301 | +Difference from System Sleep Modes |
| 302 | +**************************** |
| 303 | +Standby Mode is distinct from deeper system sleep modes like Deep Sleep or RTC-Only+DDR: |
| 304 | + |
| 305 | +.. list-table:: Standby vs Deep Sleep Modes |
| 306 | + :widths: 25 35 40 |
| 307 | + :header-rows: 1 |
| 308 | + |
| 309 | + * - Feature |
| 310 | + - Standby Mode |
| 311 | + - Deep Sleep (mem) |
| 312 | + |
| 313 | + * - **Entry** |
| 314 | + - Automatic, opportunistic |
| 315 | + - Explicit user request |
| 316 | + |
| 317 | + * - **CPU State** |
| 318 | + - Idle in standby state, context preserved |
| 319 | + - Offline via hotplug |
| 320 | + |
| 321 | + * - **Wakeup Latency** |
| 322 | + - Microseconds |
| 323 | + - Milliseconds |
| 324 | + |
| 325 | + * - **PLL/Clock State** |
| 326 | + - Reduced frequencies for non-critical subsystems |
| 327 | + - Full frequency restoration required |
| 328 | + |
| 329 | + * - **DDR State** |
| 330 | + - Auto-self-refresh during cluster standby |
| 331 | + - Self-refresh |
| 332 | + |
| 333 | + * - **Use Case** |
| 334 | + - Normal idle periods with fast wakeup |
| 335 | + - Extended inactivity periods |
| 336 | + |
| 337 | +**************************** |
| 338 | +Platform-Specific Implementation Details |
| 339 | +**************************** |
| 340 | +The AM62L Standby Mode implementation uses platform-specific handlers in TF-A: |
| 341 | + |
| 342 | +* :file:`plat/ti/k3low/common/am62l_psci.c` - AM62L PSCI implementation |
| 343 | +* :file:`plat/ti/k3low/board/am62lx/lpm/standby.c` - Cluster standby handler and power sequencing logic |
| 344 | + |
| 345 | +These files implement the ``validate_power_state()`` and ``am62l_entry/exit_standby()`` PSCI platform operations that |
| 346 | +coordinate the idle state requests and manage the actual hardware sequencing for cluster standby entry/exit, |
| 347 | +including clock frequency adjustments and power domain transitions. |
| 348 | + |
| 349 | +**References** |
| 350 | + |
| 351 | +* :ref:`cpuidle-guide` - General CPUIdle framework documentation |
| 352 | +* :ref:`pm_s2idle_psci` - To understand PSCI and OSI mode |
| 353 | +* :ref:`lpm_modes` - Low power modes overview |
| 354 | +* Device Tree Overlay Documentation: :ref:`howto_dt_overlays` |
0 commit comments