Skip to content

Commit 9a2c674

Browse files
stephan-ghandersson
authored andcommitted
dt-bindings: remoteproc: Add Qualcomm RPM processor/subsystem
On Qualcomm platforms, most subsystems (e.g. audio/modem DSP) are described as remote processors in the device tree, with a dedicated node where properties and services related to them can be described. The Resource Power Manager (RPM) is also such a subsystem, with a remote processor that is running a special firmware. Unfortunately, the RPM never got a dedicated node representing it properly in the device tree. Most of the RPM services are described below a top-level /smd or /rpm-glink node. However, SMD/GLINK is just one of the communication channels to the RPM firmware. For example, the MPM interrupt functionality provided by the RPM does not use SMD/GLINK but writes directly to a special memory region allocated by the RPM firmware in combination with a mailbox. Currently there is no good place in the device tree to describe this functionality. It doesn't belong below SMD/GLINK but it's not an independent top-level device either. Introduce a new "qcom,rpm-proc" compatible that allows describing the RPM as a remote processor/subsystem like all others. The SMD/GLINK node is moved to a "smd-edge"/"glink-edge" subnode consistent with other existing bindings. Additional subnodes (e.g. interrupt-controller for MPM, rpm-master-stats) can be also added there. Deprecate using the old top-level /smd node since all SMD edges are now specified as subnodes of the remote processor. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230531-rpm-rproc-v3-6-a07dcdefd918@gerhold.net Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent b3a12c2 commit 9a2c674

3 files changed

Lines changed: 181 additions & 3 deletions

