# Qualcomm Technologies, Inc. NVMEM OPP

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Opp bindings_

> Device-tree binding reference for Qualcomm Technologies, Inc. NVMEM OPP.

<!-- SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;opp&#47;opp&#45;v2&#45;kryo&#45;cpu&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Ilia Lin &#60;ilia&#46;lin&#64;kernel&#46;org&#62;&#34;</code></span>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

<a id="dt-d33de94ac1d3652cd22a"></a>

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>opp&#45;v2&#45;base&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-opp/opp-v2-base.md#dt-root>)</span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">In certain Qualcomm Technologies, Inc. SoCs like APQ8096 and MSM8996,
the CPU frequencies subset and voltage value of each OPP varies based on
the silicon variant in use.
Qualcomm Technologies, Inc. Process Voltage Scaling Tables
defines the voltage and frequency value based on the speedbin blown in
the efuse combination.
The qcom-cpufreq-nvmem driver reads the efuse value from the SoC to provide
the OPP framework with required information (existing HW bitmap).
This is used to determine the voltage and frequency value for each OPP of
operating-points-v2 table when it is parsed by the OPP framework.</p>
</div>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;operating&#45;points&#45;v2&#45;krait&#45;cpu&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;operating&#45;points&#45;v2&#45;kryo&#45;cpu&#34;</code></span>

<a id="dt-f6607d50f506f570ada3"></a>

### <code>nvmem&#45;cells</code> — not listed as required here

<div id="dt-6e22bea212c5f15c1ddb">
<p style="white-space: pre-wrap">A phandle pointing to a nvmem-cells node representing the
efuse registers that has information about the
speedbin that is used to select the right frequency/voltage
value pair.</p>
</div>

<a id="dt-4a53ed2162f8a79b7794"></a>

### <code>opp&#45;shared</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-edd4e46861738c7b70ef"></a>

### <code>&#94;opp&#45;&#63;&#91;0&#45;9&#93;&#43;&#36;</code> — name matches this regular expression

**Value type (<code>type</code>):** <span id="dt-ad9e5e7079776ba14f82"><code>&#34;object&#34;</code></span>

<a id="dt-cc6f00d73297ba751987"></a>

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-8905f4e68842b6eb2ceb"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-217e7c21c8095af1f26a"></a>

**<code>opp&#45;hz</code> — required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-759b9cee0ec92e15ecc2"></a>

**<code>opp&#45;microvolt</code> — not listed as required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-1e60e2bf9f4f15ee4992"></a>

**<code>opp&#45;peak&#45;kBps</code> — not listed as required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-bcc77d58c053c8679b55"></a>

**<code>opp&#45;supported&#45;hw</code> — not listed as required here**

<div id="dt-3aef47e889c45669832b">
<p style="white-space: pre-wrap">A single 32 bit bitmap value, representing compatible HW.
Bitmap for MSM8996 format:
0:  MSM8996, speedbin 0
1:  MSM8996, speedbin 1
2:  MSM8996, speedbin 2
3:  MSM8996, speedbin 3
4-31:  unused</p>
<p style="white-space: pre-wrap">Bitmap for MSM8996SG format (speedbin shifted of 4 left):
0-3:  unused
4:  MSM8996SG, speedbin 0
5:  MSM8996SG, speedbin 1
6:  MSM8996SG, speedbin 2
7-31:  unused</p>
<p style="white-space: pre-wrap">Bitmap for IPQ806x SoC:
0:  IPQ8062
1:  IPQ8064/IPQ8066/IPQ8068
2:  IPQ8065/IPQ8069
3-31:  unused</p>
<p style="white-space: pre-wrap">Other platforms use bits directly corresponding to speedbin index.</p>
</div>

<a id="dt-c92647e1661e82257072"></a>

**<code>clock&#45;latency&#45;ns</code> — not listed as required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-c9956370b661cdf48f87"></a>

**<code>required&#45;opps</code> — not listed as required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-73a0db2328061112377a"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-d50d9b7a09397032c28a"></a>

**<code>&#94;opp&#45;microvolt&#45;speed&#91;0&#45;9&#93;&#43;&#45;pvs&#91;0&#45;9&#93;&#43;&#36;</code> — name matches this regular expression**

