psci.yaml 7.3 KB

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