xref: /freebsd/sys/contrib/device-tree/Bindings/power/avs/qcom,cpr.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1c9ccf3a3SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c9ccf3a3SEmmanuel Vadot%YAML 1.2
3c9ccf3a3SEmmanuel Vadot---
4c9ccf3a3SEmmanuel Vadot$id: http://devicetree.org/schemas/power/avs/qcom,cpr.yaml#
5c9ccf3a3SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c9ccf3a3SEmmanuel Vadot
7*8bab661aSEmmanuel Vadottitle: Qualcomm Core Power Reduction (CPR)
8c9ccf3a3SEmmanuel Vadot
9c9ccf3a3SEmmanuel Vadotmaintainers:
10c9ccf3a3SEmmanuel Vadot  - Niklas Cassel <nks@flawful.org>
11c9ccf3a3SEmmanuel Vadot
12c9ccf3a3SEmmanuel Vadotdescription: |
13c9ccf3a3SEmmanuel Vadot  CPR (Core Power Reduction) is a technology to reduce core power on a CPU
14c9ccf3a3SEmmanuel Vadot  or other device. Each OPP of a device corresponds to a "corner" that has
15c9ccf3a3SEmmanuel Vadot  a range of valid voltages for a particular frequency. While the device is
16c9ccf3a3SEmmanuel Vadot  running at a particular frequency, CPR monitors dynamic factors such as
17c9ccf3a3SEmmanuel Vadot  temperature, etc. and suggests adjustments to the voltage to save power
18c9ccf3a3SEmmanuel Vadot  and meet silicon characteristic requirements.
19c9ccf3a3SEmmanuel Vadot
20c9ccf3a3SEmmanuel Vadotproperties:
21c9ccf3a3SEmmanuel Vadot  compatible:
22c9ccf3a3SEmmanuel Vadot    items:
23c9ccf3a3SEmmanuel Vadot      - enum:
24c9ccf3a3SEmmanuel Vadot          - qcom,qcs404-cpr
25c9ccf3a3SEmmanuel Vadot      - const: qcom,cpr
26c9ccf3a3SEmmanuel Vadot
27c9ccf3a3SEmmanuel Vadot  reg:
28c9ccf3a3SEmmanuel Vadot    description: Base address and size of the RBCPR register region.
29c9ccf3a3SEmmanuel Vadot    maxItems: 1
30c9ccf3a3SEmmanuel Vadot
31c9ccf3a3SEmmanuel Vadot  interrupts:
32c9ccf3a3SEmmanuel Vadot    maxItems: 1
33c9ccf3a3SEmmanuel Vadot
34c9ccf3a3SEmmanuel Vadot  clocks:
35c9ccf3a3SEmmanuel Vadot    items:
36c9ccf3a3SEmmanuel Vadot      - description: Reference clock.
37c9ccf3a3SEmmanuel Vadot
38c9ccf3a3SEmmanuel Vadot  clock-names:
39c9ccf3a3SEmmanuel Vadot    items:
40c9ccf3a3SEmmanuel Vadot      - const: ref
41c9ccf3a3SEmmanuel Vadot
42c9ccf3a3SEmmanuel Vadot  vdd-apc-supply:
43c9ccf3a3SEmmanuel Vadot    description: APC regulator supply.
44c9ccf3a3SEmmanuel Vadot
45c9ccf3a3SEmmanuel Vadot  '#power-domain-cells':
46c9ccf3a3SEmmanuel Vadot    const: 0
47c9ccf3a3SEmmanuel Vadot
48c9ccf3a3SEmmanuel Vadot  operating-points-v2:
49c9ccf3a3SEmmanuel Vadot    description: |
50c9ccf3a3SEmmanuel Vadot      A phandle to the OPP table containing the performance states
51c9ccf3a3SEmmanuel Vadot      supported by the CPR power domain.
52c9ccf3a3SEmmanuel Vadot
53c9ccf3a3SEmmanuel Vadot  acc-syscon:
54d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
55c9ccf3a3SEmmanuel Vadot    description: A phandle to the syscon used for writing ACC settings.
56c9ccf3a3SEmmanuel Vadot
57c9ccf3a3SEmmanuel Vadot  nvmem-cells:
58c9ccf3a3SEmmanuel Vadot    items:
59c9ccf3a3SEmmanuel Vadot      - description: Corner 1 quotient offset
60c9ccf3a3SEmmanuel Vadot      - description: Corner 2 quotient offset
61c9ccf3a3SEmmanuel Vadot      - description: Corner 3 quotient offset
62c9ccf3a3SEmmanuel Vadot      - description: Corner 1 initial voltage
63c9ccf3a3SEmmanuel Vadot      - description: Corner 2 initial voltage
64c9ccf3a3SEmmanuel Vadot      - description: Corner 3 initial voltage
65c9ccf3a3SEmmanuel Vadot      - description: Corner 1 quotient
66c9ccf3a3SEmmanuel Vadot      - description: Corner 2 quotient
67c9ccf3a3SEmmanuel Vadot      - description: Corner 3 quotient
68c9ccf3a3SEmmanuel Vadot      - description: Corner 1 ring oscillator
69c9ccf3a3SEmmanuel Vadot      - description: Corner 2 ring oscillator
70c9ccf3a3SEmmanuel Vadot      - description: Corner 3 ring oscillator
71c9ccf3a3SEmmanuel Vadot      - description: Fuse revision
72c9ccf3a3SEmmanuel Vadot
73c9ccf3a3SEmmanuel Vadot  nvmem-cell-names:
74c9ccf3a3SEmmanuel Vadot    items:
75c9ccf3a3SEmmanuel Vadot      - const: cpr_quotient_offset1
76c9ccf3a3SEmmanuel Vadot      - const: cpr_quotient_offset2
77c9ccf3a3SEmmanuel Vadot      - const: cpr_quotient_offset3
78c9ccf3a3SEmmanuel Vadot      - const: cpr_init_voltage1
79c9ccf3a3SEmmanuel Vadot      - const: cpr_init_voltage2
80c9ccf3a3SEmmanuel Vadot      - const: cpr_init_voltage3
81c9ccf3a3SEmmanuel Vadot      - const: cpr_quotient1
82c9ccf3a3SEmmanuel Vadot      - const: cpr_quotient2
83c9ccf3a3SEmmanuel Vadot      - const: cpr_quotient3
84c9ccf3a3SEmmanuel Vadot      - const: cpr_ring_osc1
85c9ccf3a3SEmmanuel Vadot      - const: cpr_ring_osc2
86c9ccf3a3SEmmanuel Vadot      - const: cpr_ring_osc3
87c9ccf3a3SEmmanuel Vadot      - const: cpr_fuse_revision
88c9ccf3a3SEmmanuel Vadot
89c9ccf3a3SEmmanuel Vadotrequired:
90c9ccf3a3SEmmanuel Vadot  - compatible
91c9ccf3a3SEmmanuel Vadot  - reg
92c9ccf3a3SEmmanuel Vadot  - interrupts
93c9ccf3a3SEmmanuel Vadot  - clocks
94c9ccf3a3SEmmanuel Vadot  - clock-names
95c9ccf3a3SEmmanuel Vadot  - vdd-apc-supply
96c9ccf3a3SEmmanuel Vadot  - '#power-domain-cells'
97c9ccf3a3SEmmanuel Vadot  - operating-points-v2
98c9ccf3a3SEmmanuel Vadot  - nvmem-cells
99c9ccf3a3SEmmanuel Vadot  - nvmem-cell-names
100c9ccf3a3SEmmanuel Vadot
101c9ccf3a3SEmmanuel VadotadditionalProperties: false
102c9ccf3a3SEmmanuel Vadot
103c9ccf3a3SEmmanuel Vadotexamples:
104c9ccf3a3SEmmanuel Vadot  - |
105c9ccf3a3SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
106c9ccf3a3SEmmanuel Vadot
107c9ccf3a3SEmmanuel Vadot    cpr_opp_table: opp-table-cpr {
108c9ccf3a3SEmmanuel Vadot        compatible = "operating-points-v2-qcom-level";
109c9ccf3a3SEmmanuel Vadot
110c9ccf3a3SEmmanuel Vadot        cpr_opp1: opp1 {
111c9ccf3a3SEmmanuel Vadot            opp-level = <1>;
112c9ccf3a3SEmmanuel Vadot            qcom,opp-fuse-level = <1>;
113c9ccf3a3SEmmanuel Vadot        };
114c9ccf3a3SEmmanuel Vadot        cpr_opp2: opp2 {
115c9ccf3a3SEmmanuel Vadot            opp-level = <2>;
116c9ccf3a3SEmmanuel Vadot            qcom,opp-fuse-level = <2>;
117c9ccf3a3SEmmanuel Vadot        };
118c9ccf3a3SEmmanuel Vadot        cpr_opp3: opp3 {
119c9ccf3a3SEmmanuel Vadot            opp-level = <3>;
120c9ccf3a3SEmmanuel Vadot            qcom,opp-fuse-level = <3>;
121c9ccf3a3SEmmanuel Vadot        };
122c9ccf3a3SEmmanuel Vadot    };
123c9ccf3a3SEmmanuel Vadot
124c9ccf3a3SEmmanuel Vadot    power-controller@b018000 {
125c9ccf3a3SEmmanuel Vadot        compatible = "qcom,qcs404-cpr", "qcom,cpr";
126c9ccf3a3SEmmanuel Vadot        reg = <0x0b018000 0x1000>;
127c9ccf3a3SEmmanuel Vadot        interrupts = <0 15 IRQ_TYPE_EDGE_RISING>;
128c9ccf3a3SEmmanuel Vadot        clocks = <&xo_board>;
129c9ccf3a3SEmmanuel Vadot        clock-names = "ref";
130c9ccf3a3SEmmanuel Vadot        vdd-apc-supply = <&pms405_s3>;
131c9ccf3a3SEmmanuel Vadot        #power-domain-cells = <0>;
132c9ccf3a3SEmmanuel Vadot        operating-points-v2 = <&cpr_opp_table>;
133c9ccf3a3SEmmanuel Vadot        acc-syscon = <&tcsr>;
134c9ccf3a3SEmmanuel Vadot
135c9ccf3a3SEmmanuel Vadot        nvmem-cells = <&cpr_efuse_quot_offset1>,
136c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_quot_offset2>,
137c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_quot_offset3>,
138c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_init_voltage1>,
139c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_init_voltage2>,
140c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_init_voltage3>,
141c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_quot1>,
142c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_quot2>,
143c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_quot3>,
144c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_ring1>,
145c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_ring2>,
146c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_ring3>,
147c9ccf3a3SEmmanuel Vadot            <&cpr_efuse_revision>;
148c9ccf3a3SEmmanuel Vadot        nvmem-cell-names = "cpr_quotient_offset1",
149c9ccf3a3SEmmanuel Vadot            "cpr_quotient_offset2",
150c9ccf3a3SEmmanuel Vadot            "cpr_quotient_offset3",
151c9ccf3a3SEmmanuel Vadot            "cpr_init_voltage1",
152c9ccf3a3SEmmanuel Vadot            "cpr_init_voltage2",
153c9ccf3a3SEmmanuel Vadot            "cpr_init_voltage3",
154c9ccf3a3SEmmanuel Vadot            "cpr_quotient1",
155c9ccf3a3SEmmanuel Vadot            "cpr_quotient2",
156c9ccf3a3SEmmanuel Vadot            "cpr_quotient3",
157c9ccf3a3SEmmanuel Vadot            "cpr_ring_osc1",
158c9ccf3a3SEmmanuel Vadot            "cpr_ring_osc2",
159c9ccf3a3SEmmanuel Vadot            "cpr_ring_osc3",
160c9ccf3a3SEmmanuel Vadot            "cpr_fuse_revision";
161c9ccf3a3SEmmanuel Vadot    };
162