Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: power: Add bindings for the Mediatek SCPSYS power domains controller

The System Control Processor System (SCPSYS) has several power management
related tasks in the system. Add the bindings to define the power
domains for the SCPSYS power controller.

Co-developed-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201030113622.201188-2-enric.balletbo@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>

authored by

Enric Balletbo i Serra and committed by
Matthias Brugger
d392fe78 3650b228

+289
+289
Documentation/devicetree/bindings/power/mediatek,power-controller.yaml
··· 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 + 7 + title: Mediatek Power Domains Controller 8 + 9 + maintainers: 10 + - Weiyi Lu <weiyi.lu@mediatek.com> 11 + - Matthias Brugger <mbrugger@suse.com> 12 + 13 + description: | 14 + Mediatek processors include support for multiple power domains which can be 15 + powered up/down by software based on different application scenes to save power. 16 + 17 + IP cores belonging to a power domain should contain a 'power-domains' 18 + property that is a phandle for SCPSYS node representing the domain. 19 + 20 + properties: 21 + $nodename: 22 + const: power-controller 23 + 24 + compatible: 25 + enum: 26 + - mediatek,mt8173-power-controller 27 + 28 + '#power-domain-cells': 29 + const: 1 30 + 31 + '#address-cells': 32 + const: 1 33 + 34 + '#size-cells': 35 + const: 0 36 + 37 + patternProperties: 38 + "^power-domain@[0-9a-f]+$": 39 + type: object 40 + description: | 41 + Represents the power domains within the power controller node as documented 42 + in Documentation/devicetree/bindings/power/power-domain.yaml. 43 + 44 + properties: 45 + 46 + '#power-domain-cells': 47 + description: 48 + Must be 0 for nodes representing a single PM domain and 1 for nodes 49 + providing multiple PM domains. 50 + 51 + '#address-cells': 52 + const: 1 53 + 54 + '#size-cells': 55 + const: 0 56 + 57 + reg: 58 + description: | 59 + Power domain index. Valid values are defined in: 60 + "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain. 61 + maxItems: 1 62 + 63 + clocks: 64 + description: | 65 + A number of phandles to clocks that need to be enabled during domain 66 + power-up sequencing. 67 + 68 + clock-names: 69 + description: | 70 + List of names of clocks, in order to match the power-up sequencing 71 + for each power domain we need to group the clocks by name. BASIC 72 + clocks need to be enabled before enabling the corresponding power 73 + domain, and should not have a '-' in their name (i.e mm, mfg, venc). 74 + SUSBYS clocks need to be enabled before releasing the bus protection, 75 + and should contain a '-' in their name (i.e mm-0, isp-0, cam-0). 76 + 77 + In order to follow properly the power-up sequencing, the clocks must 78 + be specified by order, adding first the BASIC clocks followed by the 79 + SUSBSYS clocks. 80 + 81 + mediatek,infracfg: 82 + $ref: /schemas/types.yaml#definitions/phandle 83 + description: phandle to the device containing the INFRACFG register range. 84 + 85 + mediatek,smi: 86 + $ref: /schemas/types.yaml#definitions/phandle 87 + description: phandle to the device containing the SMI register range. 88 + 89 + patternProperties: 90 + "^power-domain@[0-9a-f]+$": 91 + type: object 92 + description: | 93 + Represents a power domain child within a power domain parent node. 94 + 95 + properties: 96 + 97 + '#power-domain-cells': 98 + description: 99 + Must be 0 for nodes representing a single PM domain and 1 for nodes 100 + providing multiple PM domains. 101 + 102 + '#address-cells': 103 + const: 1 104 + 105 + '#size-cells': 106 + const: 0 107 + 108 + reg: 109 + maxItems: 1 110 + 111 + clocks: 112 + description: | 113 + A number of phandles to clocks that need to be enabled during domain 114 + power-up sequencing. 115 + 116 + clock-names: 117 + description: | 118 + List of names of clocks, in order to match the power-up sequencing 119 + for each power domain we need to group the clocks by name. BASIC 120 + clocks need to be enabled before enabling the corresponding power 121 + domain, and should not have a '-' in their name (i.e mm, mfg, venc). 122 + SUSBYS clocks need to be enabled before releasing the bus protection, 123 + and should contain a '-' in their name (i.e mm-0, isp-0, cam-0). 124 + 125 + In order to follow properly the power-up sequencing, the clocks must 126 + be specified by order, adding first the BASIC clocks followed by the 127 + SUSBSYS clocks. 128 + 129 + mediatek,infracfg: 130 + $ref: /schemas/types.yaml#definitions/phandle 131 + description: phandle to the device containing the INFRACFG register range. 132 + 133 + mediatek,smi: 134 + $ref: /schemas/types.yaml#definitions/phandle 135 + description: phandle to the device containing the SMI register range. 136 + 137 + patternProperties: 138 + "^power-domain@[0-9a-f]+$": 139 + type: object 140 + description: | 141 + Represents a power domain child within a power domain parent node. 142 + 143 + properties: 144 + 145 + '#power-domain-cells': 146 + description: 147 + Must be 0 for nodes representing a single PM domain and 1 for nodes 148 + providing multiple PM domains. 149 + 150 + '#address-cells': 151 + const: 1 152 + 153 + '#size-cells': 154 + const: 0 155 + 156 + reg: 157 + maxItems: 1 158 + 159 + clocks: 160 + description: | 161 + A number of phandles to clocks that need to be enabled during domain 162 + power-up sequencing. 163 + 164 + clock-names: 165 + description: | 166 + List of names of clocks, in order to match the power-up sequencing 167 + for each power domain we need to group the clocks by name. BASIC 168 + clocks need to be enabled before enabling the corresponding power 169 + domain, and should not have a '-' in their name (i.e mm, mfg, venc). 170 + SUSBYS clocks need to be enabled before releasing the bus protection, 171 + and should contain a '-' in their name (i.e mm-0, isp-0, cam-0). 172 + 173 + In order to follow properly the power-up sequencing, the clocks must 174 + be specified by order, adding first the BASIC clocks followed by the 175 + SUSBSYS clocks. 176 + 177 + mediatek,infracfg: 178 + $ref: /schemas/types.yaml#definitions/phandle 179 + description: phandle to the device containing the INFRACFG register range. 180 + 181 + mediatek,smi: 182 + $ref: /schemas/types.yaml#definitions/phandle 183 + description: phandle to the device containing the SMI register range. 184 + 185 + required: 186 + - reg 187 + 188 + additionalProperties: false 189 + 190 + required: 191 + - reg 192 + 193 + additionalProperties: false 194 + 195 + required: 196 + - reg 197 + 198 + additionalProperties: false 199 + 200 + required: 201 + - compatible 202 + 203 + additionalProperties: false 204 + 205 + examples: 206 + - | 207 + #include <dt-bindings/clock/mt8173-clk.h> 208 + #include <dt-bindings/power/mt8173-power.h> 209 + 210 + soc { 211 + #address-cells = <2>; 212 + #size-cells = <2>; 213 + 214 + scpsys: syscon@10006000 { 215 + compatible = "syscon", "simple-mfd"; 216 + reg = <0 0x10006000 0 0x1000>; 217 + 218 + spm: power-controller { 219 + compatible = "mediatek,mt8173-power-controller"; 220 + #address-cells = <1>; 221 + #size-cells = <0>; 222 + #power-domain-cells = <1>; 223 + 224 + /* power domains of the SoC */ 225 + power-domain@MT8173_POWER_DOMAIN_VDEC { 226 + reg = <MT8173_POWER_DOMAIN_VDEC>; 227 + clocks = <&topckgen CLK_TOP_MM_SEL>; 228 + clock-names = "mm"; 229 + #power-domain-cells = <0>; 230 + }; 231 + power-domain@MT8173_POWER_DOMAIN_VENC { 232 + reg = <MT8173_POWER_DOMAIN_VENC>; 233 + clocks = <&topckgen CLK_TOP_MM_SEL>, 234 + <&topckgen CLK_TOP_VENC_SEL>; 235 + clock-names = "mm", "venc"; 236 + #power-domain-cells = <0>; 237 + }; 238 + power-domain@MT8173_POWER_DOMAIN_ISP { 239 + reg = <MT8173_POWER_DOMAIN_ISP>; 240 + clocks = <&topckgen CLK_TOP_MM_SEL>; 241 + clock-names = "mm"; 242 + #power-domain-cells = <0>; 243 + }; 244 + power-domain@MT8173_POWER_DOMAIN_MM { 245 + reg = <MT8173_POWER_DOMAIN_MM>; 246 + clocks = <&topckgen CLK_TOP_MM_SEL>; 247 + clock-names = "mm"; 248 + #power-domain-cells = <0>; 249 + mediatek,infracfg = <&infracfg>; 250 + }; 251 + power-domain@MT8173_POWER_DOMAIN_VENC_LT { 252 + reg = <MT8173_POWER_DOMAIN_VENC_LT>; 253 + clocks = <&topckgen CLK_TOP_MM_SEL>, 254 + <&topckgen CLK_TOP_VENC_LT_SEL>; 255 + clock-names = "mm", "venclt"; 256 + #power-domain-cells = <0>; 257 + }; 258 + power-domain@MT8173_POWER_DOMAIN_AUDIO { 259 + reg = <MT8173_POWER_DOMAIN_AUDIO>; 260 + #power-domain-cells = <0>; 261 + }; 262 + power-domain@MT8173_POWER_DOMAIN_USB { 263 + reg = <MT8173_POWER_DOMAIN_USB>; 264 + #power-domain-cells = <0>; 265 + }; 266 + power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC { 267 + reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>; 268 + clocks = <&clk26m>; 269 + clock-names = "mfg"; 270 + #address-cells = <1>; 271 + #size-cells = <0>; 272 + #power-domain-cells = <1>; 273 + 274 + power-domain@MT8173_POWER_DOMAIN_MFG_2D { 275 + reg = <MT8173_POWER_DOMAIN_MFG_2D>; 276 + #address-cells = <1>; 277 + #size-cells = <0>; 278 + #power-domain-cells = <1>; 279 + 280 + power-domain@MT8173_POWER_DOMAIN_MFG { 281 + reg = <MT8173_POWER_DOMAIN_MFG>; 282 + #power-domain-cells = <0>; 283 + mediatek,infracfg = <&infracfg>; 284 + }; 285 + }; 286 + }; 287 + }; 288 + }; 289 + };