162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/power/power-domain.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Generic PM domains
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Rafael J. Wysocki <rjw@rjwysocki.net>
1162306a36Sopenharmony_ci  - Kevin Hilman <khilman@kernel.org>
1262306a36Sopenharmony_ci  - Ulf Hansson <ulf.hansson@linaro.org>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_cidescription: |+
1562306a36Sopenharmony_ci  System on chip designs are often divided into multiple PM domains that can be
1662306a36Sopenharmony_ci  used for power gating of selected IP blocks for power saving by reduced leakage
1762306a36Sopenharmony_ci  current.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci  This device tree binding can be used to bind PM domain consumer devices with
2062306a36Sopenharmony_ci  their PM domains provided by PM domain providers. A PM domain provider can be
2162306a36Sopenharmony_ci  represented by any node in the device tree and can provide one or more PM
2262306a36Sopenharmony_ci  domains. A consumer node can refer to the provider by a phandle and a set of
2362306a36Sopenharmony_ci  phandle arguments (so called PM domain specifiers) of length specified by the
2462306a36Sopenharmony_ci  \#power-domain-cells property in the PM domain provider node.
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciproperties:
2762306a36Sopenharmony_ci  $nodename:
2862306a36Sopenharmony_ci    pattern: "^(power-controller|power-domain)([@-].*)?$"
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci  domain-idle-states:
3162306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle-array
3262306a36Sopenharmony_ci    items:
3362306a36Sopenharmony_ci      maxItems: 1
3462306a36Sopenharmony_ci    description: |
3562306a36Sopenharmony_ci      Phandles of idle states that defines the available states for the
3662306a36Sopenharmony_ci      power-domain provider. The idle state definitions are compatible with the
3762306a36Sopenharmony_ci      domain-idle-state bindings, specified in ./domain-idle-state.yaml.
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci      Note that, the domain-idle-state property reflects the idle states of this
4062306a36Sopenharmony_ci      PM domain and not the idle states of the devices or sub-domains in the PM
4162306a36Sopenharmony_ci      domain. Devices and sub-domains have their own idle states independent of
4262306a36Sopenharmony_ci      the parent domain's idle states. In the absence of this property, the
4362306a36Sopenharmony_ci      domain would be considered as capable of being powered-on or powered-off.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci  operating-points-v2:
4662306a36Sopenharmony_ci    description:
4762306a36Sopenharmony_ci      Phandles to the OPP tables of power domains provided by a power domain
4862306a36Sopenharmony_ci      provider. If the provider provides a single power domain only or all
4962306a36Sopenharmony_ci      the power domains provided by the provider have identical OPP tables,
5062306a36Sopenharmony_ci      then this shall contain a single phandle. Refer to ../opp/opp-v2-base.yaml
5162306a36Sopenharmony_ci      for more information.
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci  "#power-domain-cells":
5462306a36Sopenharmony_ci    description:
5562306a36Sopenharmony_ci      Number of cells in a PM domain specifier. Typically 0 for nodes
5662306a36Sopenharmony_ci      representing a single PM domain and 1 for nodes providing multiple PM
5762306a36Sopenharmony_ci      domains (e.g. power controllers), but can be any value as specified
5862306a36Sopenharmony_ci      by device tree binding documentation of particular provider.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci  power-domains:
6162306a36Sopenharmony_ci    description:
6262306a36Sopenharmony_ci      A phandle and PM domain specifier as defined by bindings of the power
6362306a36Sopenharmony_ci      controller specified by phandle. Some power domains might be powered
6462306a36Sopenharmony_ci      from another power domain (or have other hardware specific
6562306a36Sopenharmony_ci      dependencies). For representing such dependency a standard PM domain
6662306a36Sopenharmony_ci      consumer binding is used. When provided, all domains created
6762306a36Sopenharmony_ci      by the given provider should be subdomains of the domain specified
6862306a36Sopenharmony_ci      by this binding.
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_cirequired:
7162306a36Sopenharmony_ci  - "#power-domain-cells"
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ciadditionalProperties: true
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ciexamples:
7662306a36Sopenharmony_ci  - |
7762306a36Sopenharmony_ci    power: power-controller@12340000 {
7862306a36Sopenharmony_ci        compatible = "foo,power-controller";
7962306a36Sopenharmony_ci        reg = <0x12340000 0x1000>;
8062306a36Sopenharmony_ci        #power-domain-cells = <1>;
8162306a36Sopenharmony_ci    };
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci    // The node above defines a power controller that is a PM domain provider and
8462306a36Sopenharmony_ci    // expects one cell as its phandle argument.
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci  - |
8762306a36Sopenharmony_ci    parent2: power-controller@12340000 {
8862306a36Sopenharmony_ci        compatible = "foo,power-controller";
8962306a36Sopenharmony_ci        reg = <0x12340000 0x1000>;
9062306a36Sopenharmony_ci        #power-domain-cells = <1>;
9162306a36Sopenharmony_ci    };
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci    child2: power-controller@12341000 {
9462306a36Sopenharmony_ci        compatible = "foo,power-controller";
9562306a36Sopenharmony_ci        reg = <0x12341000 0x1000>;
9662306a36Sopenharmony_ci        power-domains = <&parent2 0>;
9762306a36Sopenharmony_ci        #power-domain-cells = <1>;
9862306a36Sopenharmony_ci    };
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci    // The nodes above define two power controllers: 'parent' and 'child'.
10162306a36Sopenharmony_ci    // Domains created by the 'child' power controller are subdomains of '0' power
10262306a36Sopenharmony_ci    // domain provided by the 'parent' power controller.
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci  - |
10562306a36Sopenharmony_ci    parent3: power-controller@12340000 {
10662306a36Sopenharmony_ci        compatible = "foo,power-controller";
10762306a36Sopenharmony_ci        reg = <0x12340000 0x1000>;
10862306a36Sopenharmony_ci        #power-domain-cells = <0>;
10962306a36Sopenharmony_ci        domain-idle-states = <&DOMAIN_RET>, <&DOMAIN_PWR_DN>;
11062306a36Sopenharmony_ci    };
11162306a36Sopenharmony_ci
11262306a36Sopenharmony_ci    child3: power-controller@12341000 {
11362306a36Sopenharmony_ci        compatible = "foo,power-controller";
11462306a36Sopenharmony_ci        reg = <0x12341000 0x1000>;
11562306a36Sopenharmony_ci        power-domains = <&parent3>;
11662306a36Sopenharmony_ci        #power-domain-cells = <0>;
11762306a36Sopenharmony_ci        domain-idle-states = <&DOMAIN_PWR_DN>;
11862306a36Sopenharmony_ci    };
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci    domain-idle-states {
12162306a36Sopenharmony_ci        DOMAIN_RET: domain-retention {
12262306a36Sopenharmony_ci            compatible = "domain-idle-state";
12362306a36Sopenharmony_ci            entry-latency-us = <1000>;
12462306a36Sopenharmony_ci            exit-latency-us = <2000>;
12562306a36Sopenharmony_ci            min-residency-us = <10000>;
12662306a36Sopenharmony_ci        };
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci        DOMAIN_PWR_DN: domain-pwr-dn {
12962306a36Sopenharmony_ci            compatible = "domain-idle-state";
13062306a36Sopenharmony_ci            entry-latency-us = <5000>;
13162306a36Sopenharmony_ci            exit-latency-us = <8000>;
13262306a36Sopenharmony_ci            min-residency-us = <7000>;
13362306a36Sopenharmony_ci        };
13462306a36Sopenharmony_ci    };
135