File tree

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/remoteproc/qcom,rpm-proc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Resource Power Manager (RPM) Processor/Subsystem
8+
9+
maintainers:
10+
- Bjorn Andersson <andersson@kernel.org>
11+
- Konrad Dybcio <konrad.dybcio@linaro.org>
12+
- Stephan Gerhold <stephan@gerhold.net>
13+
14+
description: |
15+
Resource Power Manager (RPM) subsystem found in various Qualcomm platforms:
16+
17+
+--------------------------------------------+
18+
| RPM subsystem (qcom,rpm-proc) |
19+
| |
20+
reset | +---------------+ +-----+ +-----+ |
21+
--------->| | | MPM | | CPR | ... |
22+
IPC interrupts | | ARM Cortex-M3 |--- +-----+ +-----+ |
23+
----------------->| | | | | |
24+
| +---------------+ |---------------------- |
25+
| +---------------+ | |
26+
| | Code RAM |--| +------------------+ |
27+
| +---------------+ | | | |
28+
| +---------------+ |--| Message RAM | |
29+
| | Data RAM |--| | | |
30+
| +---------------+ | +------------------+ |
31+
+--------------------|-----------------------+
32+
v
33+
NoC
34+
35+
The firmware running on the processor inside the RPM subsystem allows each
36+
component in the system to vote for state of the system resources, such as
37+
clocks, regulators and bus frequencies. It implements multiple separate
38+
communication interfaces that are described in subnodes, e.g. SMD and MPM:
39+
40+
+------------------------------+
41+
| ARM Cortex-M3 |
42+
| | +------------------------------+
43+
| +--------------------------+ | | Message RAM |
44+
| | RPM firmware | | | |
45+
IPC IRQ 0 | | +----------------------+ | | | +--------------------------+ |
46+
-------------->| SMD server |<------->| SMD data structures | |
47+
| | | +--------------+ | | | | | +--------------+ | |
48+
| | | | rpm_requests | ... | | | | | | rpm_requests | ... | |
49+
| | | +--------------+ | | | | | +--------------+ | |
50+
IPC IRQ 1 | | +----------------------+ | | | +--------------------------+ |
51+
-------------->| MPM virtualization |<--------| MPM register copy (vMPM) | |
52+
| | +----------------------+ | | | +--------------------------+ |
53+
| | ... | | | | ... |
54+
| +--------------------|-----+ | +------------------------------+
55+
+----------------------|-------+
56+
v
57+
+--------------+
58+
| MPM Hardware |
59+
+--------------+
60+
61+
The services provided by the firmware are only available after the firmware
62+
has been loaded and the processor has been released from reset. Usually this
63+
happens early in the boot process before the operating system is started.
64+
65+
properties:
66+
compatible:
67+
items:
68+
- enum:
69+
- qcom,apq8084-rpm-proc
70+
- qcom,ipq6018-rpm-proc
71+
- qcom,ipq9574-rpm-proc
72+
- qcom,mdm9607-rpm-proc
73+
- qcom,msm8226-rpm-proc
74+
- qcom,msm8610-rpm-proc
75+
- qcom,msm8909-rpm-proc
76+
- qcom,msm8916-rpm-proc
77+
- qcom,msm8917-rpm-proc
78+
- qcom,msm8936-rpm-proc
79+
- qcom,msm8937-rpm-proc
80+
- qcom,msm8952-rpm-proc
81+
- qcom,msm8953-rpm-proc
82+
- qcom,msm8974-rpm-proc
83+
- qcom,msm8976-rpm-proc
84+
- qcom,msm8994-rpm-proc
85+
- qcom,msm8996-rpm-proc
86+
- qcom,msm8998-rpm-proc
87+
- qcom,qcm2290-rpm-proc
88+
- qcom,qcs404-rpm-proc
89+
- qcom,sdm660-rpm-proc
90+
- qcom,sm6115-rpm-proc
91+
- qcom,sm6125-rpm-proc
92+
- qcom,sm6375-rpm-proc
93+
- const: qcom,rpm-proc
94+
95+
smd-edge:
96+
$ref: /schemas/remoteproc/qcom,smd-edge.yaml#
97+
description:
98+
Qualcomm Shared Memory subnode which represents communication edge,
99+
channels and devices related to the RPM subsystem.
100+
101+
glink-edge:
102+
$ref: /schemas/remoteproc/qcom,glink-rpm-edge.yaml#
103+
description:
104+
Qualcomm G-Link subnode which represents communication edge,
105+
channels and devices related to the RPM subsystem.
106+
107+
interrupt-controller:
108+
type: object
109+
$ref: /schemas/interrupt-controller/qcom,mpm.yaml#
110+
description:
111+
MSM Power Manager (MPM) interrupt controller that monitors interrupts
112+
when the system is asleep.
113+
114+
master-stats:
115+
$ref: /schemas/soc/qcom/qcom,rpm-master-stats.yaml#
116+
description:
117+
Subsystem-level low-power mode statistics provided by RPM.
118+
119+
required:
120+
- compatible
121+
122+
oneOf:
123+
- required:
124+
- smd-edge
125+
- required:
126+
- glink-edge
127+
128+
additionalProperties: false
129+
130+
examples:
131+
# SMD
132+
- |
133+
#include <dt-bindings/interrupt-controller/arm-gic.h>
134+
#include <dt-bindings/interrupt-controller/irq.h>
135+
136+
remoteproc {
137+
compatible = "qcom,msm8916-rpm-proc", "qcom,rpm-proc";
138+
139+
smd-edge {
140+
interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
141+
qcom,ipc = <&apcs 8 0>;
142+
qcom,smd-edge = <15>;
143+
144+
rpm-requests {
145+
compatible = "qcom,rpm-msm8916";
146+
qcom,smd-channels = "rpm_requests";
147+
/* ... */
148+
};
149+
};
150+
};
151+
# GLINK
152+
- |
153+
#include <dt-bindings/interrupt-controller/arm-gic.h>
154+
#include <dt-bindings/interrupt-controller/irq.h>
155+
156+
remoteproc {
157+
compatible = "qcom,qcm2290-rpm-proc", "qcom,rpm-proc";
158+
159+
glink-edge {
160+
compatible = "qcom,glink-rpm";
161+
interrupts = <GIC_SPI 194 IRQ_TYPE_EDGE_RISING>;
162+
qcom,rpm-msg-ram = <&rpm_msg_ram>;
163+
mboxes = <&apcs_glb 0>;
164+
165+
rpm-requests {
166+
compatible = "qcom,rpm-qcm2290";
167+
qcom,glink-channels = "rpm_requests";
168+
/* ... */
169+
};
170+
};
171+
};

Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ examples:
120120
#include <dt-bindings/interrupt-controller/arm-gic.h>
121121
#include <dt-bindings/interrupt-controller/irq.h>
122122
123-
smd {
124-
compatible = "qcom,smd";
123+
remoteproc {
124+
compatible = "qcom,msm8916-rpm-proc", "qcom,rpm-proc";
125125
126-
rpm {
126+
smd-edge {
127127
interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
128128
qcom,ipc = <&apcs 8 0>;
129129
qcom,smd-edge = <15>;

Documentation/devicetree/bindings/soc/qcom/qcom,smd.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ description:
1515
The Qualcomm Shared Memory Driver is a FIFO based communication channel for
1616
sending data between the various subsystems in Qualcomm platforms.
1717

18+
Using the top-level SMD node is deprecated. Instead, the SMD edges are defined
19+
directly below the device node representing the respective remote subsystem
20+
or remote processor.
21+
22+
deprecated: true
23+
1824
properties:
1925
compatible:
2026
const: qcom,smd
@@ -37,6 +43,7 @@ examples:
3743
# The following example represents a smd node, with one edge representing the
3844
# "rpm" subsystem. For the "rpm" subsystem we have a device tied to the
3945
# "rpm_request" channel.
46+
# NOTE: This is deprecated, represent the RPM using "qcom,rpm-proc" instead.
4047
- |
4148
#include <dt-bindings/interrupt-controller/arm-gic.h>
4249

0 commit comments

Comments
 (0)