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 794274f20SRob Herringtitle: Generic OPP (Operating Performance Points) Common Binding 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 53*3cb16ad6SKrzysztof Kozlowski Entries for multiple clocks shall be provided in the same field, as 54*3cb16ad6SKrzysztof Kozlowski array of frequencies. The OPP binding doesn't provide any provisions 55*3cb16ad6SKrzysztof Kozlowski to relate the values to their clocks or the order in which the clocks 56*3cb16ad6SKrzysztof Kozlowski need to be configured and that is left for the implementation 57*3cb16ad6SKrzysztof Kozlowski specific binding. 58*3cb16ad6SKrzysztof Kozlowski minItems: 1 59*3cb16ad6SKrzysztof Kozlowski maxItems: 16 60*3cb16ad6SKrzysztof Kozlowski items: 61*3cb16ad6SKrzysztof Kozlowski maxItems: 1 62*3cb16ad6SKrzysztof Kozlowski 6394274f20SRob Herring opp-microvolt: 6494274f20SRob Herring description: | 6594274f20SRob Herring Voltage for the OPP 6694274f20SRob Herring 6794274f20SRob Herring A single regulator's voltage is specified with an array of size one or three. 6894274f20SRob Herring Single entry is for target voltage and three entries are for <target min max> 6994274f20SRob Herring voltages. 7094274f20SRob Herring 7194274f20SRob Herring Entries for multiple regulators shall be provided in the same field separated 7294274f20SRob Herring by angular brackets <>. The OPP binding doesn't provide any provisions to 7394274f20SRob Herring relate the values to their power supplies or the order in which the supplies 7494274f20SRob Herring need to be configured and that is left for the implementation specific 7594274f20SRob Herring binding. 7694274f20SRob Herring 7794274f20SRob Herring Entries for all regulators shall be of the same size, i.e. either all use a 7894274f20SRob Herring single value or triplets. 7994274f20SRob Herring minItems: 1 8094274f20SRob Herring maxItems: 8 # Should be enough regulators 8194274f20SRob Herring items: 8294274f20SRob Herring minItems: 1 8394274f20SRob Herring maxItems: 3 8494274f20SRob Herring 8594274f20SRob Herring opp-microamp: 8694274f20SRob Herring description: | 8794274f20SRob Herring The maximum current drawn by the device in microamperes considering 8894274f20SRob Herring system specific parameters (such as transients, process, aging, 8994274f20SRob Herring maximum operating temperature range etc.) as necessary. This may be 9094274f20SRob Herring used to set the most efficient regulator operating mode. 9194274f20SRob Herring 9294274f20SRob Herring Should only be set if opp-microvolt or opp-microvolt-<name> is set for 9394274f20SRob Herring the OPP. 9494274f20SRob Herring 9594274f20SRob Herring Entries for multiple regulators shall be provided in the same field 9694274f20SRob Herring separated by angular brackets <>. If current values aren't required 9794274f20SRob Herring for a regulator, then it shall be filled with 0. If current values 9894274f20SRob Herring aren't required for any of the regulators, then this field is not 9994274f20SRob Herring required. The OPP binding doesn't provide any provisions to relate the 10094274f20SRob Herring values to their power supplies or the order in which the supplies need 10194274f20SRob Herring to be configured and that is left for the implementation specific 10294274f20SRob Herring binding. 10394274f20SRob Herring minItems: 1 10494274f20SRob Herring maxItems: 8 # Should be enough regulators 10594274f20SRob Herring 1060409ab77SLukasz Luba opp-microwatt: 1070409ab77SLukasz Luba description: | 1080409ab77SLukasz Luba The power for the OPP in micro-Watts. 1090409ab77SLukasz Luba 1100409ab77SLukasz Luba Entries for multiple regulators shall be provided in the same field 1110409ab77SLukasz Luba separated by angular brackets <>. If current values aren't required 1120409ab77SLukasz Luba for a regulator, then it shall be filled with 0. If power values 1130409ab77SLukasz Luba aren't required for any of the regulators, then this field is not 1140409ab77SLukasz Luba required. The OPP binding doesn't provide any provisions to relate the 1150409ab77SLukasz Luba values to their power supplies or the order in which the supplies need 1160409ab77SLukasz Luba to be configured and that is left for the implementation specific 1170409ab77SLukasz Luba binding. 1180409ab77SLukasz Luba minItems: 1 1190409ab77SLukasz Luba maxItems: 8 # Should be enough regulators 1200409ab77SLukasz Luba 12194274f20SRob Herring opp-level: 12294274f20SRob Herring description: 12394274f20SRob Herring A value representing the performance level of the device. 12494274f20SRob Herring $ref: /schemas/types.yaml#/definitions/uint32 12594274f20SRob Herring 12694274f20SRob Herring opp-peak-kBps: 12794274f20SRob Herring description: 12894274f20SRob Herring Peak bandwidth in kilobytes per second, expressed as an array of 12994274f20SRob Herring 32-bit big-endian integers. Each element of the array represents the 13094274f20SRob Herring peak bandwidth value of each interconnect path. The number of elements 13194274f20SRob Herring should match the number of interconnect paths. 13294274f20SRob Herring minItems: 1 13394274f20SRob Herring maxItems: 32 # Should be enough 13494274f20SRob Herring 13594274f20SRob Herring opp-avg-kBps: 13694274f20SRob Herring description: 13794274f20SRob Herring Average bandwidth in kilobytes per second, expressed as an array 13894274f20SRob Herring of 32-bit big-endian integers. Each element of the array represents the 13994274f20SRob Herring average bandwidth value of each interconnect path. The number of elements 14094274f20SRob Herring should match the number of interconnect paths. This property is only 14194274f20SRob Herring meaningful in OPP tables where opp-peak-kBps is present. 14294274f20SRob Herring minItems: 1 14394274f20SRob Herring maxItems: 32 # Should be enough 14494274f20SRob Herring 14594274f20SRob Herring clock-latency-ns: 14694274f20SRob Herring description: 14794274f20SRob Herring Specifies the maximum possible transition latency (in nanoseconds) for 14894274f20SRob Herring switching to this OPP from any other OPP. 14994274f20SRob Herring 15094274f20SRob Herring turbo-mode: 15194274f20SRob Herring description: 15294274f20SRob Herring Marks the OPP to be used only for turbo modes. Turbo mode is available 15394274f20SRob Herring on some platforms, where the device can run over its operating 15494274f20SRob Herring frequency for a short duration of time limited by the device's power, 15594274f20SRob Herring current and thermal limits. 15694274f20SRob Herring type: boolean 15794274f20SRob Herring 15894274f20SRob Herring opp-suspend: 15994274f20SRob Herring description: 16094274f20SRob Herring Marks the OPP to be used during device suspend. If multiple OPPs in 16194274f20SRob Herring the table have this, the OPP with highest opp-hz will be used. 16294274f20SRob Herring type: boolean 16394274f20SRob Herring 16494274f20SRob Herring opp-supported-hw: 16594274f20SRob Herring description: | 16694274f20SRob Herring This property allows a platform to enable only a subset of the OPPs 16794274f20SRob Herring from the larger set present in the OPP table, based on the current 16894274f20SRob Herring version of the hardware (already known to the operating system). 16994274f20SRob Herring 17094274f20SRob Herring Each block present in the array of blocks in this property, represents 17194274f20SRob Herring a sub-group of hardware versions supported by the OPP. i.e. <sub-group 17294274f20SRob Herring A>, <sub-group B>, etc. The OPP will be enabled if _any_ of these 17394274f20SRob Herring sub-groups match the hardware's version. 17494274f20SRob Herring 17594274f20SRob Herring Each sub-group is a platform defined array representing the hierarchy 17694274f20SRob Herring of hardware versions supported by the platform. For a platform with 17794274f20SRob Herring three hierarchical levels of version (X.Y.Z), this field shall look 17894274f20SRob Herring like 17994274f20SRob Herring 18094274f20SRob Herring opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>. 18194274f20SRob Herring 18294274f20SRob Herring Each level (eg. X1) in version hierarchy is represented by a 32 bit 18394274f20SRob Herring value, one bit per version and so there can be maximum 32 versions per 18494274f20SRob Herring level. Logical AND (&) operation is performed for each level with the 18594274f20SRob Herring hardware's level version and a non-zero output for _all_ the levels in 18694274f20SRob Herring a sub-group means the OPP is supported by hardware. A value of 18794274f20SRob Herring 0xFFFFFFFF for each level in the sub-group will enable the OPP for all 18894274f20SRob Herring versions for the hardware. 18994274f20SRob Herring $ref: /schemas/types.yaml#/definitions/uint32-matrix 19094274f20SRob Herring maxItems: 32 19194274f20SRob Herring items: 19294274f20SRob Herring minItems: 1 19394274f20SRob Herring maxItems: 4 19494274f20SRob Herring 19594274f20SRob Herring required-opps: 19694274f20SRob Herring description: 19794274f20SRob Herring This contains phandle to an OPP node in another device's OPP table. It 19894274f20SRob Herring may contain an array of phandles, where each phandle points to an OPP 19994274f20SRob Herring of a different device. It should not contain multiple phandles to the 20094274f20SRob Herring OPP nodes in the same OPP table. This specifies the minimum required 20194274f20SRob Herring OPP of the device(s), whose OPP's phandle is present in this property, 20294274f20SRob Herring for the functioning of the current device at the current OPP (where 20394274f20SRob Herring this property is present). 20494274f20SRob Herring $ref: /schemas/types.yaml#/definitions/phandle-array 20539bd2b6aSRob Herring items: 20639bd2b6aSRob Herring maxItems: 1 20794274f20SRob Herring 20894274f20SRob Herring patternProperties: 20994274f20SRob Herring '^opp-microvolt-': 21094274f20SRob Herring description: 21194274f20SRob Herring Named opp-microvolt property. This is exactly similar to the above 21294274f20SRob Herring opp-microvolt property, but allows multiple voltage ranges to be 21394274f20SRob Herring provided for the same OPP. At runtime, the platform can pick a <name> 21494274f20SRob Herring and matching opp-microvolt-<name> property will be enabled for all 21594274f20SRob Herring OPPs. If the platform doesn't pick a specific <name> or the <name> 21694274f20SRob Herring doesn't match with any opp-microvolt-<name> properties, then 21794274f20SRob Herring opp-microvolt property shall be used, if present. 21894274f20SRob Herring $ref: /schemas/types.yaml#/definitions/uint32-matrix 21994274f20SRob Herring minItems: 1 22094274f20SRob Herring maxItems: 8 # Should be enough regulators 22194274f20SRob Herring items: 22294274f20SRob Herring minItems: 1 22394274f20SRob Herring maxItems: 3 22494274f20SRob Herring 22594274f20SRob Herring '^opp-microamp-': 22694274f20SRob Herring description: 22794274f20SRob Herring Named opp-microamp property. Similar to opp-microvolt-<name> property, 22894274f20SRob Herring but for microamp instead. 22994274f20SRob Herring $ref: /schemas/types.yaml#/definitions/uint32-array 23094274f20SRob Herring minItems: 1 23194274f20SRob Herring maxItems: 8 # Should be enough regulators 23294274f20SRob Herring 2330409ab77SLukasz Luba '^opp-microwatt': 2340409ab77SLukasz Luba description: 2350409ab77SLukasz Luba Named opp-microwatt property. Similar to opp-microamp property, 2360409ab77SLukasz Luba but for microwatt instead. 2370409ab77SLukasz Luba $ref: /schemas/types.yaml#/definitions/uint32-array 2380409ab77SLukasz Luba minItems: 1 2390409ab77SLukasz Luba maxItems: 8 # Should be enough regulators 2400409ab77SLukasz Luba 24194274f20SRob Herring dependencies: 24294274f20SRob Herring opp-avg-kBps: [ opp-peak-kBps ] 24394274f20SRob Herring 24494274f20SRob Herringrequired: 24594274f20SRob Herring - compatible 24694274f20SRob Herring 24794274f20SRob HerringadditionalProperties: true 24894274f20SRob Herring 24994274f20SRob Herring... 250