-
Notifications
You must be signed in to change notification settings - Fork 86
Update and enhance the LPM documentation #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,27 @@ | |
| #. RTC Only Plus DDR | ||
| #. Deep Sleep | ||
|
|
||
| These modes fall into two distinct categories based on whether DDR context is retained: | ||
|
|
||
| - **Power Off**: The system enters a complete poweroff state. DDR context is lost and upon wakeup, | ||
| the system executes a full hardware restart. | ||
|
|
||
| - **Suspend to RAM**: The system suspends with DDR RAM context retained and the state is | ||
| restored on resume, resulting in significantly lower wakeup latency. | ||
|
|
||
| | **Power Off Mode** | ||
| | - RTC Only | ||
|
|
||
| | **Suspend to RAM Mode** | ||
| | - RTC + I/O + DDR | ||
| | - Deep Sleep | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add DSS + DeepSleep also
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
| | - DSS plus DeepSleep | ||
|
|
||
| Power Off Mode | ||
| ************** | ||
|
|
||
| RTC Only | ||
| ******** | ||
| ======== | ||
|
|
||
| RTC Only mode is the deepest low power mode that allows the system to enter a complete poweroff state | ||
| with ultra-low power consumption while maintaining system time and wakeup capability. | ||
|
|
@@ -80,17 +99,41 @@ | |
| detects that the RTC is already programmed and skips the full initialization, performing only minimal | ||
| cleanup to preserve the system time. | ||
|
|
||
| RTC Only Plus DDR | ||
| ***************** | ||
| Suspend to RAM Mode | ||
| ******************* | ||
|
|
||
| Selecting the Suspend to RAM Entry Mechanism | ||
| ============================================ | ||
|
|
||
| When entering suspend to RAM via ``echo mem > /sys/power/state``, the kernel selects the | ||
| low power mode to enter based on the value of ``/sys/power/mem_sleep``: | ||
|
|
||
| - ``deep`` — uses the system suspend path; selected by default. | ||
| Always enters the hardcoded mode selected in the firmware during build time, | ||
|
Check failure on line 112 in source/linux/Foundational_Components/Power_Management/pm_am62lx_low_power_modes.rst
|
||
| which is **DeepSleep** mode by default. | ||
| - ``s2idle`` — uses the Suspend-to-Idle path via PSCI, which allows the platform firmware (TF-A) to select the deepest available mode. | ||
| Allows mode selection in runtime. Mode selected is determined by latency and system configuration. | ||
|
|
||
| To check or change the current default at runtime: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| root@am62lxx-evm:~# cat /sys/power/mem_sleep | ||
| s2idle [deep] | ||
|
|
||
| root@am62lxx-evm:~# echo s2idle > /sys/power/mem_sleep | ||
|
|
||
|
|
||
| For full details on the s2idle path, PSCI integration, and mode selection at runtime, refer to :ref:`pm_s2idle_psci`. | ||
|
|
||
| .. note:: | ||
|
|
||
| Please go through the s2idle docs to understand how to select between multiple low power modes. | ||
| The steps and overall architecture/ sequence diagrams are documented in :ref:`pm_s2idle_psci`. | ||
| The default mode via s2idle is RTC Only Plus DDR, since it's the deepest. | ||
| If the [deep] path is selected in `/sys/power/mem_sleep`, the low power mode | ||
| selection requires special steps to enter. The steps are documented in :ref:`am62l_suspend_workarounds`. | ||
| The default mode is **DeepSleep** mode. | ||
|
|
||
| If regular [mem] interface is selected in `/sys/power/mem_sleep`, the RTC Only + DDR low power mode | ||
| requires special steps to enter. The steps are documented in :ref:`am62l_suspend_workarounds`. | ||
| RTC + I/O + DDR | ||
| ================= | ||
|
|
||
| RTC Only + DDR mode is the deepest low power mode that allows the system to enter a state of lowest power consumption | ||
| while still retaining the DDR RAM context. | ||
|
|
@@ -108,6 +151,13 @@ | |
| root@am62lxx-evm:~# echo disabled > /sys/devices/platform/bus@f0000/f900000.dwc3-usb/power/wakeup | ||
| root@am62lxx-evm:~# echo disabled > /sys/devices/platform/bus@f0000/f910000.dwc3-usb/power/wakeup | ||
|
|
||
| .. note:: | ||
|
|
||
| Without the disabling USB as a wakeup source, upon resume the USB driver will crash and the system will not resume, | ||
| while using the [deep] path. | ||
|
|
||
| For the [s2idle] path, if USB0 or USB1 is enabled as a wakeup source the system will enter DeepSleep instead of RTC + I/O + DDR. | ||
|
|
||
| Now the SoC can be suspended using the following command. | ||
|
|
||
| .. code-block:: console | ||
|
|
@@ -132,7 +182,7 @@ | |
| [ 222.445468] PM: suspend exit | ||
|
|
||
| DeepSleep | ||
| ********* | ||
| ========= | ||
|
|
||
| DeepSleep AKA Suspend-to-RAM is a low-power mode that allows the SoC | ||
| to retain its state in RAM while the processor is turned off. | ||
|
|
@@ -144,7 +194,16 @@ | |
| power to key modules such as GPIO and others is maintained to allow wakeup events | ||
| to exit out of this mode. | ||
|
|
||
| In order to enter DeepSleep, | ||
| DeepSleep is the default mode entered using the [deep] path in `/sys/power/mem_sleep`. | ||
|
|
||
| To enter DeepSleep mode using the [s2idle] path, set the cpu latency constraint between that of DeepSleep(350ms) and RTC + I/O + DDR(900ms) mode. | ||
| Refer :ref:`setting-cpu-wakeup-latency` to see how to set the CPU wakeup latency constraint. | ||
|
|
||
| Use the following command to set the constraint to 500ms, which will allow the system to enter DeepSleep mode. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| exec 4<>/dev/cpu_wakeup_latency; echo 0x7a120 >&4 | ||
|
|
||
| .. code-block:: console | ||
|
|
||
|
|
@@ -172,6 +231,8 @@ | |
| [ 88.649913] PM: suspend exit | ||
| root@am62lxx-evm:~# | ||
|
|
||
| Execute the above commands in a subshell to avoid accidentally keeping the file descriptor open indefinitely. | ||
|
|
||
| Memory Usage | ||
| ************ | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that this modification is sufficient to hardcode mode value to 6?
For my understanding, we assign mode = am62l_lpm_state but this instruction is executed only for S2idle, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the mode = am62l_lpm_state is only executed for the s2idle path. For the deep, we only need to make the above change