xref: /freebsd/sys/contrib/device-tree/Bindings/soc/qcom/qcom,rpmh-rsc.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only
2d5b0e70fSEmmanuel Vadot%YAML 1.2
3d5b0e70fSEmmanuel Vadot---
4d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/soc/qcom/qcom,rpmh-rsc.yaml#
5d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6d5b0e70fSEmmanuel Vadot
7d5b0e70fSEmmanuel Vadottitle: Qualcomm RPMH RSC
8d5b0e70fSEmmanuel Vadot
9d5b0e70fSEmmanuel Vadotmaintainers:
10d5b0e70fSEmmanuel Vadot  - Bjorn Andersson <bjorn.andersson@linaro.org>
11d5b0e70fSEmmanuel Vadot
12d5b0e70fSEmmanuel Vadotdescription: |
13d5b0e70fSEmmanuel Vadot  Resource Power Manager Hardened (RPMH) is the mechanism for communicating
14d5b0e70fSEmmanuel Vadot  with the hardened resource accelerators on Qualcomm SoCs. Requests to the
15d5b0e70fSEmmanuel Vadot  resources can be written to the Trigger Command Set (TCS)  registers and
16d5b0e70fSEmmanuel Vadot  using a (addr, val) pair and triggered. Messages in the TCS are then sent in
17d5b0e70fSEmmanuel Vadot  sequence over an internal bus.
18d5b0e70fSEmmanuel Vadot
19d5b0e70fSEmmanuel Vadot  The hardware block (Direct Resource Voter or DRV) is a part of the h/w entity
20d5b0e70fSEmmanuel Vadot  (Resource State Coordinator a.k.a RSC) that can handle multiple sleep and
21d5b0e70fSEmmanuel Vadot  active/wake resource requests. Multiple such DRVs can exist in a SoC and can
22d5b0e70fSEmmanuel Vadot  be written to from Linux. The structure of each DRV follows the same template
23d5b0e70fSEmmanuel Vadot  with a few variations that are captured by the properties here.
24d5b0e70fSEmmanuel Vadot
25d5b0e70fSEmmanuel Vadot  A TCS may be triggered from Linux or triggered by the F/W after all the CPUs
26d5b0e70fSEmmanuel Vadot  have powered off to facilitate idle power saving. TCS could be classified as::
27d5b0e70fSEmmanuel Vadot    ACTIVE  - Triggered by Linux
28d5b0e70fSEmmanuel Vadot    SLEEP   - Triggered by F/W
29d5b0e70fSEmmanuel Vadot    WAKE    - Triggered by F/W
30d5b0e70fSEmmanuel Vadot    CONTROL - Triggered by F/W
31d5b0e70fSEmmanuel Vadot  See also:: <dt-bindings/soc/qcom,rpmh-rsc.h>
32d5b0e70fSEmmanuel Vadot
33d5b0e70fSEmmanuel Vadot  The order in which they are described in the DT, should match the hardware
34d5b0e70fSEmmanuel Vadot  configuration.
35d5b0e70fSEmmanuel Vadot
36d5b0e70fSEmmanuel Vadot  Requests can be made for the state of a resource, when the subsystem is
37d5b0e70fSEmmanuel Vadot  active or idle. When all subsystems like Modem, GPU, CPU are idle, the
38d5b0e70fSEmmanuel Vadot  resource state will be an aggregate of the sleep votes from each of those
39d5b0e70fSEmmanuel Vadot  subsystems. Clients may request a sleep value for their shared resources in
40d5b0e70fSEmmanuel Vadot  addition to the active mode requests.
41d5b0e70fSEmmanuel Vadot
42d5b0e70fSEmmanuel Vadot  Drivers that want to use the RSC to communicate with RPMH must specify their
43d5b0e70fSEmmanuel Vadot  bindings as child nodes of the RSC controllers they wish to communicate with.
44d5b0e70fSEmmanuel Vadot
45d5b0e70fSEmmanuel Vadotproperties:
46d5b0e70fSEmmanuel Vadot  compatible:
47d5b0e70fSEmmanuel Vadot    const: qcom,rpmh-rsc
48d5b0e70fSEmmanuel Vadot
49d5b0e70fSEmmanuel Vadot  interrupts:
50d5b0e70fSEmmanuel Vadot    minItems: 1
51d5b0e70fSEmmanuel Vadot    maxItems: 4
52d5b0e70fSEmmanuel Vadot    description:
53d5b0e70fSEmmanuel Vadot      The interrupt that trips when a message complete/response is received for
54d5b0e70fSEmmanuel Vadot      this DRV from the accelerators.
55d5b0e70fSEmmanuel Vadot      Number of interrupts must match number of DRV blocks.
56d5b0e70fSEmmanuel Vadot
57d5b0e70fSEmmanuel Vadot  label:
58d5b0e70fSEmmanuel Vadot    description:
59d5b0e70fSEmmanuel Vadot      Name for the RSC. The name would be used in trace logs.
60d5b0e70fSEmmanuel Vadot
61d5b0e70fSEmmanuel Vadot  qcom,drv-id:
62d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
63d5b0e70fSEmmanuel Vadot    description:
64d5b0e70fSEmmanuel Vadot      The ID of the DRV in the RSC block that will be used by this controller.
65d5b0e70fSEmmanuel Vadot
66d5b0e70fSEmmanuel Vadot  qcom,tcs-config:
67d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-matrix
68b97ee269SEmmanuel Vadot    minItems: 4
69b97ee269SEmmanuel Vadot    maxItems: 4
70d5b0e70fSEmmanuel Vadot    items:
71b97ee269SEmmanuel Vadot      items:
72b97ee269SEmmanuel Vadot        - description: |
73b97ee269SEmmanuel Vadot            TCS type::
74b97ee269SEmmanuel Vadot             - ACTIVE_TCS
75b97ee269SEmmanuel Vadot             - SLEEP_TCS
76b97ee269SEmmanuel Vadot             - WAKE_TCS
77b97ee269SEmmanuel Vadot             - CONTROL_TCS
78d5b0e70fSEmmanuel Vadot          enum: [ 0, 1, 2, 3 ]
79d5b0e70fSEmmanuel Vadot        - description: Number of TCS
80d5b0e70fSEmmanuel Vadot    description: |
81d5b0e70fSEmmanuel Vadot      The tuple defining the configuration of TCS. Must have two cells which
82d5b0e70fSEmmanuel Vadot      describe each TCS type.  The order of the TCS must match the hardware
83d5b0e70fSEmmanuel Vadot      configuration.
84d5b0e70fSEmmanuel Vadot
85d5b0e70fSEmmanuel Vadot  qcom,tcs-offset:
86d5b0e70fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
87d5b0e70fSEmmanuel Vadot    description:
88d5b0e70fSEmmanuel Vadot      The offset of the TCS blocks.
89d5b0e70fSEmmanuel Vadot
90d5b0e70fSEmmanuel Vadot  reg:
91d5b0e70fSEmmanuel Vadot    minItems: 1
92d5b0e70fSEmmanuel Vadot    maxItems: 4
93d5b0e70fSEmmanuel Vadot
94d5b0e70fSEmmanuel Vadot  reg-names:
95d5b0e70fSEmmanuel Vadot    minItems: 1
96d5b0e70fSEmmanuel Vadot    items:
97d5b0e70fSEmmanuel Vadot      - const: drv-0
98d5b0e70fSEmmanuel Vadot      - const: drv-1
99d5b0e70fSEmmanuel Vadot      - const: drv-2
100d5b0e70fSEmmanuel Vadot      - const: drv-3
101d5b0e70fSEmmanuel Vadot
1028bab661aSEmmanuel Vadot  power-domains:
1038bab661aSEmmanuel Vadot    maxItems: 1
1048bab661aSEmmanuel Vadot
105d5b0e70fSEmmanuel Vadot  bcm-voter:
106d5b0e70fSEmmanuel Vadot    $ref: /schemas/interconnect/qcom,bcm-voter.yaml#
107d5b0e70fSEmmanuel Vadot
108d5b0e70fSEmmanuel Vadot  clock-controller:
109d5b0e70fSEmmanuel Vadot    $ref: /schemas/clock/qcom,rpmhcc.yaml#
110d5b0e70fSEmmanuel Vadot
111d5b0e70fSEmmanuel Vadot  power-controller:
112d5b0e70fSEmmanuel Vadot    $ref: /schemas/power/qcom,rpmpd.yaml#
113d5b0e70fSEmmanuel Vadot
114d5b0e70fSEmmanuel VadotpatternProperties:
115cb7aa33aSEmmanuel Vadot  '^regulators(-[0-9])?$':
116d5b0e70fSEmmanuel Vadot    $ref: /schemas/regulator/qcom,rpmh-regulator.yaml#
117cb7aa33aSEmmanuel Vadot    unevaluatedProperties: false
118d5b0e70fSEmmanuel Vadot
119d5b0e70fSEmmanuel Vadotrequired:
120d5b0e70fSEmmanuel Vadot  - compatible
121d5b0e70fSEmmanuel Vadot  - interrupts
122d5b0e70fSEmmanuel Vadot  - qcom,drv-id
123d5b0e70fSEmmanuel Vadot  - qcom,tcs-config
124d5b0e70fSEmmanuel Vadot  - qcom,tcs-offset
125d5b0e70fSEmmanuel Vadot  - reg
126d5b0e70fSEmmanuel Vadot  - reg-names
127*f126890aSEmmanuel Vadot  - power-domains
128d5b0e70fSEmmanuel Vadot
129d5b0e70fSEmmanuel VadotadditionalProperties: false
130d5b0e70fSEmmanuel Vadot
131d5b0e70fSEmmanuel Vadotexamples:
132d5b0e70fSEmmanuel Vadot  - |
133d5b0e70fSEmmanuel Vadot    // For a TCS whose RSC base address is 0x179C0000 and is at a DRV id of
134d5b0e70fSEmmanuel Vadot    // 2, the register offsets for DRV2 start at 0D00, the register
135d5b0e70fSEmmanuel Vadot    // calculations are like this::
136d5b0e70fSEmmanuel Vadot    // DRV0: 0x179C0000
137d5b0e70fSEmmanuel Vadot    // DRV2: 0x179C0000 + 0x10000 = 0x179D0000
138d5b0e70fSEmmanuel Vadot    // DRV2: 0x179C0000 + 0x10000 * 2 = 0x179E0000
139d5b0e70fSEmmanuel Vadot    // TCS-OFFSET: 0xD00
140d5b0e70fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
141d5b0e70fSEmmanuel Vadot    #include <dt-bindings/soc/qcom,rpmh-rsc.h>
142d5b0e70fSEmmanuel Vadot
143d5b0e70fSEmmanuel Vadot    rsc@179c0000 {
144d5b0e70fSEmmanuel Vadot        compatible = "qcom,rpmh-rsc";
145d5b0e70fSEmmanuel Vadot        reg = <0x179c0000 0x10000>,
146d5b0e70fSEmmanuel Vadot              <0x179d0000 0x10000>,
147d5b0e70fSEmmanuel Vadot              <0x179e0000 0x10000>;
148d5b0e70fSEmmanuel Vadot        reg-names = "drv-0", "drv-1", "drv-2";
149d5b0e70fSEmmanuel Vadot        interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
150d5b0e70fSEmmanuel Vadot                     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
151d5b0e70fSEmmanuel Vadot                     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
152d5b0e70fSEmmanuel Vadot        label = "apps_rsc";
153d5b0e70fSEmmanuel Vadot        qcom,tcs-offset = <0xd00>;
154d5b0e70fSEmmanuel Vadot        qcom,drv-id = <2>;
155d5b0e70fSEmmanuel Vadot        qcom,tcs-config = <ACTIVE_TCS  2>,
156d5b0e70fSEmmanuel Vadot                          <SLEEP_TCS   3>,
157d5b0e70fSEmmanuel Vadot                          <WAKE_TCS    3>,
158d5b0e70fSEmmanuel Vadot                          <CONTROL_TCS 1>;
1598bab661aSEmmanuel Vadot        power-domains = <&CLUSTER_PD>;
160d5b0e70fSEmmanuel Vadot      };
161d5b0e70fSEmmanuel Vadot
162d5b0e70fSEmmanuel Vadot  - |
163d5b0e70fSEmmanuel Vadot    // For a TCS whose RSC base address is 0xAF20000 and is at DRV id of 0, the
164d5b0e70fSEmmanuel Vadot    // register offsets for DRV0 start at 01C00, the register calculations are
165d5b0e70fSEmmanuel Vadot    // like this::
166d5b0e70fSEmmanuel Vadot    // DRV0: 0xAF20000
167d5b0e70fSEmmanuel Vadot    // TCS-OFFSET: 0x1C00
168d5b0e70fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
169d5b0e70fSEmmanuel Vadot    #include <dt-bindings/soc/qcom,rpmh-rsc.h>
170d5b0e70fSEmmanuel Vadot
171d5b0e70fSEmmanuel Vadot    rsc@af20000 {
172d5b0e70fSEmmanuel Vadot        compatible = "qcom,rpmh-rsc";
173d5b0e70fSEmmanuel Vadot        reg = <0xaf20000 0x10000>;
174d5b0e70fSEmmanuel Vadot        reg-names = "drv-0";
175d5b0e70fSEmmanuel Vadot        interrupts = <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>;
176d5b0e70fSEmmanuel Vadot        label = "disp_rsc";
177d5b0e70fSEmmanuel Vadot        qcom,tcs-offset = <0x1c00>;
178d5b0e70fSEmmanuel Vadot        qcom,drv-id = <0>;
179d5b0e70fSEmmanuel Vadot        qcom,tcs-config = <ACTIVE_TCS  0>,
180d5b0e70fSEmmanuel Vadot                          <SLEEP_TCS   1>,
181d5b0e70fSEmmanuel Vadot                          <WAKE_TCS    1>,
182d5b0e70fSEmmanuel Vadot                          <CONTROL_TCS 0>;
183*f126890aSEmmanuel Vadot        power-domains = <&CLUSTER_PD>;
184d5b0e70fSEmmanuel Vadot    };
185d5b0e70fSEmmanuel Vadot
186d5b0e70fSEmmanuel Vadot  - |
187d5b0e70fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
188d5b0e70fSEmmanuel Vadot    #include <dt-bindings/soc/qcom,rpmh-rsc.h>
189d5b0e70fSEmmanuel Vadot    #include <dt-bindings/power/qcom-rpmpd.h>
190d5b0e70fSEmmanuel Vadot
191d5b0e70fSEmmanuel Vadot    rsc@18200000 {
192d5b0e70fSEmmanuel Vadot        compatible = "qcom,rpmh-rsc";
193d5b0e70fSEmmanuel Vadot        reg = <0x18200000 0x10000>,
194d5b0e70fSEmmanuel Vadot              <0x18210000 0x10000>,
195d5b0e70fSEmmanuel Vadot              <0x18220000 0x10000>;
196d5b0e70fSEmmanuel Vadot        reg-names = "drv-0", "drv-1", "drv-2";
197d5b0e70fSEmmanuel Vadot        interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
198d5b0e70fSEmmanuel Vadot                     <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
199d5b0e70fSEmmanuel Vadot                     <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
200d5b0e70fSEmmanuel Vadot        label = "apps_rsc";
201d5b0e70fSEmmanuel Vadot        qcom,tcs-offset = <0xd00>;
202d5b0e70fSEmmanuel Vadot        qcom,drv-id = <2>;
203d5b0e70fSEmmanuel Vadot        qcom,tcs-config = <ACTIVE_TCS  2>,
204d5b0e70fSEmmanuel Vadot                          <SLEEP_TCS   3>,
205d5b0e70fSEmmanuel Vadot                          <WAKE_TCS    3>,
206d5b0e70fSEmmanuel Vadot                          <CONTROL_TCS 0>;
2078bab661aSEmmanuel Vadot        power-domains = <&CLUSTER_PD>;
208d5b0e70fSEmmanuel Vadot
209d5b0e70fSEmmanuel Vadot        clock-controller {
210d5b0e70fSEmmanuel Vadot            compatible = "qcom,sm8350-rpmh-clk";
211d5b0e70fSEmmanuel Vadot            #clock-cells = <1>;
212d5b0e70fSEmmanuel Vadot            clock-names = "xo";
213d5b0e70fSEmmanuel Vadot            clocks = <&xo_board>;
214d5b0e70fSEmmanuel Vadot        };
215d5b0e70fSEmmanuel Vadot
216d5b0e70fSEmmanuel Vadot        power-controller {
217d5b0e70fSEmmanuel Vadot            compatible = "qcom,sm8350-rpmhpd";
218d5b0e70fSEmmanuel Vadot            #power-domain-cells = <1>;
219d5b0e70fSEmmanuel Vadot            operating-points-v2 = <&rpmhpd_opp_table>;
220d5b0e70fSEmmanuel Vadot
221d5b0e70fSEmmanuel Vadot            rpmhpd_opp_table: opp-table {
222d5b0e70fSEmmanuel Vadot                compatible = "operating-points-v2";
223d5b0e70fSEmmanuel Vadot
224d5b0e70fSEmmanuel Vadot                rpmhpd_opp_ret: opp1 {
225d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_RETENTION>;
226d5b0e70fSEmmanuel Vadot                };
227d5b0e70fSEmmanuel Vadot
228d5b0e70fSEmmanuel Vadot                rpmhpd_opp_min_svs: opp2 {
229d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
230d5b0e70fSEmmanuel Vadot                };
231d5b0e70fSEmmanuel Vadot
232d5b0e70fSEmmanuel Vadot                rpmhpd_opp_low_svs: opp3 {
233d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
234d5b0e70fSEmmanuel Vadot                };
235d5b0e70fSEmmanuel Vadot
236d5b0e70fSEmmanuel Vadot                rpmhpd_opp_svs: opp4 {
237d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
238d5b0e70fSEmmanuel Vadot                };
239d5b0e70fSEmmanuel Vadot
240d5b0e70fSEmmanuel Vadot                rpmhpd_opp_svs_l1: opp5 {
241d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
242d5b0e70fSEmmanuel Vadot                };
243d5b0e70fSEmmanuel Vadot
244d5b0e70fSEmmanuel Vadot                rpmhpd_opp_nom: opp6 {
245d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
246d5b0e70fSEmmanuel Vadot                };
247d5b0e70fSEmmanuel Vadot
248d5b0e70fSEmmanuel Vadot                rpmhpd_opp_nom_l1: opp7 {
249d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
250d5b0e70fSEmmanuel Vadot                };
251d5b0e70fSEmmanuel Vadot
252d5b0e70fSEmmanuel Vadot                rpmhpd_opp_nom_l2: opp8 {
253d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_NOM_L2>;
254d5b0e70fSEmmanuel Vadot                };
255d5b0e70fSEmmanuel Vadot
256d5b0e70fSEmmanuel Vadot                rpmhpd_opp_turbo: opp9 {
257d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
258d5b0e70fSEmmanuel Vadot                };
259d5b0e70fSEmmanuel Vadot
260d5b0e70fSEmmanuel Vadot                rpmhpd_opp_turbo_l1: opp10 {
261d5b0e70fSEmmanuel Vadot                    opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
262d5b0e70fSEmmanuel Vadot                };
263d5b0e70fSEmmanuel Vadot            };
264d5b0e70fSEmmanuel Vadot        };
265d5b0e70fSEmmanuel Vadot
266d5b0e70fSEmmanuel Vadot        bcm-voter {
267d5b0e70fSEmmanuel Vadot            compatible = "qcom,bcm-voter";
268d5b0e70fSEmmanuel Vadot        };
269d5b0e70fSEmmanuel Vadot    };
270