Path: blob/master/Documentation/devicetree/bindings/cpu/idle-states.yaml
26307 views
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)1%YAML 1.22---3$id: http://devicetree.org/schemas/cpu/idle-states.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: Idle states78maintainers:9- Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>10- Anup Patel <anup@brainfault.org>1112description: |+13==========================================141 - Introduction15==========================================1617ARM and RISC-V systems contain HW capable of managing power consumption18dynamically, where cores can be put in different low-power states (ranging19from simple wfi to power gating) according to OS PM policies. The CPU states20representing the range of dynamic idle states that a processor can enter at21run-time, can be specified through device tree bindings representing the22parameters required to enter/exit specific idle states on a given processor.2324==========================================252 - ARM idle states26==========================================2728According to the Server Base System Architecture document (SBSA, [3]), the29power states an ARM CPU can be put into are identified by the following list:3031- Running32- Idle_standby33- Idle_retention34- Sleep35- Off3637The power states described in the SBSA document define the basic CPU states on38top of which ARM platforms implement power management schemes that allow an OS39PM implementation to put the processor in different idle states (which include40states listed above; "off" state is not an idle state since it does not have41wake-up capabilities, hence it is not considered in this document).4243Idle state parameters (e.g. entry latency) are platform specific and need to44be characterized with bindings that provide the required information to OS PM45code so that it can build the required tables and use them at runtime.4647The device tree binding definition for ARM idle states is the subject of this48document.4950==========================================513 - RISC-V idle states52==========================================5354On RISC-V systems, the HARTs (or CPUs) [6] can be put in platform specific55suspend (or idle) states (ranging from simple WFI, power gating, etc). The56RISC-V SBI v0.3 (or higher) [7] hart state management extension provides a57standard mechanism for OS to request HART state transitions.5859The platform specific suspend (or idle) states of a hart can be either60retentive or non-rententive in nature. A retentive suspend state will61preserve HART registers and CSR values for all privilege modes whereas62a non-retentive suspend state will not preserve HART registers and CSR63values.6465===========================================664 - idle-states definitions67===========================================6869Idle states are characterized for a specific system through a set of70timing and energy related properties, that underline the HW behaviour71triggered upon idle states entry and exit.7273The following diagram depicts the CPU execution phases and related timing74properties required to enter and exit an idle state:7576..__[EXEC]__|__[PREP]__|__[ENTRY]__|__[IDLE]__|__[EXIT]__|__[EXEC]__..77| | | | |7879|<------ entry ------->|80| latency |81|<- exit ->|82| latency |83|<-------- min-residency -------->|84|<------- wakeup-latency ------->|8586Diagram 1: CPU idle state execution phases8788EXEC: Normal CPU execution.8990PREP: Preparation phase before committing the hardware to idle mode91like cache flushing. This is abortable on pending wake-up92event conditions. The abort latency is assumed to be negligible93(i.e. less than the ENTRY + EXIT duration). If aborted, CPU94goes back to EXEC. This phase is optional. If not abortable,95this should be included in the ENTRY phase instead.9697ENTRY: The hardware is committed to idle mode. This period must run98to completion up to IDLE before anything else can happen.99100IDLE: This is the actual energy-saving idle period. This may last101between 0 and infinite time, until a wake-up event occurs.102103EXIT: Period during which the CPU is brought back to operational104mode (EXEC).105106entry-latency: Worst case latency required to enter the idle state. The107exit-latency may be guaranteed only after entry-latency has passed.108109min-residency: Minimum period, including preparation and entry, for a given110idle state to be worthwhile energywise.111112wakeup-latency: Maximum delay between the signaling of a wake-up event and the113CPU being able to execute normal code again. If not specified, this is assumed114to be entry-latency + exit-latency.115116These timing parameters can be used by an OS in different circumstances.117118An idle CPU requires the expected min-residency time to select the most119appropriate idle state based on the expected expiry time of the next IRQ120(i.e. wake-up) that causes the CPU to return to the EXEC phase.121122An operating system scheduler may need to compute the shortest wake-up delay123for CPUs in the system by detecting how long will it take to get a CPU out124of an idle state, e.g.:125126wakeup-delay = exit-latency + max(entry-latency - (now - entry-timestamp), 0)127128In other words, the scheduler can make its scheduling decision by selecting129(e.g. waking-up) the CPU with the shortest wake-up delay.130The wake-up delay must take into account the entry latency if that period131has not expired. The abortable nature of the PREP period can be ignored132if it cannot be relied upon (e.g. the PREP deadline may occur much sooner than133the worst case since it depends on the CPU operating conditions, i.e. caches134state).135136An OS has to reliably probe the wakeup-latency since some devices can enforce137latency constraint guarantees to work properly, so the OS has to detect the138worst case wake-up latency it can incur if a CPU is allowed to enter an139idle state, and possibly to prevent that to guarantee reliable device140functioning.141142The min-residency time parameter deserves further explanation since it is143expressed in time units but must factor in energy consumption coefficients.144145The energy consumption of a cpu when it enters a power state can be roughly146characterised by the following graph:147148|149|150|151e |152n | /---153e | /------154r | /------155g | /-----156y | /------157| ----158| /|159| / |160| / |161| / |162| / |163| / |164|/ |165-----|-------+----------------------------------1660| 1 time(ms)167168Graph 1: Energy vs time example169170The graph is split in two parts delimited by time 1ms on the X-axis.171The graph curve with X-axis values = { x | 0 < x < 1ms } has a steep slope172and denotes the energy costs incurred while entering and leaving the idle173state.174The graph curve in the area delimited by X-axis values = {x | x > 1ms } has175shallower slope and essentially represents the energy consumption of the idle176state.177178min-residency is defined for a given idle state as the minimum expected179residency time for a state (inclusive of preparation and entry) after180which choosing that state become the most energy efficient option. A good181way to visualise this, is by taking the same graph above and comparing some182states energy consumptions plots.183184For sake of simplicity, let's consider a system with two idle states IDLE1,185and IDLE2:186187|188|189|190| /-- IDLE1191e | /---192n | /----193e | /---194r | /-----/--------- IDLE2195g | /-------/---------196y | ------------ /---|197| / /---- |198| / /--- |199| / /---- |200| / /--- |201| --- |202| / |203| / |204|/ | time205---/----------------------------+------------------------206|IDLE1-energy < IDLE2-energy | IDLE2-energy < IDLE1-energy207|208IDLE2-min-residency209210Graph 2: idle states min-residency example211212In graph 2 above, that takes into account idle states entry/exit energy213costs, it is clear that if the idle state residency time (i.e. time till next214wake-up IRQ) is less than IDLE2-min-residency, IDLE1 is the better idle state215choice energywise.216217This is mainly down to the fact that IDLE1 entry/exit energy costs are lower218than IDLE2.219220However, the lower power consumption (i.e. shallower energy curve slope) of221idle state IDLE2 implies that after a suitable time, IDLE2 becomes more energy222efficient.223224The time at which IDLE2 becomes more energy efficient than IDLE1 (and other225shallower states in a system with multiple idle states) is defined226IDLE2-min-residency and corresponds to the time when energy consumption of227IDLE1 and IDLE2 states breaks even.228229The definitions provided in this section underpin the idle states230properties specification that is the subject of the following sections.231232===========================================2335 - idle-states node234===========================================235236The processor idle states are defined within the idle-states node, which is237a direct child of the cpus node [1] and provides a container where the238processor idle states, defined as device tree nodes, are listed.239240On ARM systems, it is a container of processor idle states nodes. If the241system does not provide CPU power management capabilities, or the processor242just supports idle_standby, an idle-states node is not required.243244===========================================2456 - Qualcomm specific STATES246===========================================247248Idle states have different enter/exit latency and residency values.249The idle states supported by the QCOM SoC are defined as -250251* Standby252* Retention253* Standalone Power Collapse (Standalone PC or SPC)254* Power Collapse (PC)255256Standby: Standby does a little more in addition to architectural clock gating.257When the WFI instruction is executed the ARM core would gate its internal258clocks. In addition to gating the clocks, QCOM cpus use this instruction as a259trigger to execute the SPM state machine. The SPM state machine waits for the260interrupt to trigger the core back in to active. This triggers the cache261hierarchy to enter standby states, when all cpus are idle. An interrupt brings262the SPM state machine out of its wait, the next step is to ensure that the263cache hierarchy is also out of standby, and then the cpu is allowed to resume264execution. This state is defined as a generic ARM WFI state by the ARM cpuidle265driver and is not defined in the DT. The SPM state machine should be266configured to execute this state by default and after executing every other267state below.268269Retention: Retention is a low power state where the core is clock gated and270the memory and the registers associated with the core are retained. The271voltage may be reduced to the minimum value needed to keep the processor272registers active. The SPM should be configured to execute the retention273sequence and would wait for interrupt, before restoring the cpu to execution274state. Retention may have a slightly higher latency than Standby.275276Standalone PC: A cpu can power down and warmboot if there is a sufficient time277between the time it enters idle and the next known wake up. SPC mode is used278to indicate a core entering a power down state without consulting any other279cpu or the system resources. This helps save power only on that core. The SPM280sequence for this idle state is programmed to power down the supply to the281core, wait for the interrupt, restore power to the core, and ensure the282system state including cache hierarchy is ready before allowing core to283resume. Applying power and resetting the core causes the core to warmboot284back into Elevation Level (EL) which trampolines the control back to the285kernel. Entering a power down state for the cpu, needs to be done by trapping286into a EL. Failing to do so, would result in a crash enforced by the warm boot287code in the EL for the SoC. On SoCs with write-back L1 cache, the cache has to288be flushed in s/w, before powering down the core.289290Power Collapse: This state is similar to the SPC mode, but distinguishes291itself in that the cpu acknowledges and permits the SoC to enter deeper sleep292modes. In a hierarchical power domain SoC, this means L2 and other caches can293be flushed, system bus, clocks - lowered, and SoC main XO clock gated and294voltages reduced, provided all cpus enter this state. Since the span of low295power modes possible at this state is vast, the exit latency and the residency296of this low power mode would be considered high even though at a cpu level,297this essentially is cpu power down. The SPM in this state also may handshake298with the Resource power manager (RPM) processor in the SoC to indicate a299complete application processor subsystem shut down.300301===========================================3027 - References303===========================================304305[1] ARM Linux Kernel documentation - CPUs bindings306Documentation/devicetree/bindings/arm/cpus.yaml307308[2] ARM Linux Kernel documentation - PSCI bindings309Documentation/devicetree/bindings/arm/psci.yaml310311[3] ARM Server Base System Architecture (SBSA)312http://infocenter.arm.com/help/index.jsp313314[4] ARM Architecture Reference Manuals315http://infocenter.arm.com/help/index.jsp316317[5] ARM Linux Kernel documentation - Booting AArch64 Linux318Documentation/arch/arm64/booting.rst319320[6] RISC-V Linux Kernel documentation - CPUs bindings321Documentation/devicetree/bindings/riscv/cpus.yaml322323[7] RISC-V Supervisor Binary Interface (SBI)324http://github.com/riscv/riscv-sbi-doc/riscv-sbi.adoc325326properties:327$nodename:328const: idle-states329330entry-method:331description: |332Usage and definition depend on ARM architecture version.333334On ARM v8 64-bit this property is required.335On ARM 32-bit systems this property is optional336337This assumes that the "enable-method" property is set to "psci" in the cpu338node[5] that is responsible for setting up CPU idle management in the OS339implementation.340const: psci341342patternProperties:343"^(cpu|cluster)-":344type: object345description: |346Each state node represents an idle state description and must be defined347as follows.348349The idle state entered by executing the wfi instruction (idle_standby350SBSA,[3][4]) is considered standard on all ARM and RISC-V platforms and351therefore must not be listed.352353In addition to the properties listed above, a state node may require354additional properties specific to the entry-method defined in the355idle-states node. Please refer to the entry-method bindings356documentation for properties definitions.357358properties:359compatible:360oneOf:361- items:362- enum:363- qcom,idle-state-ret364- qcom,idle-state-spc365- qcom,idle-state-pc366- const: arm,idle-state367- enum:368- arm,idle-state369- riscv,idle-state370371arm,psci-suspend-param:372$ref: /schemas/types.yaml#/definitions/uint32373description: |374power_state parameter to pass to the ARM PSCI suspend call.375376Device tree nodes that require usage of PSCI CPU_SUSPEND function377(i.e. idle states node with entry-method property is set to "psci")378must specify this property.379380riscv,sbi-suspend-param:381$ref: /schemas/types.yaml#/definitions/uint32382description: |383suspend_type parameter to pass to the RISC-V SBI HSM suspend call.384385This property is required in idle state nodes of device tree meant386for RISC-V systems. For more details on the suspend_type parameter387refer the SBI specification v0.3 (or higher) [7].388389local-timer-stop:390description:391If present the CPU local timer control logic is392lost on state entry, otherwise it is retained.393type: boolean394395entry-latency-us:396description:397Worst case latency in microseconds required to enter the idle state.398399exit-latency-us:400description:401Worst case latency in microseconds required to exit the idle state.402The exit-latency-us duration may be guaranteed only after403entry-latency-us has passed.404405min-residency-us:406description:407Minimum residency duration in microseconds, inclusive of preparation408and entry, for this idle state to be considered worthwhile energy wise409(refer to section 2 of this document for a complete description).410411wakeup-latency-us:412description: |413Maximum delay between the signaling of a wake-up event and the CPU414being able to execute normal code again. If omitted, this is assumed415to be equal to:416417entry-latency-us + exit-latency-us418419It is important to supply this value on systems where the duration of420PREP phase (see diagram 1, section 2) is non-neglibigle. In such421systems entry-latency-us + exit-latency-us will exceed422wakeup-latency-us by this duration.423424idle-state-name:425$ref: /schemas/types.yaml#/definitions/string426description:427A string used as a descriptive name for the idle state.428429additionalProperties: false430431required:432- compatible433- entry-latency-us434- exit-latency-us435- min-residency-us436437additionalProperties: false438439examples:440- |441442cpus {443#size-cells = <0>;444#address-cells = <2>;445446cpu@0 {447device_type = "cpu";448compatible = "arm,cortex-a57";449reg = <0x0 0x0>;450enable-method = "psci";451cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,452<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;453};454455cpu@1 {456device_type = "cpu";457compatible = "arm,cortex-a57";458reg = <0x0 0x1>;459enable-method = "psci";460cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,461<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;462};463464cpu@100 {465device_type = "cpu";466compatible = "arm,cortex-a57";467reg = <0x0 0x100>;468enable-method = "psci";469cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,470<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;471};472473cpu@101 {474device_type = "cpu";475compatible = "arm,cortex-a57";476reg = <0x0 0x101>;477enable-method = "psci";478cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,479<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;480};481482cpu@10000 {483device_type = "cpu";484compatible = "arm,cortex-a57";485reg = <0x0 0x10000>;486enable-method = "psci";487cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,488<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;489};490491cpu@10001 {492device_type = "cpu";493compatible = "arm,cortex-a57";494reg = <0x0 0x10001>;495enable-method = "psci";496cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,497<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;498};499500cpu@10100 {501device_type = "cpu";502compatible = "arm,cortex-a57";503reg = <0x0 0x10100>;504enable-method = "psci";505cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,506<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;507};508509cpu@10101 {510device_type = "cpu";511compatible = "arm,cortex-a57";512reg = <0x0 0x10101>;513enable-method = "psci";514cpu-idle-states = <&CPU_RETENTION_0_0>, <&CPU_SLEEP_0_0>,515<&CLUSTER_RETENTION_0>, <&CLUSTER_SLEEP_0>;516};517518cpu@100000000 {519device_type = "cpu";520compatible = "arm,cortex-a53";521reg = <0x1 0x0>;522enable-method = "psci";523cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,524<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;525};526527cpu@100000001 {528device_type = "cpu";529compatible = "arm,cortex-a53";530reg = <0x1 0x1>;531enable-method = "psci";532cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,533<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;534};535536cpu@100000100 {537device_type = "cpu";538compatible = "arm,cortex-a53";539reg = <0x1 0x100>;540enable-method = "psci";541cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,542<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;543};544545cpu@100000101 {546device_type = "cpu";547compatible = "arm,cortex-a53";548reg = <0x1 0x101>;549enable-method = "psci";550cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,551<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;552};553554cpu@100010000 {555device_type = "cpu";556compatible = "arm,cortex-a53";557reg = <0x1 0x10000>;558enable-method = "psci";559cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,560<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;561};562563cpu@100010001 {564device_type = "cpu";565compatible = "arm,cortex-a53";566reg = <0x1 0x10001>;567enable-method = "psci";568cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,569<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;570};571572cpu@100010100 {573device_type = "cpu";574compatible = "arm,cortex-a53";575reg = <0x1 0x10100>;576enable-method = "psci";577cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,578<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;579};580581cpu@100010101 {582device_type = "cpu";583compatible = "arm,cortex-a53";584reg = <0x1 0x10101>;585enable-method = "psci";586cpu-idle-states = <&CPU_RETENTION_1_0>, <&CPU_SLEEP_1_0>,587<&CLUSTER_RETENTION_1>, <&CLUSTER_SLEEP_1>;588};589590idle-states {591entry-method = "psci";592593CPU_RETENTION_0_0: cpu-retention-0-0 {594compatible = "arm,idle-state";595arm,psci-suspend-param = <0x0010000>;596entry-latency-us = <20>;597exit-latency-us = <40>;598min-residency-us = <80>;599};600601CLUSTER_RETENTION_0: cluster-retention-0 {602compatible = "arm,idle-state";603local-timer-stop;604arm,psci-suspend-param = <0x1010000>;605entry-latency-us = <50>;606exit-latency-us = <100>;607min-residency-us = <250>;608wakeup-latency-us = <130>;609};610611CPU_SLEEP_0_0: cpu-sleep-0-0 {612compatible = "arm,idle-state";613local-timer-stop;614arm,psci-suspend-param = <0x0010000>;615entry-latency-us = <250>;616exit-latency-us = <500>;617min-residency-us = <950>;618};619620CLUSTER_SLEEP_0: cluster-sleep-0 {621compatible = "arm,idle-state";622local-timer-stop;623arm,psci-suspend-param = <0x1010000>;624entry-latency-us = <600>;625exit-latency-us = <1100>;626min-residency-us = <2700>;627wakeup-latency-us = <1500>;628};629630CPU_RETENTION_1_0: cpu-retention-1-0 {631compatible = "arm,idle-state";632arm,psci-suspend-param = <0x0010000>;633entry-latency-us = <20>;634exit-latency-us = <40>;635min-residency-us = <90>;636};637638CLUSTER_RETENTION_1: cluster-retention-1 {639compatible = "arm,idle-state";640local-timer-stop;641arm,psci-suspend-param = <0x1010000>;642entry-latency-us = <50>;643exit-latency-us = <100>;644min-residency-us = <270>;645wakeup-latency-us = <100>;646};647648CPU_SLEEP_1_0: cpu-sleep-1-0 {649compatible = "arm,idle-state";650local-timer-stop;651arm,psci-suspend-param = <0x0010000>;652entry-latency-us = <70>;653exit-latency-us = <100>;654min-residency-us = <300>;655wakeup-latency-us = <150>;656};657658CLUSTER_SLEEP_1: cluster-sleep-1 {659compatible = "arm,idle-state";660local-timer-stop;661arm,psci-suspend-param = <0x1010000>;662entry-latency-us = <500>;663exit-latency-us = <1200>;664min-residency-us = <3500>;665wakeup-latency-us = <1300>;666};667};668};669670- |671// Example 2 (ARM 32-bit, 8-cpu system, two clusters):672673cpus {674#size-cells = <0>;675#address-cells = <1>;676677cpu@0 {678device_type = "cpu";679compatible = "arm,cortex-a15";680reg = <0x0>;681cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;682};683684cpu@1 {685device_type = "cpu";686compatible = "arm,cortex-a15";687reg = <0x1>;688cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;689};690691cpu@2 {692device_type = "cpu";693compatible = "arm,cortex-a15";694reg = <0x2>;695cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;696};697698cpu@3 {699device_type = "cpu";700compatible = "arm,cortex-a15";701reg = <0x3>;702cpu-idle-states = <&cpu_sleep_0_0>, <&cluster_sleep_0>;703};704705cpu@100 {706device_type = "cpu";707compatible = "arm,cortex-a7";708reg = <0x100>;709cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;710};711712cpu@101 {713device_type = "cpu";714compatible = "arm,cortex-a7";715reg = <0x101>;716cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;717};718719cpu@102 {720device_type = "cpu";721compatible = "arm,cortex-a7";722reg = <0x102>;723cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;724};725726cpu@103 {727device_type = "cpu";728compatible = "arm,cortex-a7";729reg = <0x103>;730cpu-idle-states = <&cpu_sleep_1_0>, <&cluster_sleep_1>;731};732733idle-states {734cpu_sleep_0_0: cpu-sleep-0-0 {735compatible = "arm,idle-state";736local-timer-stop;737entry-latency-us = <200>;738exit-latency-us = <100>;739min-residency-us = <400>;740wakeup-latency-us = <250>;741};742743cluster_sleep_0: cluster-sleep-0 {744compatible = "arm,idle-state";745local-timer-stop;746entry-latency-us = <500>;747exit-latency-us = <1500>;748min-residency-us = <2500>;749wakeup-latency-us = <1700>;750};751752cpu_sleep_1_0: cpu-sleep-1-0 {753compatible = "arm,idle-state";754local-timer-stop;755entry-latency-us = <300>;756exit-latency-us = <500>;757min-residency-us = <900>;758wakeup-latency-us = <600>;759};760761cluster_sleep_1: cluster-sleep-1 {762compatible = "arm,idle-state";763local-timer-stop;764entry-latency-us = <800>;765exit-latency-us = <2000>;766min-residency-us = <6500>;767wakeup-latency-us = <2300>;768};769};770};771772- |773// Example 3 (RISC-V 64-bit, 4-cpu systems, two clusters):774775cpus {776#size-cells = <0>;777#address-cells = <1>;778779cpu@0 {780device_type = "cpu";781compatible = "riscv";782reg = <0x0>;783riscv,isa = "rv64imafdc";784mmu-type = "riscv,sv48";785cpu-idle-states = <&CPU_RET_0_0>, <&CPU_NONRET_0_0>,786<&CLUSTER_RET_0>, <&CLUSTER_NONRET_0>;787788cpu_intc0: interrupt-controller {789#interrupt-cells = <1>;790compatible = "riscv,cpu-intc";791interrupt-controller;792};793};794795cpu@1 {796device_type = "cpu";797compatible = "riscv";798reg = <0x1>;799riscv,isa = "rv64imafdc";800mmu-type = "riscv,sv48";801cpu-idle-states = <&CPU_RET_0_0>, <&CPU_NONRET_0_0>,802<&CLUSTER_RET_0>, <&CLUSTER_NONRET_0>;803804cpu_intc1: interrupt-controller {805#interrupt-cells = <1>;806compatible = "riscv,cpu-intc";807interrupt-controller;808};809};810811cpu@10 {812device_type = "cpu";813compatible = "riscv";814reg = <0x10>;815riscv,isa = "rv64imafdc";816mmu-type = "riscv,sv48";817cpu-idle-states = <&CPU_RET_1_0>, <&CPU_NONRET_1_0>,818<&CLUSTER_RET_1>, <&CLUSTER_NONRET_1>;819820cpu_intc10: interrupt-controller {821#interrupt-cells = <1>;822compatible = "riscv,cpu-intc";823interrupt-controller;824};825};826827cpu@11 {828device_type = "cpu";829compatible = "riscv";830reg = <0x11>;831riscv,isa = "rv64imafdc";832mmu-type = "riscv,sv48";833cpu-idle-states = <&CPU_RET_1_0>, <&CPU_NONRET_1_0>,834<&CLUSTER_RET_1>, <&CLUSTER_NONRET_1>;835836cpu_intc11: interrupt-controller {837#interrupt-cells = <1>;838compatible = "riscv,cpu-intc";839interrupt-controller;840};841};842843idle-states {844CPU_RET_0_0: cpu-retentive-0-0 {845compatible = "riscv,idle-state";846riscv,sbi-suspend-param = <0x10000000>;847entry-latency-us = <20>;848exit-latency-us = <40>;849min-residency-us = <80>;850};851852CPU_NONRET_0_0: cpu-nonretentive-0-0 {853compatible = "riscv,idle-state";854riscv,sbi-suspend-param = <0x90000000>;855entry-latency-us = <250>;856exit-latency-us = <500>;857min-residency-us = <950>;858};859860CLUSTER_RET_0: cluster-retentive-0 {861compatible = "riscv,idle-state";862riscv,sbi-suspend-param = <0x11000000>;863local-timer-stop;864entry-latency-us = <50>;865exit-latency-us = <100>;866min-residency-us = <250>;867wakeup-latency-us = <130>;868};869870CLUSTER_NONRET_0: cluster-nonretentive-0 {871compatible = "riscv,idle-state";872riscv,sbi-suspend-param = <0x91000000>;873local-timer-stop;874entry-latency-us = <600>;875exit-latency-us = <1100>;876min-residency-us = <2700>;877wakeup-latency-us = <1500>;878};879880CPU_RET_1_0: cpu-retentive-1-0 {881compatible = "riscv,idle-state";882riscv,sbi-suspend-param = <0x10000010>;883entry-latency-us = <20>;884exit-latency-us = <40>;885min-residency-us = <80>;886};887888CPU_NONRET_1_0: cpu-nonretentive-1-0 {889compatible = "riscv,idle-state";890riscv,sbi-suspend-param = <0x90000010>;891entry-latency-us = <250>;892exit-latency-us = <500>;893min-residency-us = <950>;894};895896CLUSTER_RET_1: cluster-retentive-1 {897compatible = "riscv,idle-state";898riscv,sbi-suspend-param = <0x11000010>;899local-timer-stop;900entry-latency-us = <50>;901exit-latency-us = <100>;902min-residency-us = <250>;903wakeup-latency-us = <130>;904};905906CLUSTER_NONRET_1: cluster-nonretentive-1 {907compatible = "riscv,idle-state";908riscv,sbi-suspend-param = <0x91000010>;909local-timer-stop;910entry-latency-us = <600>;911exit-latency-us = <1100>;912min-residency-us = <2700>;913wakeup-latency-us = <1500>;914};915};916};917918// Example 4 - Qualcomm SPC919idle-states {920cpu_spc: cpu-spc {921compatible = "qcom,idle-state-spc", "arm,idle-state";922entry-latency-us = <150>;923exit-latency-us = <200>;924min-residency-us = <2000>;925};926};927...928929930