1*c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 2*c66ec88fSEmmanuel Vadot%YAML 1.2 3*c66ec88fSEmmanuel Vadot--- 4*c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/arm/psci.yaml# 5*c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*c66ec88fSEmmanuel Vadot 7*c66ec88fSEmmanuel Vadottitle: Power State Coordination Interface (PSCI) 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel Vadotmaintainers: 10*c66ec88fSEmmanuel Vadot - Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> 11*c66ec88fSEmmanuel Vadot 12*c66ec88fSEmmanuel Vadotdescription: |+ 13*c66ec88fSEmmanuel Vadot Firmware implementing the PSCI functions described in ARM document number 14*c66ec88fSEmmanuel Vadot ARM DEN 0022A ("Power State Coordination Interface System Software on ARM 15*c66ec88fSEmmanuel Vadot processors") can be used by Linux to initiate various CPU-centric power 16*c66ec88fSEmmanuel Vadot operations. 17*c66ec88fSEmmanuel Vadot 18*c66ec88fSEmmanuel Vadot Issue A of the specification describes functions for CPU suspend, hotplug 19*c66ec88fSEmmanuel Vadot and migration of secure software. 20*c66ec88fSEmmanuel Vadot 21*c66ec88fSEmmanuel Vadot Functions are invoked by trapping to the privilege level of the PSCI 22*c66ec88fSEmmanuel Vadot firmware (specified as part of the binding below) and passing arguments 23*c66ec88fSEmmanuel Vadot in a manner similar to that specified by AAPCS: 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel Vadot r0 => 32-bit Function ID / return value 26*c66ec88fSEmmanuel Vadot {r1 - r3} => Parameters 27*c66ec88fSEmmanuel Vadot 28*c66ec88fSEmmanuel Vadot Note that the immediate field of the trapping instruction must be set 29*c66ec88fSEmmanuel Vadot to #0. 30*c66ec88fSEmmanuel Vadot 31*c66ec88fSEmmanuel Vadot [2] Power State Coordination Interface (PSCI) specification 32*c66ec88fSEmmanuel Vadot http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf 33*c66ec88fSEmmanuel Vadot 34*c66ec88fSEmmanuel Vadotproperties: 35*c66ec88fSEmmanuel Vadot $nodename: 36*c66ec88fSEmmanuel Vadot const: psci 37*c66ec88fSEmmanuel Vadot 38*c66ec88fSEmmanuel Vadot compatible: 39*c66ec88fSEmmanuel Vadot oneOf: 40*c66ec88fSEmmanuel Vadot - description: 41*c66ec88fSEmmanuel Vadot For implementations complying to PSCI versions prior to 0.2. 42*c66ec88fSEmmanuel Vadot const: arm,psci 43*c66ec88fSEmmanuel Vadot 44*c66ec88fSEmmanuel Vadot - description: 45*c66ec88fSEmmanuel Vadot For implementations complying to PSCI 0.2. 46*c66ec88fSEmmanuel Vadot const: arm,psci-0.2 47*c66ec88fSEmmanuel Vadot 48*c66ec88fSEmmanuel Vadot - description: 49*c66ec88fSEmmanuel Vadot For implementations complying to PSCI 0.2. 50*c66ec88fSEmmanuel Vadot Function IDs are not required and should be ignored by an OS with 51*c66ec88fSEmmanuel Vadot PSCI 0.2 support, but are permitted to be present for compatibility 52*c66ec88fSEmmanuel Vadot with existing software when "arm,psci" is later in the compatible 53*c66ec88fSEmmanuel Vadot list. 54*c66ec88fSEmmanuel Vadot items: 55*c66ec88fSEmmanuel Vadot - const: arm,psci-0.2 56*c66ec88fSEmmanuel Vadot - const: arm,psci 57*c66ec88fSEmmanuel Vadot 58*c66ec88fSEmmanuel Vadot - description: 59*c66ec88fSEmmanuel Vadot For implementations complying to PSCI 1.0. 60*c66ec88fSEmmanuel Vadot const: arm,psci-1.0 61*c66ec88fSEmmanuel Vadot 62*c66ec88fSEmmanuel Vadot - description: 63*c66ec88fSEmmanuel Vadot For implementations complying to PSCI 1.0. 64*c66ec88fSEmmanuel Vadot PSCI 1.0 is backward compatible with PSCI 0.2 with minor 65*c66ec88fSEmmanuel Vadot specification updates, as defined in the PSCI specification[2]. 66*c66ec88fSEmmanuel Vadot items: 67*c66ec88fSEmmanuel Vadot - const: arm,psci-1.0 68*c66ec88fSEmmanuel Vadot - const: arm,psci-0.2 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel Vadot method: 71*c66ec88fSEmmanuel Vadot description: The method of calling the PSCI firmware. 72*c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/string-array 73*c66ec88fSEmmanuel Vadot enum: 74*c66ec88fSEmmanuel Vadot - smc 75*c66ec88fSEmmanuel Vadot # HVC #0, with the register assignments specified in this binding. 76*c66ec88fSEmmanuel Vadot - hvc 77*c66ec88fSEmmanuel Vadot 78*c66ec88fSEmmanuel Vadot cpu_suspend: 79*c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 80*c66ec88fSEmmanuel Vadot description: Function ID for CPU_SUSPEND operation 81*c66ec88fSEmmanuel Vadot 82*c66ec88fSEmmanuel Vadot cpu_off: 83*c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 84*c66ec88fSEmmanuel Vadot description: Function ID for CPU_OFF operation 85*c66ec88fSEmmanuel Vadot 86*c66ec88fSEmmanuel Vadot cpu_on: 87*c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 88*c66ec88fSEmmanuel Vadot description: Function ID for CPU_ON operation 89*c66ec88fSEmmanuel Vadot 90*c66ec88fSEmmanuel Vadot migrate: 91*c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 92*c66ec88fSEmmanuel Vadot description: Function ID for MIGRATE operation 93*c66ec88fSEmmanuel Vadot 94*c66ec88fSEmmanuel Vadot arm,psci-suspend-param: 95*c66ec88fSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 96*c66ec88fSEmmanuel Vadot description: | 97*c66ec88fSEmmanuel Vadot power_state parameter to pass to the PSCI suspend call. 98*c66ec88fSEmmanuel Vadot 99*c66ec88fSEmmanuel Vadot Device tree nodes that require usage of PSCI CPU_SUSPEND function (ie 100*c66ec88fSEmmanuel Vadot idle state nodes with entry-method property is set to "psci", as per 101*c66ec88fSEmmanuel Vadot bindings in [1]) must specify this property. 102*c66ec88fSEmmanuel Vadot 103*c66ec88fSEmmanuel Vadot [1] Kernel documentation - ARM idle states bindings 104*c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/arm/idle-states.yaml 105*c66ec88fSEmmanuel Vadot 106*c66ec88fSEmmanuel VadotpatternProperties: 107*c66ec88fSEmmanuel Vadot "^power-domain-": 108*c66ec88fSEmmanuel Vadot $ref: "../power/power-domain.yaml#" 109*c66ec88fSEmmanuel Vadot 110*c66ec88fSEmmanuel Vadot type: object 111*c66ec88fSEmmanuel Vadot description: | 112*c66ec88fSEmmanuel Vadot ARM systems can have multiple cores, sometimes in an hierarchical 113*c66ec88fSEmmanuel Vadot arrangement. This often, but not always, maps directly to the processor 114*c66ec88fSEmmanuel Vadot power topology of the system. Individual nodes in a topology have their 115*c66ec88fSEmmanuel Vadot own specific power states and can be better represented hierarchically. 116*c66ec88fSEmmanuel Vadot 117*c66ec88fSEmmanuel Vadot For these cases, the definitions of the idle states for the CPUs and the 118*c66ec88fSEmmanuel Vadot CPU topology, must conform to the binding in [3]. The idle states 119*c66ec88fSEmmanuel Vadot themselves must conform to the binding in [4] and must specify the 120*c66ec88fSEmmanuel Vadot arm,psci-suspend-param property. 121*c66ec88fSEmmanuel Vadot 122*c66ec88fSEmmanuel Vadot It should also be noted that, in PSCI firmware v1.0 the OS-Initiated 123*c66ec88fSEmmanuel Vadot (OSI) CPU suspend mode is introduced. Using a hierarchical representation 124*c66ec88fSEmmanuel Vadot helps to implement support for OSI mode and OS implementations may choose 125*c66ec88fSEmmanuel Vadot to mandate it. 126*c66ec88fSEmmanuel Vadot 127*c66ec88fSEmmanuel Vadot [3] Documentation/devicetree/bindings/power/power-domain.yaml 128*c66ec88fSEmmanuel Vadot [4] Documentation/devicetree/bindings/power/domain-idle-state.yaml 129*c66ec88fSEmmanuel Vadot 130*c66ec88fSEmmanuel Vadotrequired: 131*c66ec88fSEmmanuel Vadot - compatible 132*c66ec88fSEmmanuel Vadot - method 133*c66ec88fSEmmanuel Vadot 134*c66ec88fSEmmanuel VadotallOf: 135*c66ec88fSEmmanuel Vadot - if: 136*c66ec88fSEmmanuel Vadot properties: 137*c66ec88fSEmmanuel Vadot compatible: 138*c66ec88fSEmmanuel Vadot contains: 139*c66ec88fSEmmanuel Vadot const: arm,psci 140*c66ec88fSEmmanuel Vadot then: 141*c66ec88fSEmmanuel Vadot required: 142*c66ec88fSEmmanuel Vadot - cpu_off 143*c66ec88fSEmmanuel Vadot - cpu_on 144*c66ec88fSEmmanuel Vadot 145*c66ec88fSEmmanuel VadotadditionalProperties: false 146*c66ec88fSEmmanuel Vadot 147*c66ec88fSEmmanuel Vadotexamples: 148*c66ec88fSEmmanuel Vadot - |+ 149*c66ec88fSEmmanuel Vadot 150*c66ec88fSEmmanuel Vadot // Case 1: PSCI v0.1 only. 151*c66ec88fSEmmanuel Vadot 152*c66ec88fSEmmanuel Vadot psci { 153*c66ec88fSEmmanuel Vadot compatible = "arm,psci"; 154*c66ec88fSEmmanuel Vadot method = "smc"; 155*c66ec88fSEmmanuel Vadot cpu_suspend = <0x95c10000>; 156*c66ec88fSEmmanuel Vadot cpu_off = <0x95c10001>; 157*c66ec88fSEmmanuel Vadot cpu_on = <0x95c10002>; 158*c66ec88fSEmmanuel Vadot migrate = <0x95c10003>; 159*c66ec88fSEmmanuel Vadot }; 160*c66ec88fSEmmanuel Vadot 161*c66ec88fSEmmanuel Vadot - |+ 162*c66ec88fSEmmanuel Vadot 163*c66ec88fSEmmanuel Vadot // Case 2: PSCI v0.2 only 164*c66ec88fSEmmanuel Vadot 165*c66ec88fSEmmanuel Vadot psci { 166*c66ec88fSEmmanuel Vadot compatible = "arm,psci-0.2"; 167*c66ec88fSEmmanuel Vadot method = "smc"; 168*c66ec88fSEmmanuel Vadot }; 169*c66ec88fSEmmanuel Vadot 170*c66ec88fSEmmanuel Vadot 171*c66ec88fSEmmanuel Vadot - |+ 172*c66ec88fSEmmanuel Vadot 173*c66ec88fSEmmanuel Vadot // Case 3: PSCI v0.2 and PSCI v0.1. 174*c66ec88fSEmmanuel Vadot 175*c66ec88fSEmmanuel Vadot /* 176*c66ec88fSEmmanuel Vadot * A DTB may provide IDs for use by kernels without PSCI 0.2 support, 177*c66ec88fSEmmanuel Vadot * enabling firmware and hypervisors to support existing and new kernels. 178*c66ec88fSEmmanuel Vadot * These IDs will be ignored by kernels with PSCI 0.2 support, which will 179*c66ec88fSEmmanuel Vadot * use the standard PSCI 0.2 IDs exclusively. 180*c66ec88fSEmmanuel Vadot */ 181*c66ec88fSEmmanuel Vadot 182*c66ec88fSEmmanuel Vadot psci { 183*c66ec88fSEmmanuel Vadot compatible = "arm,psci-0.2", "arm,psci"; 184*c66ec88fSEmmanuel Vadot method = "hvc"; 185*c66ec88fSEmmanuel Vadot 186*c66ec88fSEmmanuel Vadot cpu_on = <0x95c10002>; 187*c66ec88fSEmmanuel Vadot cpu_off = <0x95c10001>; 188*c66ec88fSEmmanuel Vadot }; 189*c66ec88fSEmmanuel Vadot 190*c66ec88fSEmmanuel Vadot - |+ 191*c66ec88fSEmmanuel Vadot 192*c66ec88fSEmmanuel Vadot // Case 4: CPUs and CPU idle states described using the hierarchical model. 193*c66ec88fSEmmanuel Vadot 194*c66ec88fSEmmanuel Vadot cpus { 195*c66ec88fSEmmanuel Vadot #size-cells = <0>; 196*c66ec88fSEmmanuel Vadot #address-cells = <1>; 197*c66ec88fSEmmanuel Vadot 198*c66ec88fSEmmanuel Vadot CPU0: cpu@0 { 199*c66ec88fSEmmanuel Vadot device_type = "cpu"; 200*c66ec88fSEmmanuel Vadot compatible = "arm,cortex-a53"; 201*c66ec88fSEmmanuel Vadot reg = <0x0>; 202*c66ec88fSEmmanuel Vadot enable-method = "psci"; 203*c66ec88fSEmmanuel Vadot power-domains = <&CPU_PD0>; 204*c66ec88fSEmmanuel Vadot power-domain-names = "psci"; 205*c66ec88fSEmmanuel Vadot }; 206*c66ec88fSEmmanuel Vadot 207*c66ec88fSEmmanuel Vadot CPU1: cpu@1 { 208*c66ec88fSEmmanuel Vadot device_type = "cpu"; 209*c66ec88fSEmmanuel Vadot compatible = "arm,cortex-a53"; 210*c66ec88fSEmmanuel Vadot reg = <0x100>; 211*c66ec88fSEmmanuel Vadot enable-method = "psci"; 212*c66ec88fSEmmanuel Vadot power-domains = <&CPU_PD1>; 213*c66ec88fSEmmanuel Vadot power-domain-names = "psci"; 214*c66ec88fSEmmanuel Vadot }; 215*c66ec88fSEmmanuel Vadot 216*c66ec88fSEmmanuel Vadot idle-states { 217*c66ec88fSEmmanuel Vadot 218*c66ec88fSEmmanuel Vadot CPU_PWRDN: cpu-power-down { 219*c66ec88fSEmmanuel Vadot compatible = "arm,idle-state"; 220*c66ec88fSEmmanuel Vadot arm,psci-suspend-param = <0x0000001>; 221*c66ec88fSEmmanuel Vadot entry-latency-us = <10>; 222*c66ec88fSEmmanuel Vadot exit-latency-us = <10>; 223*c66ec88fSEmmanuel Vadot min-residency-us = <100>; 224*c66ec88fSEmmanuel Vadot }; 225*c66ec88fSEmmanuel Vadot }; 226*c66ec88fSEmmanuel Vadot 227*c66ec88fSEmmanuel Vadot domain-idle-states { 228*c66ec88fSEmmanuel Vadot 229*c66ec88fSEmmanuel Vadot CLUSTER_RET: cluster-retention { 230*c66ec88fSEmmanuel Vadot compatible = "domain-idle-state"; 231*c66ec88fSEmmanuel Vadot arm,psci-suspend-param = <0x1000011>; 232*c66ec88fSEmmanuel Vadot entry-latency-us = <500>; 233*c66ec88fSEmmanuel Vadot exit-latency-us = <500>; 234*c66ec88fSEmmanuel Vadot min-residency-us = <2000>; 235*c66ec88fSEmmanuel Vadot }; 236*c66ec88fSEmmanuel Vadot 237*c66ec88fSEmmanuel Vadot CLUSTER_PWRDN: cluster-power-down { 238*c66ec88fSEmmanuel Vadot compatible = "domain-idle-state"; 239*c66ec88fSEmmanuel Vadot arm,psci-suspend-param = <0x1000031>; 240*c66ec88fSEmmanuel Vadot entry-latency-us = <2000>; 241*c66ec88fSEmmanuel Vadot exit-latency-us = <2000>; 242*c66ec88fSEmmanuel Vadot min-residency-us = <6000>; 243*c66ec88fSEmmanuel Vadot }; 244*c66ec88fSEmmanuel Vadot }; 245*c66ec88fSEmmanuel Vadot }; 246*c66ec88fSEmmanuel Vadot 247*c66ec88fSEmmanuel Vadot psci { 248*c66ec88fSEmmanuel Vadot compatible = "arm,psci-1.0"; 249*c66ec88fSEmmanuel Vadot method = "smc"; 250*c66ec88fSEmmanuel Vadot 251*c66ec88fSEmmanuel Vadot CPU_PD0: power-domain-cpu0 { 252*c66ec88fSEmmanuel Vadot #power-domain-cells = <0>; 253*c66ec88fSEmmanuel Vadot domain-idle-states = <&CPU_PWRDN>; 254*c66ec88fSEmmanuel Vadot power-domains = <&CLUSTER_PD>; 255*c66ec88fSEmmanuel Vadot }; 256*c66ec88fSEmmanuel Vadot 257*c66ec88fSEmmanuel Vadot CPU_PD1: power-domain-cpu1 { 258*c66ec88fSEmmanuel Vadot #power-domain-cells = <0>; 259*c66ec88fSEmmanuel Vadot domain-idle-states = <&CPU_PWRDN>; 260*c66ec88fSEmmanuel Vadot power-domains = <&CLUSTER_PD>; 261*c66ec88fSEmmanuel Vadot }; 262*c66ec88fSEmmanuel Vadot 263*c66ec88fSEmmanuel Vadot CLUSTER_PD: power-domain-cluster { 264*c66ec88fSEmmanuel Vadot #power-domain-cells = <0>; 265*c66ec88fSEmmanuel Vadot domain-idle-states = <&CLUSTER_RET>, <&CLUSTER_PWRDN>; 266*c66ec88fSEmmanuel Vadot }; 267*c66ec88fSEmmanuel Vadot }; 268*c66ec88fSEmmanuel Vadot... 269