Skip to content

Commit d51f8f6

Browse files
committed
Merge tag 'mailbox-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox
Pull mailbox updates from Jassi Brar: "broadcom: - remove unused pdc_dma_map imx: - fix TXDB_V2 channel race condition mediatek: - cleanup and refactor driver - add bindings for gce-props omap: - fix mailbox interrupt sharing qcom: - add bindings for SA8775p - add CPUCP driver zynqmp: - make polling period configurable" * tag 'mailbox-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: mailbox: mtk-cmdq: Move devm_mbox_controller_register() after devm_pm_runtime_enable() mailbox: zynqmp-ipi: Make polling period configurable mailbox: qcom-cpucp: fix 64BIT dependency mailbox: Add support for QTI CPUCP mailbox controller dt-bindings: mailbox: qcom: Add CPUCP mailbox controller bindings dt-bindings: remoteproc: qcom,sa8775p-pas: Document the SA8775p ADSP, CDSP and GPDSP mailbox: mtk-cmdq: add missing MODULE_DESCRIPTION() macro mailbox: bcm-pdc: remove unused struct 'pdc_dma_map' mailbox: imx: fix TXDB_V2 channel race condition mailbox: omap: Fix mailbox interrupt sharing mailbox: mtk-cmdq: Dynamically allocate clk_bulk_data structure mailbox: mtk-cmdq: Move and partially refactor clocks probe mailbox: mtk-cmdq: Stop requiring name for GCE clock dt-bindings: mailbox: Add mediatek,gce-props.yaml
2 parents 71bed1e + a8bd68e commit d51f8f6

File tree

12 files changed

+548
-43
lines changed

12 files changed