<code>true</code> — No constraints added by this property rule.

**Required in this object (<code>required</code>):** <a id="dt-14d5bc98f1c0e4da7f81"></a> <span id="dt-f0b6794f0fd0150766c6"><code>&#34;opp&#45;hz&#34;</code></span>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>

<a id="dt-158e3f6339df9dc0e448"></a>

## Condition (<code>if</code>)

> **Required in this object (<code>required</code>):** <a id="dt-14e52113574fb38ea542"></a> <span id="dt-29f94e3578414110598d"><code>&#34;nvmem&#45;cells&#34;</code></span>

<a id="dt-94d3067a06aec87aad7f"></a>

## When the condition matches (<code>then</code>)

> <a id="dt-779fc6b9f78e97d20df7"></a>
>
> ### Properties matching a name pattern (<code>patternProperties</code>)
>
> <a id="dt-098458144d1b948163bf"></a>
>
> #### <code>&#94;opp&#45;&#63;&#91;0&#45;9&#93;&#43;&#36;</code> — name matches this regular expression
>
> **Required in this object (<code>required</code>):** <a id="dt-d2e3adb569a1cb0198fd"></a> <span id="dt-2d743e37e8009c4040a4"><code>&#34;opp&#45;supported&#45;hw&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">/ {
    model = "Qualcomm Technologies, Inc. DB820c";
    compatible = "arrow,apq8096-db820c", "qcom,apq8096-sbc", "qcom,apq8096";
    #address-cells = &lt;2&gt;;
    #size-cells = &lt;2&gt;;

    cpus {
        #address-cells = &lt;2&gt;;
        #size-cells = &lt;0&gt;;

        CPU0: cpu@0 {
            device_type = "cpu";
            compatible = "qcom,kryo";
            reg = &lt;0x0 0x0&gt;;
            enable-method = "psci";
            cpu-idle-states = &lt;&amp;CPU_SLEEP_0&gt;;
            capacity-dmips-mhz = &lt;1024&gt;;
            clocks = &lt;&amp;kryocc 0&gt;;
            operating-points-v2 = &lt;&amp;cluster0_opp&gt;;
            power-domains = &lt;&amp;cpr&gt;;
            power-domain-names = "cpr";
            #cooling-cells = &lt;2&gt;;
            next-level-cache = &lt;&amp;L2_0&gt;;
            L2_0: l2-cache {
                compatible = "cache";
                cache-level = &lt;2&gt;;
                cache-unified;
            };
        };

        CPU1: cpu@1 {
            device_type = "cpu";
            compatible = "qcom,kryo";
            reg = &lt;0x0 0x1&gt;;
            enable-method = "psci";
            cpu-idle-states = &lt;&amp;CPU_SLEEP_0&gt;;
            capacity-dmips-mhz = &lt;1024&gt;;
            clocks = &lt;&amp;kryocc 0&gt;;
            operating-points-v2 = &lt;&amp;cluster0_opp&gt;;
            power-domains = &lt;&amp;cpr&gt;;
            power-domain-names = "cpr";
            #cooling-cells = &lt;2&gt;;
            next-level-cache = &lt;&amp;L2_0&gt;;
        };

        CPU2: cpu@100 {
            device_type = "cpu";
            compatible = "qcom,kryo";
            reg = &lt;0x0 0x100&gt;;
            enable-method = "psci";
            cpu-idle-states = &lt;&amp;CPU_SLEEP_0&gt;;
            capacity-dmips-mhz = &lt;1024&gt;;
            clocks = &lt;&amp;kryocc 1&gt;;
            operating-points-v2 = &lt;&amp;cluster1_opp&gt;;
            power-domains = &lt;&amp;cpr&gt;;
            power-domain-names = "cpr";
            #cooling-cells = &lt;2&gt;;
            next-level-cache = &lt;&amp;L2_1&gt;;
            L2_1: l2-cache {
                compatible = "cache";
                cache-level = &lt;2&gt;;
                cache-unified;
            };
        };

        CPU3: cpu@101 {
            device_type = "cpu";
            compatible = "qcom,kryo";
            reg = &lt;0x0 0x101&gt;;
            enable-method = "psci";
            cpu-idle-states = &lt;&amp;CPU_SLEEP_0&gt;;
            capacity-dmips-mhz = &lt;1024&gt;;
            clocks = &lt;&amp;kryocc 1&gt;;
            operating-points-v2 = &lt;&amp;cluster1_opp&gt;;
            power-domains = &lt;&amp;cpr&gt;;
            power-domain-names = "cpr";
            #cooling-cells = &lt;2&gt;;
            next-level-cache = &lt;&amp;L2_1&gt;;
        };

        cpu-map {
            cluster0 {
                core0 {
                    cpu = &lt;&amp;CPU0&gt;;
                };

                core1 {
                    cpu = &lt;&amp;CPU1&gt;;
                };
            };

            cluster1 {
                core0 {
                    cpu = &lt;&amp;CPU2&gt;;
                };

                core1 {
                    cpu = &lt;&amp;CPU3&gt;;
                };
            };
        };
    };

    cluster0_opp: opp-table-0 {
        compatible = "operating-points-v2-kryo-cpu";
        nvmem-cells = &lt;&amp;speedbin_efuse&gt;;
        opp-shared;

        opp-307200000 {
            opp-hz = /bits/ 64 &lt;307200000&gt;;
            opp-microvolt = &lt;905000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x7&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp1&gt;;
        };
        opp-1401600000 {
            opp-hz = /bits/ 64 &lt;1401600000&gt;;
            opp-microvolt = &lt;1140000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x5&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp2&gt;;
        };
        opp-1593600000 {
            opp-hz = /bits/ 64 &lt;1593600000&gt;;
            opp-microvolt = &lt;1140000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x1&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp3&gt;;
        };
    };

    cluster1_opp: opp-table-1 {
        compatible = "operating-points-v2-kryo-cpu";
        nvmem-cells = &lt;&amp;speedbin_efuse&gt;;
        opp-shared;

        opp-307200000 {
            opp-hz = /bits/ 64 &lt;307200000&gt;;
            opp-microvolt = &lt;905000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x7&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp1&gt;;
        };
        opp-1804800000 {
            opp-hz = /bits/ 64 &lt;1804800000&gt;;
            opp-microvolt = &lt;1140000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x6&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp4&gt;;
        };
        opp-1900800000 {
            opp-hz = /bits/ 64 &lt;1900800000&gt;;
            opp-microvolt = &lt;1140000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x4&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp5&gt;;
        };
        opp-2150400000 {
            opp-hz = /bits/ 64 &lt;2150400000&gt;;
            opp-microvolt = &lt;1140000 905000 1140000&gt;;
            opp-supported-hw = &lt;0x1&gt;;
            clock-latency-ns = &lt;200000&gt;;
            required-opps = &lt;&amp;cpr_opp6&gt;;
        };
    };

    /* Dummy opp table to give example for named opp-microvolt */
    opp-table-2 {
        compatible = "operating-points-v2-krait-cpu";
        nvmem-cells = &lt;&amp;speedbin_efuse&gt;;

        opp-384000000 {
            opp-hz = /bits/ 64 &lt;384000000&gt;;
            opp-microvolt-speed0-pvs0 = &lt;1000000 950000 1050000&gt;;
            opp-microvolt-speed0-pvs1 = &lt;925000 878750 971250&gt;;
            opp-microvolt-speed0-pvs2 = &lt;875000 831250 918750&gt;;
            opp-microvolt-speed0-pvs3 = &lt;800000 760000 840000&gt;;
            opp-supported-hw = &lt;0x7&gt;;
            clock-latency-ns = &lt;100000&gt;;
        };
    };

    smem {
        compatible = "qcom,smem";
        memory-region = &lt;&amp;smem_mem&gt;;
        hwlocks = &lt;&amp;tcsr_mutex 3&gt;;
    };

    soc {
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;1&gt;;

        qfprom: qfprom@74000 {
            compatible = "qcom,msm8996-qfprom", "qcom,qfprom";
            reg = &lt;0x00074000 0x8ff&gt;;
            #address-cells = &lt;1&gt;;
            #size-cells = &lt;1&gt;;

            speedbin_efuse: speedbin@133 {
                reg = &lt;0x133 0x1&gt;;
                bits = &lt;5 3&gt;;
            };
        };
    };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)</span></p>

</details>
