diff --git a/source/images/jacinto_s2r_entry.png b/source/images/jacinto_s2r_entry.png new file mode 100644 index 000000000..d0a2bb47b Binary files /dev/null and b/source/images/jacinto_s2r_entry.png differ diff --git a/source/images/jacinto_s2r_exit.png b/source/images/jacinto_s2r_exit.png new file mode 100644 index 000000000..e6498a3b7 Binary files /dev/null and b/source/images/jacinto_s2r_exit.png differ diff --git a/source/linux/Foundational_Components/Power_Management/pm_low_power_modes_socoff.rst b/source/linux/Foundational_Components/Power_Management/pm_low_power_modes_socoff.rst index f30e13d6d..f628b6bc8 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_low_power_modes_socoff.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_low_power_modes_socoff.rst @@ -8,18 +8,106 @@ Low power modes Overview ******** -The following sections describe a high-level description of the different low power modes (LPM) supported on |__PART_FAMILY_NAME__| SoC (System on Chip). -TI EVMs (Evaluation Modules) validate supported low power modes. Each mode needs evaluation based on power consumption and latency (the time it takes to wake-up to Active mode) requirements. -There is a tradeoff between power and latency based on the mode. Users must select the appropriate low power mode at build time to fit the needs of the application. The default mode in the SDK is SoC off. +A typical SOC, from power to HLOS (Linux here for example) takes around 20 seconds to boot (ie reaching till Linux prompt), when it’s ready to +run application. +However, it is desired to run application use cases within 2-3 seconds of power on, for this purpose there are many custom +optimizations done, which are not scalable from platform to platform. +LPM saves partially SW state to DDR which helps in achieving faster boot. + +The following sections describe a high-level description of the different low power modes (LPM) supported on |__PART_FAMILY_DEVICE_NAMES__| SoC (System on Chip). + ++---------------------+---------------+---------------+-------------------------+-----------------------+ +| **Low power Mode** | **SOC State** | **DDR State** | **Retained SW context** | **Lost SW context** | ++---------------------+---------------+---------------+-------------------------+-----------------------+ +| SOC OFF | Power off | Self Refresh | HLOS driver and apps | All fws (R5/M/C) core | ++---------------------+---------------+---------------+-------------------------+-----------------------+ +| I/O only Plus DDR | Power off | Self Refresh | HLOS driver and apps | All fws (R5/M/C) core | +| | except wakeup | | | | +| | I/O | | | | ++---------------------+---------------+---------------+-------------------------+-----------------------+ + +Based upon, requirement of on power consumption and latency (the time it takes to wake-up to Active mode). +User can select the appropriate low power mode at **build time** to fit the needs of the application. +The default mode in the SDK is **SOC OFF**. + +------------------ +LPM entry overview +------------------ +After detecting condition to enter into standby, Application shall close all applications interacting with +remote firmwares, proceed to enter into standby. +This section explains the high-level software flow of low power modes entry. + + .. image:: /images/jacinto_s2r_entry.png + +----------------- +LPM exit overview +----------------- +On receiving wakeup trigger, PMIC will restore power to SOC and SOC resume process will exit DDR from self-refresh mode and restore the +saved software context. +As part of resume process, firmwares of remote cores will be reloaded, Therefore application interacting with remote firmware shall be started again. +This section explains the high-level software flow of low power modes exit. + + .. image:: /images/jacinto_s2r_exit.png + + +********************* +How to Test LPM modes +********************* +To test LPM modes, one needs to ensure that software and hardware configurations are correct. +The following sections have details regarding the hardware and software configurations on TI EVMs. + +---------------------- +Hardware modifications +---------------------- -In SDK offering, following low power modes are supported: +.. ifconfig:: CONFIG_part_variant in ('J784S4') + + Following board modifications are needed to validate SOC_OFF and IO_ONLY_PLUS_DDR low power modes on the J784S4 EVM. + + - Change R534 from pull-down to pull-up to VCCA_3V3 side of C320, VDD_IO_1V8 powered down so that VDD1_DDR_1V8 also powers down unless EN remains high. + - Remove R965, R1167, R1170, and R1169, During DDR RET, RESET must be pulled high. + - R658 moved to R659 + +.. ifconfig:: CONFIG_part_variant in ('J7200') + + By default, SOC_OFF mode can be validated on J7200 EVM without any hardware changes. + In case IO_ONLY_PLUS_DDR needs to be tested user needs to do the following board modification. These modifications will not impact SOC_OFF mode. -#. SoC off -#. I/O Only Plus DDR + - Remove R74 and place it at R610. This will pull the signal high. -******* -SoC off -******* +---------------------- +Software modifications +---------------------- +TI’s K3 Jacinto family of SOCs have a concept of boardcfg that can be used to configure certain parameters at build time. +By default, SDK supports SOC_OFF mode. +IO_ONLY_PLUS_DDR mode will be enabled by changing boardcfg in u-boot at build time. + +The low power mode is set statically at build time in “lpm_cfg” section of the power management board config. +In the u-boot source tree the boardcfg is present at: + +.. ifconfig:: CONFIG_part_variant in ('J7200') + + board/ti/j721e/pm-cfg_j7200.yaml + `J7200 board config `_ . + +.. ifconfig:: CONFIG_part_variant in ('J784S4') + + board/ti/j784s4/pm-cfg.yaml + `J784s4 board config `_ . + +In above board config file, default lpm_mode is 0x5 (SOC_OFF) and suspend_initiator is 0xA (A72_0 host). + +To set the LPM mode as IO_RET_PLUS_DDR. Change lpm_mode to 0x2 + +Sample code is available at +https://gist.github.com/uditkumarti/fd0dfe8aa3dc094aadafecab67048307 + +The lpm mode value can be picked up from: +https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/pm/lpm.html + +--------------- +Testing SoC off +--------------- In SoC off low power mode, DDR retains partial software context (Mainly HLOS - High Level Operating System, Linux in this case) powering off the rest of SoC. This can save a significant amount of boot time, because it does not reinitialize whole kernel as it is already present in DDR. @@ -57,10 +145,11 @@ To exit from SoC off, Press SW15 push button on J784S4 evm. -***************** -I/O only Plus DDR -***************** +---------------------------- +Tesing IO_ONLY_PLUS_DDR mode +---------------------------- +Use u-boot build after changing lpm_mode to 0x2, in boardconfig file. In I/O only plus DDR, only the I/O pins remain active while the system turns off the rest of SoC. #. Low power consumption: IO Only Plus DDR mode can save a significant amount of power, especially in battery-powered @@ -143,3 +232,12 @@ Resume flow, [ 41.416506] PM: suspend exit root@-evm:~# root@-evm:~# + +***************** +Known limitations +***************** +1. Only A core as suspend master supported and tested with Linux. +2. The LPM feature is not supported on HS-SE variant J784S4. +3. If PCIe is being used, the resume latency increases by 1 sec for every PCIe instance, If EP is not connected. +4. Remote core firmwares are getting loaded by Linux on resume. +5. MCU domain R5 core, cannot be used in split mode.