mediatek,power-controller.yaml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/power/mediatek,power-controller.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Mediatek Power Domains Controller
  7. maintainers:
  8. - MandyJH Liu <mandyjh.liu@mediatek.com>
  9. - Matthias Brugger <mbrugger@suse.com>
  10. description: |
  11. Mediatek processors include support for multiple power domains which can be
  12. powered up/down by software based on different application scenes to save power.
  13. IP cores belonging to a power domain should contain a 'power-domains'
  14. property that is a phandle for SCPSYS node representing the domain.
  15. properties:
  16. $nodename:
  17. pattern: '^power-controller(@[0-9a-f]+)?$'
  18. compatible:
  19. enum:
  20. - mediatek,mt6795-power-controller
  21. - mediatek,mt8167-power-controller
  22. - mediatek,mt8173-power-controller
  23. - mediatek,mt8183-power-controller
  24. - mediatek,mt8186-power-controller
  25. - mediatek,mt8188-power-controller
  26. - mediatek,mt8192-power-controller
  27. - mediatek,mt8195-power-controller
  28. - mediatek,mt8365-power-controller
  29. '#power-domain-cells':
  30. const: 1
  31. '#address-cells':
  32. const: 1
  33. '#size-cells':
  34. const: 0
  35. patternProperties:
  36. "^power-domain@[0-9a-f]+$":
  37. $ref: "#/$defs/power-domain-node"
  38. patternProperties:
  39. "^power-domain@[0-9a-f]+$":
  40. $ref: "#/$defs/power-domain-node"
  41. patternProperties:
  42. "^power-domain@[0-9a-f]+$":
  43. $ref: "#/$defs/power-domain-node"
  44. patternProperties:
  45. "^power-domain@[0-9a-f]+$":
  46. $ref: "#/$defs/power-domain-node"
  47. unevaluatedProperties: false
  48. unevaluatedProperties: false
  49. unevaluatedProperties: false
  50. unevaluatedProperties: false
  51. $defs:
  52. power-domain-node:
  53. type: object
  54. description: |
  55. Represents the power domains within the power controller node as documented
  56. in Documentation/devicetree/bindings/power/power-domain.yaml.
  57. properties:
  58. '#power-domain-cells':
  59. description:
  60. Must be 0 for nodes representing a single PM domain and 1 for nodes
  61. providing multiple PM domains.
  62. '#address-cells':
  63. const: 1
  64. '#size-cells':
  65. const: 0
  66. reg:
  67. description: |
  68. Power domain index. Valid values are defined in:
  69. "include/dt-bindings/power/mt6795-power.h" - for MT8167 type power domain.
  70. "include/dt-bindings/power/mt8167-power.h" - for MT8167 type power domain.
  71. "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain.
  72. "include/dt-bindings/power/mt8183-power.h" - for MT8183 type power domain.
  73. "include/dt-bindings/power/mediatek,mt8188-power.h" - for MT8188 type power domain.
  74. "include/dt-bindings/power/mt8192-power.h" - for MT8192 type power domain.
  75. "include/dt-bindings/power/mt8195-power.h" - for MT8195 type power domain.
  76. "include/dt-bindings/power/mediatek,mt8365-power.h" - for MT8365 type power domain.
  77. maxItems: 1
  78. clocks:
  79. description: |
  80. A number of phandles to clocks that need to be enabled during domain
  81. power-up sequencing.
  82. clock-names:
  83. description: |
  84. List of names of clocks, in order to match the power-up sequencing
  85. for each power domain we need to group the clocks by name. BASIC
  86. clocks need to be enabled before enabling the corresponding power
  87. domain, and should not have a '-' in their name (i.e mm, mfg, venc).
  88. SUSBYS clocks need to be enabled before releasing the bus protection,
  89. and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).
  90. In order to follow properly the power-up sequencing, the clocks must
  91. be specified by order, adding first the BASIC clocks followed by the
  92. SUSBSYS clocks.
  93. domain-supply:
  94. description: domain regulator supply.
  95. mediatek,infracfg:
  96. $ref: /schemas/types.yaml#/definitions/phandle
  97. description: phandle to the device containing the INFRACFG register range.
  98. mediatek,infracfg-nao:
  99. $ref: /schemas/types.yaml#/definitions/phandle
  100. description: phandle to the device containing the INFRACFG-NAO register range.
  101. mediatek,smi:
  102. $ref: /schemas/types.yaml#/definitions/phandle
  103. description: phandle to the device containing the SMI register range.
  104. required:
  105. - reg
  106. required:
  107. - compatible
  108. additionalProperties: false
  109. examples:
  110. - |
  111. #include <dt-bindings/clock/mt8173-clk.h>
  112. #include <dt-bindings/power/mt8173-power.h>
  113. soc {
  114. #address-cells = <2>;
  115. #size-cells = <2>;
  116. scpsys: syscon@10006000 {
  117. compatible = "mediatek,mt8173-scpsys", "syscon", "simple-mfd";
  118. reg = <0 0x10006000 0 0x1000>;
  119. spm: power-controller {
  120. compatible = "mediatek,mt8173-power-controller";
  121. #address-cells = <1>;
  122. #size-cells = <0>;
  123. #power-domain-cells = <1>;
  124. /* power domains of the SoC */
  125. power-domain@MT8173_POWER_DOMAIN_VDEC {
  126. reg = <MT8173_POWER_DOMAIN_VDEC>;
  127. clocks = <&topckgen CLK_TOP_MM_SEL>;
  128. clock-names = "mm";
  129. #power-domain-cells = <0>;
  130. };
  131. power-domain@MT8173_POWER_DOMAIN_VENC {
  132. reg = <MT8173_POWER_DOMAIN_VENC>;
  133. clocks = <&topckgen CLK_TOP_MM_SEL>,
  134. <&topckgen CLK_TOP_VENC_SEL>;
  135. clock-names = "mm", "venc";
  136. #power-domain-cells = <0>;
  137. };
  138. power-domain@MT8173_POWER_DOMAIN_ISP {
  139. reg = <MT8173_POWER_DOMAIN_ISP>;
  140. clocks = <&topckgen CLK_TOP_MM_SEL>;
  141. clock-names = "mm";
  142. #power-domain-cells = <0>;
  143. };
  144. power-domain@MT8173_POWER_DOMAIN_MM {
  145. reg = <MT8173_POWER_DOMAIN_MM>;
  146. clocks = <&topckgen CLK_TOP_MM_SEL>;
  147. clock-names = "mm";
  148. #power-domain-cells = <0>;
  149. mediatek,infracfg = <&infracfg>;
  150. };
  151. power-domain@MT8173_POWER_DOMAIN_VENC_LT {
  152. reg = <MT8173_POWER_DOMAIN_VENC_LT>;
  153. clocks = <&topckgen CLK_TOP_MM_SEL>,
  154. <&topckgen CLK_TOP_VENC_LT_SEL>;
  155. clock-names = "mm", "venclt";
  156. #power-domain-cells = <0>;
  157. };
  158. power-domain@MT8173_POWER_DOMAIN_AUDIO {
  159. reg = <MT8173_POWER_DOMAIN_AUDIO>;
  160. #power-domain-cells = <0>;
  161. };
  162. power-domain@MT8173_POWER_DOMAIN_USB {
  163. reg = <MT8173_POWER_DOMAIN_USB>;
  164. #power-domain-cells = <0>;
  165. };
  166. power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
  167. reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>;
  168. clocks = <&clk26m>;
  169. clock-names = "mfg";
  170. #address-cells = <1>;
  171. #size-cells = <0>;
  172. #power-domain-cells = <1>;
  173. power-domain@MT8173_POWER_DOMAIN_MFG_2D {
  174. reg = <MT8173_POWER_DOMAIN_MFG_2D>;
  175. #address-cells = <1>;
  176. #size-cells = <0>;
  177. #power-domain-cells = <1>;
  178. power-domain@MT8173_POWER_DOMAIN_MFG {
  179. reg = <MT8173_POWER_DOMAIN_MFG>;
  180. #power-domain-cells = <0>;
  181. mediatek,infracfg = <&infracfg>;
  182. };
  183. };
  184. };
  185. };
  186. };
  187. };