xref: /linux/Documentation/devicetree/bindings/opp/opp-v2-base.yaml (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
194274f20SRob Herring# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
294274f20SRob Herring%YAML 1.2
394274f20SRob Herring---
494274f20SRob Herring$id: http://devicetree.org/schemas/opp/opp-v2-base.yaml#
594274f20SRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
694274f20SRob Herring
7ab040c42SKrzysztof Kozlowskititle: Generic OPP (Operating Performance Points) Common Properties
894274f20SRob Herring
994274f20SRob Herringmaintainers:
1094274f20SRob Herring  - Viresh Kumar <viresh.kumar@linaro.org>
1194274f20SRob Herring
1294274f20SRob Herringdescription: |
1394274f20SRob Herring  Devices work at voltage-current-frequency combinations and some implementations
1494274f20SRob Herring  have the liberty of choosing these. These combinations are called Operating
1594274f20SRob Herring  Performance Points aka OPPs. This document defines bindings for these OPPs
1694274f20SRob Herring  applicable across wide range of devices. For illustration purpose, this document
1794274f20SRob Herring  uses CPU as a device.
1894274f20SRob Herring
1994274f20SRob Herring  This describes the OPPs belonging to a device.
2094274f20SRob Herring
2194274f20SRob Herringselect: false
2294274f20SRob Herring
2394274f20SRob Herringproperties:
2494274f20SRob Herring  $nodename:
2594274f20SRob Herring    pattern: '^opp-table(-[a-z0-9]+)?$'
2694274f20SRob Herring
2794274f20SRob Herring  opp-shared:
2894274f20SRob Herring    description:
2994274f20SRob Herring      Indicates that device nodes using this OPP Table Node's phandle switch
3094274f20SRob Herring      their DVFS state together, i.e. they share clock/voltage/current lines.
3194274f20SRob Herring      Missing property means devices have independent clock/voltage/current
3294274f20SRob Herring      lines, but they share OPP tables.
3394274f20SRob Herring    type: boolean
3494274f20SRob Herring
3594274f20SRob HerringpatternProperties:
367ca81b69SDmitry Osipenko  '^opp(-?[0-9]+)*$':
3794274f20SRob Herring    type: object
3894274f20SRob Herring    description:
3994274f20SRob Herring      One or more OPP nodes describing voltage-current-frequency combinations.
4094274f20SRob Herring      Their name isn't significant but their phandle can be used to reference an
4194274f20SRob Herring      OPP. These are mandatory except for the case where the OPP table is
4294274f20SRob Herring      present only to indicate dependency between devices using the opp-shared
4394274f20SRob Herring      property.
4494274f20SRob Herring
4594274f20SRob Herring    properties:
4694274f20SRob Herring      opp-hz:
4794274f20SRob Herring        description:
4894274f20SRob Herring          Frequency in Hz, expressed as a 64-bit big-endian integer. This is a
4994274f20SRob Herring          required property for all device nodes, unless another "required"
5094274f20SRob Herring          property to uniquely identify the OPP nodes exists. Devices like power
5194274f20SRob Herring          domains must have another (implementation dependent) property.
5294274f20SRob Herring
533cb16ad6SKrzysztof Kozlowski          Entries for multiple clocks shall be provided in the same field, as
543cb16ad6SKrzysztof Kozlowski          array of frequencies.  The OPP binding doesn't provide any provisions
553cb16ad6SKrzysztof Kozlowski          to relate the values to their clocks or the order in which the clocks
563cb16ad6SKrzysztof Kozlowski          need to be configured and that is left for the implementation
573cb16ad6SKrzysztof Kozlowski          specific binding.
583cb16ad6SKrzysztof Kozlowski        minItems: 1
59*c2add32cSManivannan Sadhasivam        maxItems: 32
603cb16ad6SKrzysztof Kozlowski
6194274f20SRob Herring      opp-microvolt:
6294274f20SRob Herring        description: |
6394274f20SRob Herring          Voltage for the OPP
6494274f20SRob Herring
6594274f20SRob Herring          A single regulator's voltage is specified with an array of size one or three.
6694274f20SRob Herring          Single entry is for target voltage and three entries are for <target min max>
6794274f20SRob Herring          voltages.
6894274f20SRob Herring
6994274f20SRob Herring          Entries for multiple regulators shall be provided in the same field separated
7094274f20SRob Herring          by angular brackets <>. The OPP binding doesn't provide any provisions to
7194274f20SRob Herring          relate the values to their power supplies or the order in which the supplies
7294274f20SRob Herring          need to be configured and that is left for the implementation specific
7394274f20SRob Herring          binding.
7494274f20SRob Herring
7594274f20SRob Herring          Entries for all regulators shall be of the same size, i.e. either all use a
7694274f20SRob Herring          single value or triplets.
7794274f20SRob Herring        minItems: 1
7894274f20SRob Herring        maxItems: 8   # Should be enough regulators
7994274f20SRob Herring        items:
8094274f20SRob Herring          minItems: 1
8194274f20SRob Herring          maxItems: 3
8294274f20SRob Herring
8394274f20SRob Herring      opp-microamp:
8494274f20SRob Herring        description: |
8594274f20SRob Herring          The maximum current drawn by the device in microamperes considering
8694274f20SRob Herring          system specific parameters (such as transients, process, aging,
8794274f20SRob Herring          maximum operating temperature range etc.) as necessary. This may be
8894274f20SRob Herring          used to set the most efficient regulator operating mode.
8994274f20SRob Herring
9094274f20SRob Herring          Should only be set if opp-microvolt or opp-microvolt-<name> is set for
9194274f20SRob Herring          the OPP.
9294274f20SRob Herring
9394274f20SRob Herring          Entries for multiple regulators shall be provided in the same field
9494274f20SRob Herring          separated by angular brackets <>. If current values aren't required
9594274f20SRob Herring          for a regulator, then it shall be filled with 0. If current values
9694274f20SRob Herring          aren't required for any of the regulators, then this field is not
9794274f20SRob Herring          required. The OPP binding doesn't provide any provisions to relate the
9894274f20SRob Herring          values to their power supplies or the order in which the supplies need
9994274f20SRob Herring          to be configured and that is left for the implementation specific
10094274f20SRob Herring          binding.
10194274f20SRob Herring        minItems: 1
10294274f20SRob Herring        maxItems: 8   # Should be enough regulators
10394274f20SRob Herring
1040409ab77SLukasz Luba      opp-microwatt:
1050409ab77SLukasz Luba        description: |
1060409ab77SLukasz Luba          The power for the OPP in micro-Watts.
1070409ab77SLukasz Luba
1080409ab77SLukasz Luba          Entries for multiple regulators shall be provided in the same field
109d0c46b59SViresh Kumar          separated by angular brackets <>. If power values aren't required
1100409ab77SLukasz Luba          for a regulator, then it shall be filled with 0. If power values
1110409ab77SLukasz Luba          aren't required for any of the regulators, then this field is not
1120409ab77SLukasz Luba          required. The OPP binding doesn't provide any provisions to relate the
1130409ab77SLukasz Luba          values to their power supplies or the order in which the supplies need
1140409ab77SLukasz Luba          to be configured and that is left for the implementation specific
1150409ab77SLukasz Luba          binding.
1160409ab77SLukasz Luba        minItems: 1
1170409ab77SLukasz Luba        maxItems: 8   # Should be enough regulators
1180409ab77SLukasz Luba
11994274f20SRob Herring      opp-level:
12094274f20SRob Herring        description:
12194274f20SRob Herring          A value representing the performance level of the device.
12294274f20SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32
12394274f20SRob Herring
12494274f20SRob Herring      opp-peak-kBps:
12594274f20SRob Herring        description:
12694274f20SRob Herring          Peak bandwidth in kilobytes per second, expressed as an array of
12794274f20SRob Herring          32-bit big-endian integers. Each element of the array represents the
12894274f20SRob Herring          peak bandwidth value of each interconnect path. The number of elements
12994274f20SRob Herring          should match the number of interconnect paths.
13094274f20SRob Herring        minItems: 1
13194274f20SRob Herring        maxItems: 32  # Should be enough
13294274f20SRob Herring
13394274f20SRob Herring      opp-avg-kBps:
13494274f20SRob Herring        description:
13594274f20SRob Herring          Average bandwidth in kilobytes per second, expressed as an array
13694274f20SRob Herring          of 32-bit big-endian integers. Each element of the array represents the
13794274f20SRob Herring          average bandwidth value of each interconnect path. The number of elements
13894274f20SRob Herring          should match the number of interconnect paths. This property is only
13994274f20SRob Herring          meaningful in OPP tables where opp-peak-kBps is present.
14094274f20SRob Herring        minItems: 1
14194274f20SRob Herring        maxItems: 32  # Should be enough
14294274f20SRob Herring
14394274f20SRob Herring      clock-latency-ns:
14494274f20SRob Herring        description:
14594274f20SRob Herring          Specifies the maximum possible transition latency (in nanoseconds) for
14694274f20SRob Herring          switching to this OPP from any other OPP.
14794274f20SRob Herring
14894274f20SRob Herring      turbo-mode:
14994274f20SRob Herring        description:
15094274f20SRob Herring          Marks the OPP to be used only for turbo modes. Turbo mode is available
15194274f20SRob Herring          on some platforms, where the device can run over its operating
15294274f20SRob Herring          frequency for a short duration of time limited by the device's power,
15394274f20SRob Herring          current and thermal limits.
15494274f20SRob Herring        type: boolean
15594274f20SRob Herring
15694274f20SRob Herring      opp-suspend:
15794274f20SRob Herring        description:
15894274f20SRob Herring          Marks the OPP to be used during device suspend. If multiple OPPs in
15994274f20SRob Herring          the table have this, the OPP with highest opp-hz will be used.
16094274f20SRob Herring        type: boolean
16194274f20SRob Herring
16294274f20SRob Herring      opp-supported-hw:
16394274f20SRob Herring        description: |
16494274f20SRob Herring          This property allows a platform to enable only a subset of the OPPs
16594274f20SRob Herring          from the larger set present in the OPP table, based on the current
16694274f20SRob Herring          version of the hardware (already known to the operating system).
16794274f20SRob Herring
16894274f20SRob Herring          Each block present in the array of blocks in this property, represents
16994274f20SRob Herring          a sub-group of hardware versions supported by the OPP. i.e. <sub-group
17094274f20SRob Herring          A>, <sub-group B>, etc. The OPP will be enabled if _any_ of these
17194274f20SRob Herring          sub-groups match the hardware's version.
17294274f20SRob Herring
17394274f20SRob Herring          Each sub-group is a platform defined array representing the hierarchy
17494274f20SRob Herring          of hardware versions supported by the platform. For a platform with
17594274f20SRob Herring          three hierarchical levels of version (X.Y.Z), this field shall look
17694274f20SRob Herring          like
17794274f20SRob Herring
17894274f20SRob Herring          opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>.
17994274f20SRob Herring
18094274f20SRob Herring          Each level (eg. X1) in version hierarchy is represented by a 32 bit
18194274f20SRob Herring          value, one bit per version and so there can be maximum 32 versions per
18294274f20SRob Herring          level. Logical AND (&) operation is performed for each level with the
18394274f20SRob Herring          hardware's level version and a non-zero output for _all_ the levels in
18494274f20SRob Herring          a sub-group means the OPP is supported by hardware. A value of
18594274f20SRob Herring          0xFFFFFFFF for each level in the sub-group will enable the OPP for all
18694274f20SRob Herring          versions for the hardware.
18794274f20SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-matrix
18894274f20SRob Herring        maxItems: 32
18994274f20SRob Herring        items:
19094274f20SRob Herring          minItems: 1
19194274f20SRob Herring          maxItems: 4
19294274f20SRob Herring
19394274f20SRob Herring      required-opps:
19494274f20SRob Herring        description:
19594274f20SRob Herring          This contains phandle to an OPP node in another device's OPP table. It
19694274f20SRob Herring          may contain an array of phandles, where each phandle points to an OPP
19794274f20SRob Herring          of a different device. It should not contain multiple phandles to the
19894274f20SRob Herring          OPP nodes in the same OPP table. This specifies the minimum required
19994274f20SRob Herring          OPP of the device(s), whose OPP's phandle is present in this property,
20094274f20SRob Herring          for the functioning of the current device at the current OPP (where
20194274f20SRob Herring          this property is present).
20294274f20SRob Herring        $ref: /schemas/types.yaml#/definitions/phandle-array
20339bd2b6aSRob Herring        items:
20439bd2b6aSRob Herring          maxItems: 1
20594274f20SRob Herring
20694274f20SRob Herring    patternProperties:
20794274f20SRob Herring      '^opp-microvolt-':
20894274f20SRob Herring        description:
20994274f20SRob Herring          Named opp-microvolt property. This is exactly similar to the above
21094274f20SRob Herring          opp-microvolt property, but allows multiple voltage ranges to be
21194274f20SRob Herring          provided for the same OPP. At runtime, the platform can pick a <name>
21294274f20SRob Herring          and matching opp-microvolt-<name> property will be enabled for all
21394274f20SRob Herring          OPPs. If the platform doesn't pick a specific <name> or the <name>
21494274f20SRob Herring          doesn't match with any opp-microvolt-<name> properties, then
21594274f20SRob Herring          opp-microvolt property shall be used, if present.
21694274f20SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-matrix
21794274f20SRob Herring        minItems: 1
21894274f20SRob Herring        maxItems: 8   # Should be enough regulators
21994274f20SRob Herring        items:
22094274f20SRob Herring          minItems: 1
22194274f20SRob Herring          maxItems: 3
22294274f20SRob Herring
22394274f20SRob Herring      '^opp-microamp-':
22494274f20SRob Herring        description:
22594274f20SRob Herring          Named opp-microamp property. Similar to opp-microvolt-<name> property,
22694274f20SRob Herring          but for microamp instead.
22794274f20SRob Herring        $ref: /schemas/types.yaml#/definitions/uint32-array
22894274f20SRob Herring        minItems: 1
22994274f20SRob Herring        maxItems: 8   # Should be enough regulators
23094274f20SRob Herring
2311b91dba2SViresh Kumar      '^opp-microwatt-':
2320409ab77SLukasz Luba        description:
2331b91dba2SViresh Kumar          Named opp-microwatt property. Similar to opp-microamp-<name> property,
2340409ab77SLukasz Luba          but for microwatt instead.
2350409ab77SLukasz Luba        $ref: /schemas/types.yaml#/definitions/uint32-array
2360409ab77SLukasz Luba        minItems: 1
2370409ab77SLukasz Luba        maxItems: 8   # Should be enough regulators
2380409ab77SLukasz Luba
23994274f20SRob Herring    dependencies:
24094274f20SRob Herring      opp-avg-kBps: [ opp-peak-kBps ]
24194274f20SRob Herring
24294274f20SRob Herringrequired:
24394274f20SRob Herring  - compatible
24494274f20SRob Herring
24594274f20SRob HerringadditionalProperties: true
24694274f20SRob Herring
24794274f20SRob Herring...
248