162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/opp/opp-v2-base.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: Generic OPP (Operating Performance Points) Common Properties
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Viresh Kumar <viresh.kumar@linaro.org>
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_cidescription: |
1362306a36Sopenharmony_ci  Devices work at voltage-current-frequency combinations and some implementations
1462306a36Sopenharmony_ci  have the liberty of choosing these. These combinations are called Operating
1562306a36Sopenharmony_ci  Performance Points aka OPPs. This document defines bindings for these OPPs
1662306a36Sopenharmony_ci  applicable across wide range of devices. For illustration purpose, this document
1762306a36Sopenharmony_ci  uses CPU as a device.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci  This describes the OPPs belonging to a device.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ciselect: false
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciproperties:
2462306a36Sopenharmony_ci  $nodename:
2562306a36Sopenharmony_ci    pattern: '^opp-table(-[a-z0-9]+)?$'
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci  opp-shared:
2862306a36Sopenharmony_ci    description:
2962306a36Sopenharmony_ci      Indicates that device nodes using this OPP Table Node's phandle switch
3062306a36Sopenharmony_ci      their DVFS state together, i.e. they share clock/voltage/current lines.
3162306a36Sopenharmony_ci      Missing property means devices have independent clock/voltage/current
3262306a36Sopenharmony_ci      lines, but they share OPP tables.
3362306a36Sopenharmony_ci    type: boolean
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_cipatternProperties:
3662306a36Sopenharmony_ci  '^opp(-?[0-9]+)*$':
3762306a36Sopenharmony_ci    type: object
3862306a36Sopenharmony_ci    description:
3962306a36Sopenharmony_ci      One or more OPP nodes describing voltage-current-frequency combinations.
4062306a36Sopenharmony_ci      Their name isn't significant but their phandle can be used to reference an
4162306a36Sopenharmony_ci      OPP. These are mandatory except for the case where the OPP table is
4262306a36Sopenharmony_ci      present only to indicate dependency between devices using the opp-shared
4362306a36Sopenharmony_ci      property.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci    properties:
4662306a36Sopenharmony_ci      opp-hz:
4762306a36Sopenharmony_ci        description:
4862306a36Sopenharmony_ci          Frequency in Hz, expressed as a 64-bit big-endian integer. This is a
4962306a36Sopenharmony_ci          required property for all device nodes, unless another "required"
5062306a36Sopenharmony_ci          property to uniquely identify the OPP nodes exists. Devices like power
5162306a36Sopenharmony_ci          domains must have another (implementation dependent) property.
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci          Entries for multiple clocks shall be provided in the same field, as
5462306a36Sopenharmony_ci          array of frequencies.  The OPP binding doesn't provide any provisions
5562306a36Sopenharmony_ci          to relate the values to their clocks or the order in which the clocks
5662306a36Sopenharmony_ci          need to be configured and that is left for the implementation
5762306a36Sopenharmony_ci          specific binding.
5862306a36Sopenharmony_ci        minItems: 1
5962306a36Sopenharmony_ci        maxItems: 32
6062306a36Sopenharmony_ci        items:
6162306a36Sopenharmony_ci          maxItems: 1
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci      opp-microvolt:
6462306a36Sopenharmony_ci        description: |
6562306a36Sopenharmony_ci          Voltage for the OPP
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci          A single regulator's voltage is specified with an array of size one or three.
6862306a36Sopenharmony_ci          Single entry is for target voltage and three entries are for <target min max>
6962306a36Sopenharmony_ci          voltages.
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci          Entries for multiple regulators shall be provided in the same field separated
7262306a36Sopenharmony_ci          by angular brackets <>. The OPP binding doesn't provide any provisions to
7362306a36Sopenharmony_ci          relate the values to their power supplies or the order in which the supplies
7462306a36Sopenharmony_ci          need to be configured and that is left for the implementation specific
7562306a36Sopenharmony_ci          binding.
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci          Entries for all regulators shall be of the same size, i.e. either all use a
7862306a36Sopenharmony_ci          single value or triplets.
7962306a36Sopenharmony_ci        minItems: 1
8062306a36Sopenharmony_ci        maxItems: 8   # Should be enough regulators
8162306a36Sopenharmony_ci        items:
8262306a36Sopenharmony_ci          minItems: 1
8362306a36Sopenharmony_ci          maxItems: 3
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci      opp-microamp:
8662306a36Sopenharmony_ci        description: |
8762306a36Sopenharmony_ci          The maximum current drawn by the device in microamperes considering
8862306a36Sopenharmony_ci          system specific parameters (such as transients, process, aging,
8962306a36Sopenharmony_ci          maximum operating temperature range etc.) as necessary. This may be
9062306a36Sopenharmony_ci          used to set the most efficient regulator operating mode.
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci          Should only be set if opp-microvolt or opp-microvolt-<name> is set for
9362306a36Sopenharmony_ci          the OPP.
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci          Entries for multiple regulators shall be provided in the same field
9662306a36Sopenharmony_ci          separated by angular brackets <>. If current values aren't required
9762306a36Sopenharmony_ci          for a regulator, then it shall be filled with 0. If current values
9862306a36Sopenharmony_ci          aren't required for any of the regulators, then this field is not
9962306a36Sopenharmony_ci          required. The OPP binding doesn't provide any provisions to relate the
10062306a36Sopenharmony_ci          values to their power supplies or the order in which the supplies need
10162306a36Sopenharmony_ci          to be configured and that is left for the implementation specific
10262306a36Sopenharmony_ci          binding.
10362306a36Sopenharmony_ci        minItems: 1
10462306a36Sopenharmony_ci        maxItems: 8   # Should be enough regulators
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci      opp-microwatt:
10762306a36Sopenharmony_ci        description: |
10862306a36Sopenharmony_ci          The power for the OPP in micro-Watts.
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci          Entries for multiple regulators shall be provided in the same field
11162306a36Sopenharmony_ci          separated by angular brackets <>. If power values aren't required
11262306a36Sopenharmony_ci          for a regulator, then it shall be filled with 0. If power values
11362306a36Sopenharmony_ci          aren't required for any of the regulators, then this field is not
11462306a36Sopenharmony_ci          required. The OPP binding doesn't provide any provisions to relate the
11562306a36Sopenharmony_ci          values to their power supplies or the order in which the supplies need
11662306a36Sopenharmony_ci          to be configured and that is left for the implementation specific
11762306a36Sopenharmony_ci          binding.
11862306a36Sopenharmony_ci        minItems: 1
11962306a36Sopenharmony_ci        maxItems: 8   # Should be enough regulators
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci      opp-level:
12262306a36Sopenharmony_ci        description:
12362306a36Sopenharmony_ci          A value representing the performance level of the device.
12462306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci      opp-peak-kBps:
12762306a36Sopenharmony_ci        description:
12862306a36Sopenharmony_ci          Peak bandwidth in kilobytes per second, expressed as an array of
12962306a36Sopenharmony_ci          32-bit big-endian integers. Each element of the array represents the
13062306a36Sopenharmony_ci          peak bandwidth value of each interconnect path. The number of elements
13162306a36Sopenharmony_ci          should match the number of interconnect paths.
13262306a36Sopenharmony_ci        minItems: 1
13362306a36Sopenharmony_ci        maxItems: 32  # Should be enough
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci      opp-avg-kBps:
13662306a36Sopenharmony_ci        description:
13762306a36Sopenharmony_ci          Average bandwidth in kilobytes per second, expressed as an array
13862306a36Sopenharmony_ci          of 32-bit big-endian integers. Each element of the array represents the
13962306a36Sopenharmony_ci          average bandwidth value of each interconnect path. The number of elements
14062306a36Sopenharmony_ci          should match the number of interconnect paths. This property is only
14162306a36Sopenharmony_ci          meaningful in OPP tables where opp-peak-kBps is present.
14262306a36Sopenharmony_ci        minItems: 1
14362306a36Sopenharmony_ci        maxItems: 32  # Should be enough
14462306a36Sopenharmony_ci
14562306a36Sopenharmony_ci      clock-latency-ns:
14662306a36Sopenharmony_ci        description:
14762306a36Sopenharmony_ci          Specifies the maximum possible transition latency (in nanoseconds) for
14862306a36Sopenharmony_ci          switching to this OPP from any other OPP.
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ci      turbo-mode:
15162306a36Sopenharmony_ci        description:
15262306a36Sopenharmony_ci          Marks the OPP to be used only for turbo modes. Turbo mode is available
15362306a36Sopenharmony_ci          on some platforms, where the device can run over its operating
15462306a36Sopenharmony_ci          frequency for a short duration of time limited by the device's power,
15562306a36Sopenharmony_ci          current and thermal limits.
15662306a36Sopenharmony_ci        type: boolean
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ci      opp-suspend:
15962306a36Sopenharmony_ci        description:
16062306a36Sopenharmony_ci          Marks the OPP to be used during device suspend. If multiple OPPs in
16162306a36Sopenharmony_ci          the table have this, the OPP with highest opp-hz will be used.
16262306a36Sopenharmony_ci        type: boolean
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci      opp-supported-hw:
16562306a36Sopenharmony_ci        description: |
16662306a36Sopenharmony_ci          This property allows a platform to enable only a subset of the OPPs
16762306a36Sopenharmony_ci          from the larger set present in the OPP table, based on the current
16862306a36Sopenharmony_ci          version of the hardware (already known to the operating system).
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci          Each block present in the array of blocks in this property, represents
17162306a36Sopenharmony_ci          a sub-group of hardware versions supported by the OPP. i.e. <sub-group
17262306a36Sopenharmony_ci          A>, <sub-group B>, etc. The OPP will be enabled if _any_ of these
17362306a36Sopenharmony_ci          sub-groups match the hardware's version.
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ci          Each sub-group is a platform defined array representing the hierarchy
17662306a36Sopenharmony_ci          of hardware versions supported by the platform. For a platform with
17762306a36Sopenharmony_ci          three hierarchical levels of version (X.Y.Z), this field shall look
17862306a36Sopenharmony_ci          like
17962306a36Sopenharmony_ci
18062306a36Sopenharmony_ci          opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>.
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ci          Each level (eg. X1) in version hierarchy is represented by a 32 bit
18362306a36Sopenharmony_ci          value, one bit per version and so there can be maximum 32 versions per
18462306a36Sopenharmony_ci          level. Logical AND (&) operation is performed for each level with the
18562306a36Sopenharmony_ci          hardware's level version and a non-zero output for _all_ the levels in
18662306a36Sopenharmony_ci          a sub-group means the OPP is supported by hardware. A value of
18762306a36Sopenharmony_ci          0xFFFFFFFF for each level in the sub-group will enable the OPP for all
18862306a36Sopenharmony_ci          versions for the hardware.
18962306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32-matrix
19062306a36Sopenharmony_ci        maxItems: 32
19162306a36Sopenharmony_ci        items:
19262306a36Sopenharmony_ci          minItems: 1
19362306a36Sopenharmony_ci          maxItems: 4
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci      required-opps:
19662306a36Sopenharmony_ci        description:
19762306a36Sopenharmony_ci          This contains phandle to an OPP node in another device's OPP table. It
19862306a36Sopenharmony_ci          may contain an array of phandles, where each phandle points to an OPP
19962306a36Sopenharmony_ci          of a different device. It should not contain multiple phandles to the
20062306a36Sopenharmony_ci          OPP nodes in the same OPP table. This specifies the minimum required
20162306a36Sopenharmony_ci          OPP of the device(s), whose OPP's phandle is present in this property,
20262306a36Sopenharmony_ci          for the functioning of the current device at the current OPP (where
20362306a36Sopenharmony_ci          this property is present).
20462306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/phandle-array
20562306a36Sopenharmony_ci        items:
20662306a36Sopenharmony_ci          maxItems: 1
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_ci    patternProperties:
20962306a36Sopenharmony_ci      '^opp-microvolt-':
21062306a36Sopenharmony_ci        description:
21162306a36Sopenharmony_ci          Named opp-microvolt property. This is exactly similar to the above
21262306a36Sopenharmony_ci          opp-microvolt property, but allows multiple voltage ranges to be
21362306a36Sopenharmony_ci          provided for the same OPP. At runtime, the platform can pick a <name>
21462306a36Sopenharmony_ci          and matching opp-microvolt-<name> property will be enabled for all
21562306a36Sopenharmony_ci          OPPs. If the platform doesn't pick a specific <name> or the <name>
21662306a36Sopenharmony_ci          doesn't match with any opp-microvolt-<name> properties, then
21762306a36Sopenharmony_ci          opp-microvolt property shall be used, if present.
21862306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32-matrix
21962306a36Sopenharmony_ci        minItems: 1
22062306a36Sopenharmony_ci        maxItems: 8   # Should be enough regulators
22162306a36Sopenharmony_ci        items:
22262306a36Sopenharmony_ci          minItems: 1
22362306a36Sopenharmony_ci          maxItems: 3
22462306a36Sopenharmony_ci
22562306a36Sopenharmony_ci      '^opp-microamp-':
22662306a36Sopenharmony_ci        description:
22762306a36Sopenharmony_ci          Named opp-microamp property. Similar to opp-microvolt-<name> property,
22862306a36Sopenharmony_ci          but for microamp instead.
22962306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32-array
23062306a36Sopenharmony_ci        minItems: 1
23162306a36Sopenharmony_ci        maxItems: 8   # Should be enough regulators
23262306a36Sopenharmony_ci
23362306a36Sopenharmony_ci      '^opp-microwatt-':
23462306a36Sopenharmony_ci        description:
23562306a36Sopenharmony_ci          Named opp-microwatt property. Similar to opp-microamp-<name> property,
23662306a36Sopenharmony_ci          but for microwatt instead.
23762306a36Sopenharmony_ci        $ref: /schemas/types.yaml#/definitions/uint32-array
23862306a36Sopenharmony_ci        minItems: 1
23962306a36Sopenharmony_ci        maxItems: 8   # Should be enough regulators
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci    dependencies:
24262306a36Sopenharmony_ci      opp-avg-kBps: [ opp-peak-kBps ]
24362306a36Sopenharmony_ci
24462306a36Sopenharmony_cirequired:
24562306a36Sopenharmony_ci  - compatible
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_ciadditionalProperties: true
24862306a36Sopenharmony_ci
24962306a36Sopenharmony_ci...
250