18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/power/power-domain.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Generic PM domains
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Rafael J. Wysocki <rjw@rjwysocki.net>
118c2ecf20Sopenharmony_ci  - Kevin Hilman <khilman@kernel.org>
128c2ecf20Sopenharmony_ci  - Ulf Hansson <ulf.hansson@linaro.org>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cidescription: |+
158c2ecf20Sopenharmony_ci  System on chip designs are often divided into multiple PM domains that can be
168c2ecf20Sopenharmony_ci  used for power gating of selected IP blocks for power saving by reduced leakage
178c2ecf20Sopenharmony_ci  current.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci  This device tree binding can be used to bind PM domain consumer devices with
208c2ecf20Sopenharmony_ci  their PM domains provided by PM domain providers. A PM domain provider can be
218c2ecf20Sopenharmony_ci  represented by any node in the device tree and can provide one or more PM
228c2ecf20Sopenharmony_ci  domains. A consumer node can refer to the provider by a phandle and a set of
238c2ecf20Sopenharmony_ci  phandle arguments (so called PM domain specifiers) of length specified by the
248c2ecf20Sopenharmony_ci  \#power-domain-cells property in the PM domain provider node.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciproperties:
278c2ecf20Sopenharmony_ci  $nodename:
288c2ecf20Sopenharmony_ci    pattern: "^(power-controller|power-domain)([@-].*)?$"
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  domain-idle-states:
318c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle-array
328c2ecf20Sopenharmony_ci    description: |
338c2ecf20Sopenharmony_ci      Phandles of idle states that defines the available states for the
348c2ecf20Sopenharmony_ci      power-domain provider. The idle state definitions are compatible with the
358c2ecf20Sopenharmony_ci      domain-idle-state bindings, specified in ./domain-idle-state.yaml.
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci      Note that, the domain-idle-state property reflects the idle states of this
388c2ecf20Sopenharmony_ci      PM domain and not the idle states of the devices or sub-domains in the PM
398c2ecf20Sopenharmony_ci      domain. Devices and sub-domains have their own idle states independent of
408c2ecf20Sopenharmony_ci      the parent domain's idle states. In the absence of this property, the
418c2ecf20Sopenharmony_ci      domain would be considered as capable of being powered-on or powered-off.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci  operating-points-v2:
448c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle-array
458c2ecf20Sopenharmony_ci    description:
468c2ecf20Sopenharmony_ci      Phandles to the OPP tables of power domains provided by a power domain
478c2ecf20Sopenharmony_ci      provider. If the provider provides a single power domain only or all
488c2ecf20Sopenharmony_ci      the power domains provided by the provider have identical OPP tables,
498c2ecf20Sopenharmony_ci      then this shall contain a single phandle. Refer to ../opp/opp.txt
508c2ecf20Sopenharmony_ci      for more information.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci  "#power-domain-cells":
538c2ecf20Sopenharmony_ci    description:
548c2ecf20Sopenharmony_ci      Number of cells in a PM domain specifier. Typically 0 for nodes
558c2ecf20Sopenharmony_ci      representing a single PM domain and 1 for nodes providing multiple PM
568c2ecf20Sopenharmony_ci      domains (e.g. power controllers), but can be any value as specified
578c2ecf20Sopenharmony_ci      by device tree binding documentation of particular provider.
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci  power-domains:
608c2ecf20Sopenharmony_ci    description:
618c2ecf20Sopenharmony_ci      A phandle and PM domain specifier as defined by bindings of the power
628c2ecf20Sopenharmony_ci      controller specified by phandle. Some power domains might be powered
638c2ecf20Sopenharmony_ci      from another power domain (or have other hardware specific
648c2ecf20Sopenharmony_ci      dependencies). For representing such dependency a standard PM domain
658c2ecf20Sopenharmony_ci      consumer binding is used. When provided, all domains created
668c2ecf20Sopenharmony_ci      by the given provider should be subdomains of the domain specified
678c2ecf20Sopenharmony_ci      by this binding.
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_cirequired:
708c2ecf20Sopenharmony_ci  - "#power-domain-cells"
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ciadditionalProperties: true
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciexamples:
758c2ecf20Sopenharmony_ci  - |
768c2ecf20Sopenharmony_ci    power: power-controller@12340000 {
778c2ecf20Sopenharmony_ci        compatible = "foo,power-controller";
788c2ecf20Sopenharmony_ci        reg = <0x12340000 0x1000>;
798c2ecf20Sopenharmony_ci        #power-domain-cells = <1>;
808c2ecf20Sopenharmony_ci    };
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci    // The node above defines a power controller that is a PM domain provider and
838c2ecf20Sopenharmony_ci    // expects one cell as its phandle argument.
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci  - |
868c2ecf20Sopenharmony_ci    parent2: power-controller@12340000 {
878c2ecf20Sopenharmony_ci        compatible = "foo,power-controller";
888c2ecf20Sopenharmony_ci        reg = <0x12340000 0x1000>;
898c2ecf20Sopenharmony_ci        #power-domain-cells = <1>;
908c2ecf20Sopenharmony_ci    };
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci    child2: power-controller@12341000 {
938c2ecf20Sopenharmony_ci        compatible = "foo,power-controller";
948c2ecf20Sopenharmony_ci        reg = <0x12341000 0x1000>;
958c2ecf20Sopenharmony_ci        power-domains = <&parent2 0>;
968c2ecf20Sopenharmony_ci        #power-domain-cells = <1>;
978c2ecf20Sopenharmony_ci    };
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci    // The nodes above define two power controllers: 'parent' and 'child'.
1008c2ecf20Sopenharmony_ci    // Domains created by the 'child' power controller are subdomains of '0' power
1018c2ecf20Sopenharmony_ci    // domain provided by the 'parent' power controller.
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci  - |
1048c2ecf20Sopenharmony_ci    parent3: power-controller@12340000 {
1058c2ecf20Sopenharmony_ci        compatible = "foo,power-controller";
1068c2ecf20Sopenharmony_ci        reg = <0x12340000 0x1000>;
1078c2ecf20Sopenharmony_ci        #power-domain-cells = <0>;
1088c2ecf20Sopenharmony_ci        domain-idle-states = <&DOMAIN_RET>, <&DOMAIN_PWR_DN>;
1098c2ecf20Sopenharmony_ci    };
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci    child3: power-controller@12341000 {
1128c2ecf20Sopenharmony_ci        compatible = "foo,power-controller";
1138c2ecf20Sopenharmony_ci        reg = <0x12341000 0x1000>;
1148c2ecf20Sopenharmony_ci        power-domains = <&parent3>;
1158c2ecf20Sopenharmony_ci        #power-domain-cells = <0>;
1168c2ecf20Sopenharmony_ci        domain-idle-states = <&DOMAIN_PWR_DN>;
1178c2ecf20Sopenharmony_ci    };
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci    domain-idle-states {
1208c2ecf20Sopenharmony_ci        DOMAIN_RET: domain-retention {
1218c2ecf20Sopenharmony_ci            compatible = "domain-idle-state";
1228c2ecf20Sopenharmony_ci            entry-latency-us = <1000>;
1238c2ecf20Sopenharmony_ci            exit-latency-us = <2000>;
1248c2ecf20Sopenharmony_ci            min-residency-us = <10000>;
1258c2ecf20Sopenharmony_ci        };
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci        DOMAIN_PWR_DN: domain-pwr-dn {
1288c2ecf20Sopenharmony_ci            compatible = "domain-idle-state";
1298c2ecf20Sopenharmony_ci            entry-latency-us = <5000>;
1308c2ecf20Sopenharmony_ci            exit-latency-us = <8000>;
1318c2ecf20Sopenharmony_ci            min-residency-us = <7000>;
1328c2ecf20Sopenharmony_ci        };
1338c2ecf20Sopenharmony_ci    };
134