+548
-43
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mailbox/mediatek,gce-props.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek Global Command Engine Common Properties
8+
9+
maintainers:
10+
- Houlong Wei <[email protected]>
11+
12+
description:
13+
The Global Command Engine (GCE) is an instruction based, multi-threaded,
14+
single-core command dispatcher for MediaTek hardware. The Command Queue
15+
(CMDQ) mailbox driver is a driver for GCE, implemented using the Linux
16+
mailbox framework. It is used to receive messages from mailbox consumers
17+
and configure GCE to execute the specified instruction set in the message.
18+
We use mediatek,gce-mailbox.yaml to define the properties for CMDQ mailbox
19+
driver. A device driver that uses the CMDQ driver to configure its hardware
20+
registers is a mailbox consumer. The mailbox consumer can request a mailbox
21+
channel corresponding to a GCE hardware thread to send a message, specifying
22+
that the GCE thread to configure its hardware. The mailbox provider can also
23+
reserve a mailbox channel to configure GCE hardware register by the specific
24+
GCE thread. This binding defines the common GCE properties for both mailbox
25+
provider and consumers.
26+
27+
properties:
28+
mediatek,gce-events:
29+
description:
30+
GCE has an event table in SRAM, consisting of 1024 event IDs (0~1023).
31+
Each event ID has a boolean event value with the default value 0.
32+
The property mediatek,gce-events is used to obtain the event IDs.
33+
Some gce-events are hardware-bound and cannot be changed by software.
34+
For instance, in MT8195, when VDO0_MUTEX is stream done, VDO_MUTEX will
35+
send an event signal to GCE, setting the value of event ID 597 to 1.
36+
Similarly, in MT8188, the value of event ID 574 will be set to 1 when
37+
VOD0_MUTEX is stream done.
38+
On the other hand, some gce-events are not hardware-bound and can be
39+
changed by software. For example, in MT8188, we can set the value of
40+
event ID 855, which is not bound to any hardware, to 1 when the driver
41+
in the secure world completes a task. However, in MT8195, event ID 855
42+
is already bound to VDEC_LAT1, so we need to select another event ID to
43+
achieve the same purpose. This event ID can be any ID that is not bound
44+
to any hardware and is not yet used in any software driver.
45+
To determine if the event ID is bound to the hardware or used by a
46+
software driver, refer to the GCE header
47+
include/dt-bindings/gce/<chip>-gce.h of each chip.
48+
$ref: /schemas/types.yaml#/definitions/uint32-array
49+
minItems: 1
50+
maxItems: 32
51+
52+
additionalProperties: true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mailbox/qcom,cpucp-mbox.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Technologies, Inc. CPUCP Mailbox Controller
8+
9+
maintainers:
10+
- Sibi Sankar <[email protected]>
11+
12+
description:
13+
The CPUSS Control Processor (CPUCP) mailbox controller enables communication
14+
between AP and CPUCP by acting as a doorbell between them.
15+
16+
properties:
17+
compatible:
18+
items:
19+
- const: qcom,x1e80100-cpucp-mbox
20+
21+
reg:
22+
items:
23+
- description: CPUCP rx register region
24+
- description: CPUCP tx register region
25+
26+
interrupts:
27+
maxItems: 1
28+
29+
"#mbox-cells":
30+
const: 1
31+
32+
required:
33+
- compatible
34+
- reg
35+
- interrupts
36+
- "#mbox-cells"
37+
38+
additionalProperties: false
39+
40+
examples:
41+
- |
42+
#include <dt-bindings/interrupt-controller/arm-gic.h>
43+
44+
mailbox@17430000 {
45+
compatible = "qcom,x1e80100-cpucp-mbox";
46+
reg = <0x17430000 0x10000>, <0x18830000 0x10000>;
47+
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
48+
#mbox-cells = <1>;
49+
};
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/remoteproc/qcom,sa8775p-pas.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm SA8775p Peripheral Authentication Service
8+
9+
maintainers:
10+
- Bartosz Golaszewski <[email protected]>
11+
12+
description:
13+
Qualcomm SA8775p SoC Peripheral Authentication Service loads and boots firmware
14+
on the Qualcomm DSP Hexagon cores.
15+
16+
properties:
17+
compatible:
18+
enum:
19+
- qcom,sa8775p-adsp-pas
20+
- qcom,sa8775p-cdsp0-pas
21+
- qcom,sa8775p-cdsp1-pas
22+
- qcom,sa8775p-gpdsp0-pas
23+
- qcom,sa8775p-gpdsp1-pas
24+
25+
reg:
26+
maxItems: 1
27+
28+
clocks:
29+
items:
30+
- description: XO clock
31+
32+
clock-names:
33+
items:
34+
- const: xo
35+
36+
qcom,qmp:
37+
$ref: /schemas/types.yaml#/definitions/phandle
38+
description: Reference to the AOSS side-channel message RAM.
39+
40+
firmware-name:
41+
$ref: /schemas/types.yaml#/definitions/string-array
42+
items:
43+
- description: Firmware name of the Hexagon core
44+
45+
memory-region:
46+
items:
47+
- description: Memory region for main Firmware authentication
48+
49+
interrupts:
50+
maxItems: 5
51+
52+
interrupt-names:
53+
maxItems: 5
54+
55+
required:
56+
- compatible
57+
- reg
58+
- memory-region
59+
60+
allOf:
61+
- $ref: /schemas/remoteproc/qcom,pas-common.yaml#
62+
63+
- if:
64+
properties:
65+
compatible:
66+
enum:
67+
- qcom,sa8775p-adsp-pas
68+
then:
69+
properties:
70+
power-domains:
71+
items:
72+
- description: LCX power domain
73+
- description: LMX power domain
74+
power-domain-names:
75+
items:
76+
- const: lcx
77+
- const: lmx
78+
79+
- if:
80+
properties:
81+
compatible:
82+
enum:
83+
- qcom,sa8775p-cdsp0-pas
84+
- qcom,sa8775p-cdsp1-pas
85+
then:
86+
properties:
87+
power-domains:
88+
items:
89+
- description: CX power domain
90+
- description: MXC power domain
91+
- description: NSP0 power domain
92+
power-domain-names:
93+
items:
94+
- const: cx
95+
- const: mxc
96+
- const: nsp
97+
98+
- if:
99+
properties:
100+
compatible:
101+
enum:
102+
- qcom,sa8775p-gpdsp0-pas
103+
- qcom,sa8775p-gpdsp1-pas
104+
then:
105+
properties:
106+
power-domains:
107+
items:
108+
- description: CX power domain
109+
- description: MXC power domain
110+
power-domain-names:
111+
items:
112+
- const: cx
113+
- const: mxc
114+
115+
unevaluatedProperties: false
116+
117+
examples:
118+
- |
119+
#include <dt-bindings/clock/qcom,rpmh.h>
120+
#include <dt-bindings/interconnect/qcom,sa8775p-rpmh.h>
121+
#include <dt-bindings/interrupt-controller/irq.h>
122+
#include <dt-bindings/mailbox/qcom-ipcc.h>
123+
#include <dt-bindings/power/qcom,rpmhpd.h>
124+
125+
remoteproc@30000000 {
126+
compatible = "qcom,sa8775p-adsp-pas";
127+
reg = <0x30000000 0x100>;
128+
129+
interrupts-extended = <&pdc 6 IRQ_TYPE_EDGE_RISING>,
130+
<&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>,
131+
<&smp2p_adsp_in 2 IRQ_TYPE_EDGE_RISING>,
132+
<&smp2p_adsp_in 1 IRQ_TYPE_EDGE_RISING>,
133+
<&smp2p_adsp_in 3 IRQ_TYPE_EDGE_RISING>;
134+
interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";
135+
136+
clocks = <&rpmhcc RPMH_CXO_CLK>;
137+
clock-names = "xo";
138+
139+
power-domains = <&rpmhpd RPMHPD_LCX>, <&rpmhpd RPMHPD_LMX>;
140+
power-domain-names = "lcx", "lmx";
141+
142+
interconnects = <&lpass_ag_noc MASTER_LPASS_PROC 0 &mc_virt SLAVE_EBI1 0>;
143+
144+
memory-region = <&pil_adsp_mem>;
145+
146+
qcom,qmp = <&aoss_qmp>;
147+
148+
qcom,smem-states = <&smp2p_adsp_out 0>;
149+
qcom,smem-state-names = "stop";
150+
151+
glink-edge {
152+
interrupts-extended = <&ipcc IPCC_CLIENT_LPASS
153+
IPCC_MPROC_SIGNAL_GLINK_QMP
154+
IRQ_TYPE_EDGE_RISING>;
155+
mboxes = <&ipcc IPCC_CLIENT_LPASS IPCC_MPROC_SIGNAL_GLINK_QMP>;
156+
157+
label = "lpass";
158+
qcom,remote-pid = <2>;
159+
};
160+
};

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18749,6 +18749,13 @@ S: Maintained
1874918749
F: Documentation/devicetree/bindings/power/avs/qcom,cpr.yaml
1875018750
F: drivers/pmdomain/qcom/cpr.c
1875118751

