qcom,idle-state.txt 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. QCOM Idle States for cpuidle driver
  2. ARM provides idle-state node to define the cpuidle states, as defined in [1].
  3. cpuidle-qcom is the cpuidle driver for Qualcomm SoCs and uses these idle
  4. states. Idle states have different enter/exit latency and residency values.
  5. The idle states supported by the QCOM SoC are defined as -
  6. * Standby
  7. * Retention
  8. * Standalone Power Collapse (Standalone PC or SPC)
  9. * Power Collapse (PC)
  10. Standby: Standby does a little more in addition to architectural clock gating.
  11. When the WFI instruction is executed the ARM core would gate its internal
  12. clocks. In addition to gating the clocks, QCOM cpus use this instruction as a
  13. trigger to execute the SPM state machine. The SPM state machine waits for the
  14. interrupt to trigger the core back in to active. This triggers the cache
  15. hierarchy to enter standby states, when all cpus are idle. An interrupt brings
  16. the SPM state machine out of its wait, the next step is to ensure that the
  17. cache hierarchy is also out of standby, and then the cpu is allowed to resume
  18. execution. This state is defined as a generic ARM WFI state by the ARM cpuidle
  19. driver and is not defined in the DT. The SPM state machine should be
  20. configured to execute this state by default and after executing every other
  21. state below.
  22. Retention: Retention is a low power state where the core is clock gated and
  23. the memory and the registers associated with the core are retained. The
  24. voltage may be reduced to the minimum value needed to keep the processor
  25. registers active. The SPM should be configured to execute the retention
  26. sequence and would wait for interrupt, before restoring the cpu to execution
  27. state. Retention may have a slightly higher latency than Standby.
  28. Standalone PC: A cpu can power down and warmboot if there is a sufficient time
  29. between the time it enters idle and the next known wake up. SPC mode is used
  30. to indicate a core entering a power down state without consulting any other
  31. cpu or the system resources. This helps save power only on that core. The SPM
  32. sequence for this idle state is programmed to power down the supply to the
  33. core, wait for the interrupt, restore power to the core, and ensure the
  34. system state including cache hierarchy is ready before allowing core to
  35. resume. Applying power and resetting the core causes the core to warmboot
  36. back into Elevation Level (EL) which trampolines the control back to the
  37. kernel. Entering a power down state for the cpu, needs to be done by trapping
  38. into a EL. Failing to do so, would result in a crash enforced by the warm boot
  39. code in the EL for the SoC. On SoCs with write-back L1 cache, the cache has to
  40. be flushed in s/w, before powering down the core.
  41. Power Collapse: This state is similar to the SPC mode, but distinguishes
  42. itself in that the cpu acknowledges and permits the SoC to enter deeper sleep
  43. modes. In a hierarchical power domain SoC, this means L2 and other caches can
  44. be flushed, system bus, clocks - lowered, and SoC main XO clock gated and
  45. voltages reduced, provided all cpus enter this state. Since the span of low
  46. power modes possible at this state is vast, the exit latency and the residency
  47. of this low power mode would be considered high even though at a cpu level,
  48. this essentially is cpu power down. The SPM in this state also may handshake
  49. with the Resource power manager (RPM) processor in the SoC to indicate a
  50. complete application processor subsystem shut down.
  51. The idle-state for QCOM SoCs are distinguished by the compatible property of
  52. the idle-states device node.
  53. The devicetree representation of the idle state should be -
  54. Required properties:
  55. - compatible: Must be one of -
  56. "qcom,idle-state-ret",
  57. "qcom,idle-state-spc",
  58. "qcom,idle-state-pc",
  59. and "arm,idle-state".
  60. Other required and optional properties are specified in [1].
  61. Example:
  62. idle-states {
  63. CPU_SPC: spc {
  64. compatible = "qcom,idle-state-spc", "arm,idle-state";
  65. entry-latency-us = <150>;
  66. exit-latency-us = <200>;
  67. min-residency-us = <2000>;
  68. };
  69. };
  70. [1]. Documentation/devicetree/bindings/arm/idle-states.txt