idle-states.yaml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/cpu/idle-states.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Idle states
  7. maintainers:
  8. - Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
  9. - Anup Patel <anup@brainfault.org>
  10. description: |+
  11. ==========================================
  12. 1 - Introduction
  13. ==========================================
  14. ARM and RISC-V systems contain HW capable of managing power consumption
  15. dynamically, where cores can be put in different low-power states (ranging
  16. from simple wfi to power gating) according to OS PM policies. The CPU states
  17. representing the range of dynamic idle states that a processor can enter at
  18. run-time, can be specified through device tree bindings representing the
  19. parameters required to enter/exit specific idle states on a given processor.
  20. ==========================================
  21. 2 - ARM idle states
  22. ==========================================
  23. According to the Server Base System Architecture document (SBSA, [3]), the
  24. power states an ARM CPU can be put into are identified by the following list:
  25. - Running
  26. - Idle_standby
  27. - Idle_retention
  28. - Sleep
  29. - Off
  30. The power states described in the SBSA document define the basic CPU states on
  31. top of which ARM platforms implement power management schemes that allow an OS
  32. PM implementation to put the processor in different idle states (which include
  33. states listed above; "off" state is not an idle state since it does not have
  34. wake-up capabilities, hence it is not considered in this document).
  35. Idle state parameters (e.g. entry latency) are platform specific and need to
  36. be characterized with bindings that provide the required information to OS PM
  37. code so that it can build the required tables and use them at runtime.
  38. The device tree binding definition for ARM idle states is the subject of this
  39. document.
  40. ==========================================
  41. 3 - RISC-V idle states
  42. ==========================================
  43. On RISC-V systems, the HARTs (or CPUs) [6] can be put in platform specific
  44. suspend (or idle) states (ranging from simple WFI, power gating, etc). The
  45. RISC-V SBI v0.3 (or higher) [7] hart state management extension provides a
  46. standard mechanism for OS to request HART state transitions.
  47. The platform specific suspend (or idle) states of a hart can be either
  48. retentive or non-rententive in nature. A retentive suspend state will
  49. preserve HART registers and CSR values for all privilege modes whereas
  50. a non-retentive suspend state will not preserve HART registers and CSR
  51. values.
  52. ===========================================
  53. 4 - idle-states definitions
  54. ===========================================
  55. Idle states are characterized for a specific system through a set of
  56. timing and energy related properties, that underline the HW behaviour
  57. triggered upon idle states entry and exit.
  58. The following diagram depicts the CPU execution phases and related timing
  59. properties required to enter and exit an idle state:
  60. ..__[EXEC]__|__[PREP]__|__[ENTRY]__|__[IDLE]__|__[EXIT]__|__[EXEC]__..
  61. | | | | |
  62. |<------ entry ------->|
  63. | latency |
  64. |<- exit ->|
  65. | latency |
  66. |<-------- min-residency -------->|
  67. |<------- wakeup-latency ------->|
  68. Diagram 1: CPU idle state execution phases
  69. EXEC: Normal CPU execution.
  70. PREP: Preparation phase before committing the hardware to idle mode
  71. like cache flushing. This is abortable on pending wake-up
  72. event conditions. The abort latency is assumed to be negligible
  73. (i.e. less than the ENTRY + EXIT duration). If aborted, CPU
  74. goes back to EXEC. This phase is optional. If not abortable,
  75. this should be included in the ENTRY phase instead.
  76. ENTRY: The hardware is committed to idle mode. This period must run
  77. to completion up to IDLE before anything else can happen.
  78. IDLE: This is the actual energy-saving idle period. This may last
  79. between 0 and infinite time, until a wake-up event occurs.
  80. EXIT: Period during which the CPU is brought back to operational
  81. mode (EXEC).
  82. entry-latency: Worst case latency required to enter the idle state. The
  83. exit-latency may be guaranteed only after entry-latency has passed.
  84. min-residency: Minimum period, including preparation and entry, for a given
  85. idle state to be worthwhile energywise.
  86. wakeup-latency: Maximum delay between the signaling of a wake-up event and the
  87. CPU being able to execute normal code again. If not specified, this is assumed
  88. to be entry-latency + exit-latency.
  89. These timing parameters can be used by an OS in different circumstances.
  90. An idle CPU requires the expected min-residency time to select the most
  91. appropriate idle state based on the expected expiry time of the next IRQ
  92. (i.e. wake-up) that causes the CPU to return to the EXEC phase.
  93. An operating system scheduler may need to compute the shortest wake-up delay
  94. for CPUs in the system by detecting how long will it take to get a CPU out
  95. of an idle state, e.g.:
  96. wakeup-delay = exit-latency + max(entry-latency - (now - entry-timestamp), 0)
  97. In other words, the scheduler can make its scheduling decision by selecting
  98. (e.g. waking-up) the CPU with the shortest wake-up delay.
  99. The wake-up delay must take into account the entry latency if that period
  100. has not expired. The abortable nature of the PREP period can be ignored
  101. if it cannot be relied upon (e.g. the PREP deadline may occur much sooner than
  102. the worst case since it depends on the CPU operating conditions, i.e. caches
  103. state).
  104. An OS has to reliably probe the wakeup-latency since some devices can enforce
  105. latency constraint guarantees to work properly, so the OS has to detect the
  106. worst case wake-up latency it can incur if a CPU is allowed to enter an
  107. idle state, and possibly to prevent that to guarantee reliable device
  108. functioning.
  109. The min-residency time parameter deserves further explanation since it is
  110. expressed in time units but must factor in energy consumption coefficients.
  111. The energy consumption of a cpu when it enters a power state can be roughly
  112. characterised by the following graph:
  113. |
  114. |
  115. |
  116. e |
  117. n | /---
  118. e | /------
  119. r | /------
  120. g | /-----
  121. y | /------
  122. | ----
  123. | /|
  124. | / |
  125. | / |
  126. | / |
  127. | / |
  128. | / |
  129. |/ |
  130. -----|-------+----------------------------------
  131. 0| 1 time(ms)
  132. Graph 1: Energy vs time example
  133. The graph is split in two parts delimited by time 1ms on the X-axis.
  134. The graph curve with X-axis values = { x | 0 < x < 1ms } has a steep slope
  135. and denotes the energy costs incurred while entering and leaving the idle
  136. state.
  137. The graph curve in the area delimited by X-axis values = {x | x > 1ms } has
  138. shallower slope and essentially represents the energy consumption of the idle
  139. state.
  140. min-residency is defined for a given idle state as the minimum expected
  141. residency time for a state (inclusive of preparation and entry) after
  142. which choosing that state become the most energy efficient option. A good
  143. way to visualise this, is by taking the same graph above and comparing some
  144. states energy consumptions plots.
  145. For sake of simplicity, let's consider a system with two idle states IDLE1,
  146. and IDLE2:
  147. |
  148. |
  149. |
  150. | /-- IDLE1
  151. e | /---
  152. n | /----
  153. e | /---
  154. r | /-----/--------- IDLE2
  155. g | /-------/---------
  156. y | ------------ /---|
  157. | / /---- |
  158. | / /--- |
  159. | / /---- |
  160. | / /--- |
  161. | --- |
  162. | / |
  163. | / |
  164. |/ | time
  165. ---/----------------------------+------------------------
  166. |IDLE1-energy < IDLE2-energy | IDLE2-energy < IDLE1-energy
  167. |
  168. IDLE2-min-residency
  169. Graph 2: idle states min-residency example
  170. In graph 2 above, that takes into account idle states entry/exit energy
  171. costs, it is clear that if the idle state residency time (i.e. time till next
  172. wake-up IRQ) is less than IDLE2-min-residency, IDLE1 is the better idle state
  173. choice energywise.
  174. This is mainly down to the fact that IDLE1 entry/exit energy costs are lower
  175. than IDLE2.
  176. However, the lower power consumption (i.e. shallower energy curve slope) of
  177. idle state IDLE2 implies that after a suitable time, IDLE2 becomes more energy
  178. efficient.
  179. The time at which IDLE2 becomes more energy efficient than IDLE1 (and other
  180. shallower states in a system with multiple idle states) is defined
  181. IDLE2-min-residency and corresponds to the time when energy consumption of
  182. IDLE1 and IDLE2 states breaks even.
  183. The definitions provided in this section underpin the idle states
  184. properties specification that is the subject of the following sections.
  185. ===========================================
  186. 5 - idle-states node
  187. ===========================================
  188. The processor idle states are defined within the idle-states node, which is
  189. a direct child of the cpus node [1] and provides a container where the
  190. processor idle states, defined as device tree nodes, are listed.
  191. On ARM systems, it is a container of processor idle states nodes. If the
  192. system does not provide CPU power management capabilities, or the processor
  193. just supports idle_standby, an idle-states node is not required.
  194. ===========================================
  195. 6 - Qualcomm specific STATES
  196. ===========================================
  197. Idle states have different enter/exit latency and residency values.
  198. The idle states supported by the QCOM SoC are defined as -
  199. * Standby
  200. * Retention
  201. * Standalone Power Collapse (Standalone PC or SPC)
  202. * Power Collapse (PC)
  203. Standby: Standby does a little more in addition to architectural clock gating.
  204. When the WFI instruction is executed the ARM core would gate its internal
  205. clocks. In addition to gating the clocks, QCOM cpus use this instruction as a
  206. trigger to execute the SPM state machine. The SPM state machine waits for the
  207. interrupt to trigger the core back in to active. This triggers the cache
  208. hierarchy to enter standby states, when all cpus are idle. An interrupt brings
  209. the SPM state machine out of its wait, the next step is to ensure that the
  210. cache hierarchy is also out of standby, and then the cpu is allowed to resume
  211. execution. This state is defined as a generic ARM WFI state by the ARM cpuidle
  212. driver and is not defined in the DT. The SPM state machine should be
  213. configured to execute this state by default and after executing every other
  214. state below.
  215. Retention: Retention is a low power state where the core is clock gated and
  216. the memory and the registers associated with the core are retained. The
  217. voltage may be reduced to the minimum value needed to keep the processor
  218. registers active. The SPM should be configured to execute the retention
  219. sequence and would wait for interrupt, before restoring the cpu to execution
  220. state. Retention may have a slightly higher latency than Standby.
  221. Standalone PC: A cpu can power down and warmboot if there is a sufficient time
  222. between the time it enters idle and the next known wake up. SPC mode is used
  223. to indicate a core entering a power down state without consulting any other
  224. cpu or the system resources. This helps save power only on that core. The SPM
  225. sequence for this idle state is programmed to power down the supply to the
  226. core, wait for the interrupt, restore power to the core, and ensure the
  227. system state including cache hierarchy is ready before allowing core to
  228. resume. Applying power and resetting the core causes the core to warmboot
  229. back into Elevation Level (EL) which trampolines the control back to the
  230. kernel. Entering a power down state for the cpu, needs to be done by trapping
  231. into a EL. Failing to do so, would result in a crash enforced by the warm boot
  232. code in the EL for the SoC. On SoCs with write-back L1 cache, the cache has to
  233. be flushed in s/w, before powering down the core.
  234. Power Collapse: This state is similar to the SPC mode, but distinguishes
  235. itself in that the cpu acknowledges and permits the SoC to enter deeper sleep
  236. modes. In a hierarchical power domain SoC, this means L2 and other caches can
  237. be flushed, system bus, clocks - lowered, and SoC main XO clock gated and
  238. voltages reduced, provided all cpus enter this state. Since the span of low
  239. power modes possible at this state is vast, the exit latency and the residency
  240. of this low power mode would be considered high even though at a cpu level,
  241. this essentially is cpu power down. The SPM in this state also may handshake
  242. with the Resource power manager (RPM) processor in the SoC to indicate a
  243. complete application processor subsystem shut down.
  244. ===========================================
  245. 7 - References
  246. ===========================================
  247. [1] ARM Linux Kernel documentation - CPUs bindings
  248. Documentation/devicetree/bindings/arm/cpus.yaml
  249. [2] ARM Linux Kernel documentation - PSCI bindings
  250. Documentation/devicetree/bindings/arm/psci.yaml
  251. [3] ARM Server Base System Architecture (SBSA)
  252. http://infocenter.arm.com/help/index.jsp
  253. [4] ARM Architecture Reference Manuals
  254. http://infocenter.arm.com/help/index.jsp
  255. [5] ARM Linux Kernel documentation - Booting AArch64 Linux
  256. Documentation/arch/arm64/booting.rst
  257. [6] RISC-V Linux Kernel documentation - CPUs bindings
  258. Documentation/devicetree/bindings/riscv/cpus.yaml
  259. [7] RISC-V Supervisor Binary Interface (SBI)
  260. http://github.com/riscv/riscv-sbi-doc/riscv-sbi.adoc
  261. properties:
  262. $nodename:
  263. const: idle-states
  264. entry-method:
  265. description: |
  266. Usage and definition depend on ARM architecture version.
  267. On ARM v8 64-bit this property is required.
  268. On ARM 32-bit systems this property is optional
  269. This assumes that the "enable-method" property is set to "psci" in the cpu
  270. node[5] that is responsible for setting up CPU idle management in the OS
  271. implementation.
  272. const: psci
  273. patternProperties:
  274. "^(cpu|cluster)-":
  275. type: object
  276. description: |
  277. Each state node represents an idle state description and must be defined
  278. as follows.
  279. The idle state entered by executing the wfi instruction (idle_standby
  280. SBSA,[3][4]) is considered standard on all ARM and RISC-V platforms and
  281. therefore must not be listed.
  282. In addition to the properties listed above, a state node may require
  283. additional properties specific to the entry-method defined in the
  284. idle-states node. Please refer to the entry-method bindings
  285. documentation for properties definitions.
  286. properties:
  287. compatible:
  288. oneOf:
  289. - items:
  290. - enum:
  291. - qcom,idle-state-ret
  292. - qcom,idle-state-spc
  293. - qcom,idle-state-pc
  294. - const: arm,idle-state
  295. - enum:
  296. - arm,idle-state
  297. - riscv,idle-state
  298. arm,psci-suspend-param:
  299. $ref: /schemas/types.yaml#/definitions/uint32
  300. description: |
  301. power_state parameter to pass to the ARM PSCI suspend call.
  302. Device tree nodes that require usage of PSCI CPU_SUSPEND function
  303. (i.e. idle states node with entry-method property is set to "psci")
  304. must specify this property.
  305. riscv,sbi-suspend-param:
  306. $ref: /schemas/types.yaml#/definitions/uint32
  307. description: |
  308. suspend_type parameter to pass to the RISC-V SBI HSM suspend call.
  309. This property is required in idle state nodes of device tree meant
  310. for RISC-V systems. For more details on the suspend_type parameter
  311. refer the SBI specification v0.3 (or higher) [7].
  312. local-timer-stop:
  313. description:
  314. If present the CPU local timer control logic is
  315. lost on state entry, otherwise it is retained.
  316. type: boolean
  317. entry-latency-us:
  318. description:
  319. Worst case latency in microseconds required to enter the idle state.
  320. exit-latency-us:
  321. description:
  322. Worst case latency in microseconds required to exit the idle state.
  323. The exit-latency-us duration may be guaranteed only after
  324. entry-latency-us has passed.
  325. min-residency-us:
  326. description:
  327. Minimum residency duration in microseconds, inclusive of preparation
  328. and entry, for this idle state to be considered worthwhile energy wise
  329. (refer to section 2 of this document for a complete description).
  330. wakeup-latency-us:
  331. description: |
  332. Maximum delay between the signaling of a wake-up event and the CPU
  333. being able to execute normal code again. If omitted, this is assumed
  334. to be equal to:
  335. entry-latency-us + exit-latency-us
  336. It is important to supply this value on systems where the duration of
  337. PREP phase (see diagram 1, section 2) is non-neglibigle. In such
  338. systems entry-latency-us + exit-latency-us will exceed
  339. wakeup-latency-us by this duration.
  340. idle-state-name:
  341. $ref: /schemas/types.yaml#/definitions/string
  342. description:
  343. A string used as a descriptive name for the idle state.
  344. additionalProperties: false
  345. required:
  346. - compatible
  347. - entry-latency-us
  348. - exit-latency-us
  349. - min-residency-us
  350. additionalProperties: false
  351. examples:
  352. - |
  353. cpus {
  354. #size-cells = <0>;
  355. #address-cells = <2>;
  356. cpu@0 {
  357. device_type = "cpu";
  358. compatible = "arm,cortex-a57";
  359. reg = <0x0 0x0>;
  360. enable-method = "psci";
  361. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  362. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  363. };
  364. cpu@1 {
  365. device_type = "cpu";
  366. compatible = "arm,cortex-a57";
  367. reg = <0x0 0x1>;
  368. enable-method = "psci";
  369. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  370. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  371. };
  372. cpu@100 {
  373. device_type = "cpu";
  374. compatible = "arm,cortex-a57";
  375. reg = <0x0 0x100>;
  376. enable-method = "psci";
  377. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  378. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  379. };
  380. cpu@101 {
  381. device_type = "cpu";
  382. compatible = "arm,cortex-a57";
  383. reg = <0x0 0x101>;
  384. enable-method = "psci";
  385. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  386. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  387. };
  388. cpu@10000 {
  389. device_type = "cpu";
  390. compatible = "arm,cortex-a57";
  391. reg = <0x0 0x10000>;
  392. enable-method = "psci";
  393. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  394. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  395. };
  396. cpu@10001 {
  397. device_type = "cpu";
  398. compatible = "arm,cortex-a57";
  399. reg = <0x0 0x10001>;
  400. enable-method = "psci";
  401. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  402. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  403. };
  404. cpu@10100 {
  405. device_type = "cpu";
  406. compatible = "arm,cortex-a57";
  407. reg = <0x0 0x10100>;
  408. enable-method = "psci";
  409. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  410. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  411. };
  412. cpu@10101 {
  413. device_type = "cpu";
  414. compatible = "arm,cortex-a57";
  415. reg = <0x0 0x10101>;
  416. enable-method = "psci";
  417. cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,
  418. <&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;
  419. };
  420. cpu@100000000 {
  421. device_type = "cpu";
  422. compatible = "arm,cortex-a53";
  423. reg = <0x1 0x0>;
  424. enable-method = "psci";
  425. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  426. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  427. };
  428. cpu@100000001 {
  429. device_type = "cpu";
  430. compatible = "arm,cortex-a53";
  431. reg = <0x1 0x1>;
  432. enable-method = "psci";
  433. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  434. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  435. };
  436. cpu@100000100 {
  437. device_type = "cpu";
  438. compatible = "arm,cortex-a53";
  439. reg = <0x1 0x100>;
  440. enable-method = "psci";
  441. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  442. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  443. };
  444. cpu@100000101 {
  445. device_type = "cpu";
  446. compatible = "arm,cortex-a53";
  447. reg = <0x1 0x101>;
  448. enable-method = "psci";
  449. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  450. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  451. };
  452. cpu@100010000 {
  453. device_type = "cpu";
  454. compatible = "arm,cortex-a53";
  455. reg = <0x1 0x10000>;
  456. enable-method = "psci";
  457. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  458. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  459. };
  460. cpu@100010001 {
  461. device_type = "cpu";
  462. compatible = "arm,cortex-a53";
  463. reg = <0x1 0x10001>;
  464. enable-method = "psci";
  465. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  466. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  467. };
  468. cpu@100010100 {
  469. device_type = "cpu";
  470. compatible = "arm,cortex-a53";
  471. reg = <0x1 0x10100>;
  472. enable-method = "psci";
  473. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  474. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  475. };
  476. cpu@100010101 {
  477. device_type = "cpu";
  478. compatible = "arm,cortex-a53";
  479. reg = <0x1 0x10101>;
  480. enable-method = "psci";
  481. cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,
  482. <&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;
  483. };
  484. idle-states {
  485. entry-method = "psci";
  486. CPU_RETENTION_0_0: cpu-retention-0-0 {
  487. compatible = "arm,idle-state";
  488. arm,psci-suspend-param = <0x0010000>;
  489. entry-latency-us = <20>;
  490. exit-latency-us = <40>;
  491. min-residency-us = <80>;
  492. };
  493. CLUSTER_RETENTION_0: cluster-retention-0 {
  494. compatible = "arm,idle-state";
  495. local-timer-stop;
  496. arm,psci-suspend-param = <0x1010000>;
  497. entry-latency-us = <50>;
  498. exit-latency-us = <100>;
  499. min-residency-us = <250>;
  500. wakeup-latency-us = <130>;
  501. };
  502. CPU_SLEEP_0_0: cpu-sleep-0-0 {
  503. compatible = "arm,idle-state";
  504. local-timer-stop;
  505. arm,psci-suspend-param = <0x0010000>;
  506. entry-latency-us = <250>;
  507. exit-latency-us = <500>;
  508. min-residency-us = <950>;
  509. };
  510. CLUSTER_SLEEP_0: cluster-sleep-0 {
  511. compatible = "arm,idle-state";
  512. local-timer-stop;
  513. arm,psci-suspend-param = <0x1010000>;
  514. entry-latency-us = <600>;
  515. exit-latency-us = <1100>;
  516. min-residency-us = <2700>;
  517. wakeup-latency-us = <1500>;
  518. };
  519. CPU_RETENTION_1_0: cpu-retention-1-0 {
  520. compatible = "arm,idle-state";
  521. arm,psci-suspend-param = <0x0010000>;
  522. entry-latency-us = <20>;
  523. exit-latency-us = <40>;
  524. min-residency-us = <90>;
  525. };
  526. CLUSTER_RETENTION_1: cluster-retention-1 {
  527. compatible = "arm,idle-state";
  528. local-timer-stop;
  529. arm,psci-suspend-param = <0x1010000>;
  530. entry-latency-us = <50>;
  531. exit-latency-us = <100>;
  532. min-residency-us = <270>;
  533. wakeup-latency-us = <100>;
  534. };
  535. CPU_SLEEP_1_0: cpu-sleep-1-0 {
  536. compatible = "arm,idle-state";
  537. local-timer-stop;
  538. arm,psci-suspend-param = <0x0010000>;
  539. entry-latency-us = <70>;
  540. exit-latency-us = <100>;
  541. min-residency-us = <300>;
  542. wakeup-latency-us = <150>;
  543. };
  544. CLUSTER_SLEEP_1: cluster-sleep-1 {
  545. compatible = "arm,idle-state";
  546. local-timer-stop;
  547. arm,psci-suspend-param = <0x1010000>;
  548. entry-latency-us = <500>;
  549. exit-latency-us = <1200>;
  550. min-residency-us = <3500>;
  551. wakeup-latency-us = <1300>;
  552. };
  553. };
  554. };
  555. - |
  556. // Example 2 (ARM 32-bit, 8-cpu system, two clusters):
  557. cpus {
  558. #size-cells = <0>;
  559. #address-cells = <1>;
  560. cpu@0 {
  561. device_type = "cpu";
  562. compatible = "arm,cortex-a15";
  563. reg = <0x0>;
  564. cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
  565. };
  566. cpu@1 {
  567. device_type = "cpu";
  568. compatible = "arm,cortex-a15";
  569. reg = <0x1>;
  570. cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
  571. };
  572. cpu@2 {
  573. device_type = "cpu";
  574. compatible = "arm,cortex-a15";
  575. reg = <0x2>;
  576. cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
  577. };
  578. cpu@3 {
  579. device_type = "cpu";
  580. compatible = "arm,cortex-a15";
  581. reg = <0x3>;
  582. cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;
  583. };
  584. cpu@100 {
  585. device_type = "cpu";
  586. compatible = "arm,cortex-a7";
  587. reg = <0x100>;
  588. cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
  589. };
  590. cpu@101 {
  591. device_type = "cpu";
  592. compatible = "arm,cortex-a7";
  593. reg = <0x101>;
  594. cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
  595. };
  596. cpu@102 {
  597. device_type = "cpu";
  598. compatible = "arm,cortex-a7";
  599. reg = <0x102>;
  600. cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
  601. };
  602. cpu@103 {
  603. device_type = "cpu";
  604. compatible = "arm,cortex-a7";
  605. reg = <0x103>;
  606. cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;
  607. };
  608. idle-states {
  609. cpu_sleep_0_0: cpu-sleep-0-0 {
  610. compatible = "arm,idle-state";
  611. local-timer-stop;
  612. entry-latency-us = <200>;
  613. exit-latency-us = <100>;
  614. min-residency-us = <400>;
  615. wakeup-latency-us = <250>;
  616. };
  617. cluster_sleep_0: cluster-sleep-0 {
  618. compatible = "arm,idle-state";
  619. local-timer-stop;
  620. entry-latency-us = <500>;
  621. exit-latency-us = <1500>;
  622. min-residency-us = <2500>;
  623. wakeup-latency-us = <1700>;
  624. };
  625. cpu_sleep_1_0: cpu-sleep-1-0 {
  626. compatible = "arm,idle-state";
  627. local-timer-stop;
  628. entry-latency-us = <300>;
  629. exit-latency-us = <500>;
  630. min-residency-us = <900>;
  631. wakeup-latency-us = <600>;
  632. };
  633. cluster_sleep_1: cluster-sleep-1 {
  634. compatible = "arm,idle-state";
  635. local-timer-stop;
  636. entry-latency-us = <800>;
  637. exit-latency-us = <2000>;
  638. min-residency-us = <6500>;
  639. wakeup-latency-us = <2300>;
  640. };
  641. };
  642. };
  643. - |
  644. // Example 3 (RISC-V 64-bit, 4-cpu systems, two clusters):
  645. cpus {
  646. #size-cells = <0>;
  647. #address-cells = <1>;
  648. cpu@0 {
  649. device_type = "cpu";
  650. compatible = "riscv";
  651. reg = <0x0>;
  652. riscv,isa = "rv64imafdc";
  653. mmu-type = "riscv,sv48";
  654. cpu-idle-states = <&CPU_RET_0_0>, <&CPU_NONRET_0_0>,
  655. <&CLUSTER_RET_0>, <&CLUSTER_NONRET_0>;
  656. cpu_intc0: interrupt-controller {
  657. #interrupt-cells = <1>;
  658. compatible = "riscv,cpu-intc";
  659. interrupt-controller;
  660. };
  661. };
  662. cpu@1 {
  663. device_type = "cpu";
  664. compatible = "riscv";
  665. reg = <0x1>;
  666. riscv,isa = "rv64imafdc";
  667. mmu-type = "riscv,sv48";
  668. cpu-idle-states = <&CPU_RET_0_0>, <&CPU_NONRET_0_0>,
  669. <&CLUSTER_RET_0>, <&CLUSTER_NONRET_0>;
  670. cpu_intc1: interrupt-controller {
  671. #interrupt-cells = <1>;
  672. compatible = "riscv,cpu-intc";
  673. interrupt-controller;
  674. };
  675. };
  676. cpu@10 {
  677. device_type = "cpu";
  678. compatible = "riscv";
  679. reg = <0x10>;
  680. riscv,isa = "rv64imafdc";
  681. mmu-type = "riscv,sv48";
  682. cpu-idle-states = <&CPU_RET_1_0>, <&CPU_NONRET_1_0>,
  683. <&CLUSTER_RET_1>, <&CLUSTER_NONRET_1>;
  684. cpu_intc10: interrupt-controller {
  685. #interrupt-cells = <1>;
  686. compatible = "riscv,cpu-intc";
  687. interrupt-controller;
  688. };
  689. };
  690. cpu@11 {
  691. device_type = "cpu";
  692. compatible = "riscv";
  693. reg = <0x11>;
  694. riscv,isa = "rv64imafdc";
  695. mmu-type = "riscv,sv48";
  696. cpu-idle-states = <&CPU_RET_1_0>, <&CPU_NONRET_1_0>,
  697. <&CLUSTER_RET_1>, <&CLUSTER_NONRET_1>;
  698. cpu_intc11: interrupt-controller {
  699. #interrupt-cells = <1>;
  700. compatible = "riscv,cpu-intc";
  701. interrupt-controller;
  702. };
  703. };
  704. idle-states {
  705. CPU_RET_0_0: cpu-retentive-0-0 {
  706. compatible = "riscv,idle-state";
  707. riscv,sbi-suspend-param = <0x10000000>;
  708. entry-latency-us = <20>;
  709. exit-latency-us = <40>;
  710. min-residency-us = <80>;
  711. };
  712. CPU_NONRET_0_0: cpu-nonretentive-0-0 {
  713. compatible = "riscv,idle-state";
  714. riscv,sbi-suspend-param = <0x90000000>;
  715. entry-latency-us = <250>;
  716. exit-latency-us = <500>;
  717. min-residency-us = <950>;
  718. };
  719. CLUSTER_RET_0: cluster-retentive-0 {
  720. compatible = "riscv,idle-state";
  721. riscv,sbi-suspend-param = <0x11000000>;
  722. local-timer-stop;
  723. entry-latency-us = <50>;
  724. exit-latency-us = <100>;
  725. min-residency-us = <250>;
  726. wakeup-latency-us = <130>;
  727. };
  728. CLUSTER_NONRET_0: cluster-nonretentive-0 {
  729. compatible = "riscv,idle-state";
  730. riscv,sbi-suspend-param = <0x91000000>;
  731. local-timer-stop;
  732. entry-latency-us = <600>;
  733. exit-latency-us = <1100>;
  734. min-residency-us = <2700>;
  735. wakeup-latency-us = <1500>;
  736. };
  737. CPU_RET_1_0: cpu-retentive-1-0 {
  738. compatible = "riscv,idle-state";
  739. riscv,sbi-suspend-param = <0x10000010>;
  740. entry-latency-us = <20>;
  741. exit-latency-us = <40>;
  742. min-residency-us = <80>;
  743. };
  744. CPU_NONRET_1_0: cpu-nonretentive-1-0 {
  745. compatible = "riscv,idle-state";
  746. riscv,sbi-suspend-param = <0x90000010>;
  747. entry-latency-us = <250>;
  748. exit-latency-us = <500>;
  749. min-residency-us = <950>;
  750. };
  751. CLUSTER_RET_1: cluster-retentive-1 {
  752. compatible = "riscv,idle-state";
  753. riscv,sbi-suspend-param = <0x11000010>;
  754. local-timer-stop;
  755. entry-latency-us = <50>;
  756. exit-latency-us = <100>;
  757. min-residency-us = <250>;
  758. wakeup-latency-us = <130>;
  759. };
  760. CLUSTER_NONRET_1: cluster-nonretentive-1 {
  761. compatible = "riscv,idle-state";
  762. riscv,sbi-suspend-param = <0x91000010>;
  763. local-timer-stop;
  764. entry-latency-us = <600>;
  765. exit-latency-us = <1100>;
  766. min-residency-us = <2700>;
  767. wakeup-latency-us = <1500>;
  768. };
  769. };
  770. };
  771. // Example 4 - Qualcomm SPC
  772. idle-states {
  773. cpu_spc: cpu-spc {
  774. compatible = "qcom,idle-state-spc", "arm,idle-state";
  775. entry-latency-us = <150>;
  776. exit-latency-us = <200>;
  777. min-residency-us = <2000>;
  778. };
  779. };
  780. ...