18752+
QUALCOMM CPUCP MAILBOX DRIVER
18753+
M: Sibi Sankar <[email protected]>
18754+
18755+
S: Supported
18756+
F: Documentation/devicetree/bindings/mailbox/qcom,cpucp-mbox.yaml
18757+
F: drivers/mailbox/qcom-cpucp-mbox.c
18758+
1875218759
QUALCOMM CPUFREQ DRIVER MSM8996/APQ8096
1875318760
M: Ilia Lin <[email protected]>
1875418761

drivers/mailbox/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,14 @@ config SPRD_MBOX
276276
to send message between application processors and MCU. Say Y here if
277277
you want to build the Spreatrum mailbox controller driver.
278278

279+
config QCOM_CPUCP_MBOX
280+
tristate "Qualcomm Technologies, Inc. CPUCP mailbox driver"
281+
depends on (ARCH_QCOM || COMPILE_TEST) && 64BIT
282+
help
283+
Qualcomm Technologies, Inc. CPUSS Control Processor (CPUCP) mailbox
284+
controller driver enables communication between AP and CPUCP. Say
285+
Y here if you want to build this driver.
286+
279287
config QCOM_IPCC
280288
tristate "Qualcomm Technologies, Inc. IPCC driver"
281289
depends on ARCH_QCOM || COMPILE_TEST

drivers/mailbox/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,6 @@ obj-$(CONFIG_SUN6I_MSGBOX) += sun6i-msgbox.o
6161

6262
obj-$(CONFIG_SPRD_MBOX) += sprd-mailbox.o
6363

64+
obj-$(CONFIG_QCOM_CPUCP_MBOX) += qcom-cpucp-mbox.o
65+
6466
obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o

drivers/mailbox/bcm-pdc-mailbox.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ enum pdc_hw {
158158
PDC_HW /* PDC/MDE hardware (i.e. Northstar 2, Pegasus) */
159159
};
160160

161-
struct pdc_dma_map {
162-
void *ctx; /* opaque context associated with frame */
163-
};
164-
165161
/* dma descriptor */
166162
struct dma64dd {
167163
u32 ctrl1; /* misc control bits */

drivers/mailbox/imx-mailbox.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv,
225225
void *data)
226226
{
227227
u32 *arg = data;
228+
u32 val;
229+
int ret;
228230

229231
switch (cp->type) {
230232
case IMX_MU_TYPE_TX:
@@ -236,7 +238,13 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv,
236238
queue_work(system_bh_wq, &cp->txdb_work);
237239
break;
238240
case IMX_MU_TYPE_TXDB_V2:
239-
imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0);
241+
imx_mu_write(priv, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx),
242+
priv->dcfg->xCR[IMX_MU_GCR]);
243+
ret = readl_poll_timeout(priv->base + priv->dcfg->xCR[IMX_MU_GCR], val,
244+
!(val & IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx)),
245+
0, 1000);
246+
if (ret)
247+
dev_warn_ratelimited(priv->dev, "channel type: %d failure\n", cp->type);
240248
break;
241249
default:
242250
dev_warn_ratelimited(priv->dev, "Send data on wrong channel type: %d\n", cp->type);

0 commit comments

Comments
 (0)