Skip to content

Commit a060795

Browse files
committed
Merge tag 'mailbox-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox
Pull mailbox updates from Jassi Brar: "Core: - misc cleanup sophgo: - add driver for CV18XX series qcom: - add SM7150 APCS compatible - apcs: added separate clock node imx: - fix tx doorbell send microchip: - misc compile option fix mediatek: - Refine GCE_GCTL_VALUE setting" * tag 'mailbox-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: mailbox: qcom-apcs-ipc: Assign OF node to clock controller child device dt-bindings: mailbox: qcom,apcs: Add separate node for clock-controller dt-bindings: mailbox: qcom: Add the SM7150 APCS compatible mailbox: sophgo: add mailbox driver for CV18XX series SoC dt-bindings: mailbox: add Sophgo CV18XX series SoC mailbox: Use guard/scoped_guard for spinlock mailbox: Use guard/scoped_guard for con_mutex mailbox: Remove devm_mbox_controller_unregister mailbox: Propagate correct error return value mailbox: Not protect module_put with spin_lock_irqsave mailbox: Use dev_err when there is error mailbox: mtk-cmdq: Refine GCE_GCTL_VALUE setting mailbox: imx: Fix TXDB_V2 sending mailbox: mchp-ipc-sbi: Fix COMPILE_TEST build error
2 parents cd2e103 + d0b497d commit a060795

File tree

10 files changed

+536
-220
lines changed

10 files changed

+536
-220
lines changed

Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml

Lines changed: 119 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ properties:
4949
- qcom,qcs615-apss-shared
5050
- qcom,sc7180-apss-shared
5151
- qcom,sc8180x-apss-shared
52+
- qcom,sm7150-apss-shared
5253
- qcom,sm8150-apss-shared
5354
- const: qcom,sdm845-apss-shared
5455
- items:
@@ -72,6 +73,7 @@ properties:
7273
description: phandles to the parent clocks of the clock driver
7374
minItems: 2
7475
maxItems: 3
76+
deprecated: true
7577

7678
'#mbox-cells':
7779
const: 1
@@ -82,6 +84,23 @@ properties:
8284
clock-names:
8385
minItems: 2
8486
maxItems: 3
87+
deprecated: true
88+
89+
clock-controller:
90+
type: object
91+
additionalProperties: false
92+
properties:
93+
clocks:
94+
description: phandles to the parent clocks of the clock driver
95+
minItems: 2
96+
maxItems: 3
97+
98+
'#clock-cells':
99+
enum: [0, 1]
100+
101+
clock-names:
102+
minItems: 2
103+
maxItems: 3
85104

86105
required:
87106
- compatible
@@ -90,6 +109,76 @@ required:
90109

91110
additionalProperties: false
92111

112+
# Clocks should be specified either on the parent node or on the child node
113+
oneOf:
114+
- required:
115+
- clock-controller
116+
properties:
117+
clocks: false
118+
clock-names: false
119+
'#clock-cells': false
120+
- properties:
121+
clock-controller: false
122+
123+
$defs:
124+
msm8916-apcs-clock-controller:
125+
properties:
126+
clocks:
127+
items:
128+
- description: primary pll parent of the clock driver
129+
- description: auxiliary parent
130+
clock-names:
131+
items:
132+
- const: pll
133+
- const: aux
134+
'#clock-cells':
135+
const: 0
136+
137+
msm8939-apcs-clock-controller:
138+
properties:
139+
clocks:
140+
items:
141+
- description: primary pll parent of the clock driver
142+
- description: auxiliary parent
143+
- description: reference clock
144+
clock-names:
145+
items:
146+
- const: pll
147+
- const: aux
148+
- const: ref
149+
'#clock-cells':
150+
const: 0
151+
152+
sdx55-apcs-clock-controller:
153+
properties:
154+
clocks:
155+
items:
156+
- description: reference clock
157+
- description: primary pll parent of the clock driver
158+
- description: auxiliary parent
159+
clock-names:
160+
items:
161+
- const: ref
162+
- const: pll
163+
- const: aux
164+
'#clock-cells':
165+
const: 0
166+
167+
ipq6018-apcs-clock-controller:
168+
properties:
169+
clocks:
170+
items:
171+
- description: primary pll parent of the clock driver
172+
- description: XO clock
173+
- description: GCC GPLL0 clock source
174+
clock-names:
175+
items:
176+
- const: pll
177+
- const: xo
178+
- const: gpll0
179+
'#clock-cells':
180+
const: 1
181+
93182
allOf:
94183
- if:
95184
properties:
@@ -98,15 +187,10 @@ allOf:
98187
enum:
99188
- qcom,msm8916-apcs-kpss-global
100189
then:
190+
$ref: "#/$defs/msm8916-apcs-clock-controller"
101191
properties:
102-
clocks:
103-
items:
104-
- description: primary pll parent of the clock driver
105-
- description: auxiliary parent
106-
clock-names:
107-
items:
108-
- const: pll
109-
- const: aux
192+
clock-controller:
193+
$ref: "#/$defs/msm8916-apcs-clock-controller"
110194

111195
- if:
112196
properties:
@@ -115,17 +199,10 @@ allOf:
115199
enum:
116200
- qcom,msm8939-apcs-kpss-global
117201
then:
202+
$ref: "#/$defs/msm8939-apcs-clock-controller"
118203
properties:
119-
clocks:
120-
items:
121-
- description: primary pll parent of the clock driver
122-
- description: auxiliary parent
123-
- description: reference clock
124-
clock-names:
125-
items:
126-
- const: pll
127-
- const: aux
128-
- const: ref
204+
clock-controller:
205+
$ref: "#/$defs/msm8939-apcs-clock-controller"
129206

130207
- if:
131208
properties:
@@ -134,17 +211,10 @@ allOf:
134211
enum:
135212
- qcom,sdx55-apcs-gcc
136213
then:
214+
$ref: "#/$defs/sdx55-apcs-clock-controller"
137215
properties:
138-
clocks:
139-
items:
140-
- description: reference clock
141-
- description: primary pll parent of the clock driver
142-
- description: auxiliary parent
143-
clock-names:
144-
items:
145-
- const: ref
146-
- const: pll
147-
- const: aux
216+
clock-controller:
217+
$ref: "#/$defs/sdx55-apcs-clock-controller"
148218

149219
- if:
150220
properties:
@@ -153,17 +223,10 @@ allOf:
153223
enum:
154224
- qcom,ipq6018-apcs-apps-global
155225
then:
226+
$ref: "#/$defs/ipq6018-apcs-clock-controller"
156227
properties:
157-
clocks:
158-
items:
159-
- description: primary pll parent of the clock driver
160-
- description: XO clock
161-
- description: GCC GPLL0 clock source
162-
clock-names:
163-
items:
164-
- const: pll
165-
- const: xo
166-
- const: gpll0
228+
clock-controller:
229+
$ref: "#/$defs/ipq6018-apcs-clock-controller"
167230

168231
- if:
169232
properties:
@@ -179,19 +242,7 @@ allOf:
179242
properties:
180243
clocks: false
181244
clock-names: false
182-
183-
- if:
184-
properties:
185-
compatible:
186-
contains:
187-
enum:
188-
- qcom,ipq6018-apcs-apps-global
189-
then:
190-
properties:
191-
'#clock-cells':
192-
const: 1
193-
else:
194-
properties:
245+
clock-controller: false
195246
'#clock-cells':
196247
const: 0
197248

@@ -216,6 +267,23 @@ examples:
216267
};
217268
218269
# Example apcs with qcs404
270+
- |
271+
#define GCC_APSS_AHB_CLK_SRC 1
272+
#define GCC_GPLL0_AO_OUT_MAIN 123
273+
mailbox@b011000 {
274+
compatible = "qcom,qcs404-apcs-apps-global",
275+
"qcom,msm8916-apcs-kpss-global", "syscon";
276+
reg = <0x0b011000 0x1000>;
277+
#mbox-cells = <1>;
278+
279+
apcs_clk: clock-controller {
280+
clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>;
281+
clock-names = "pll", "aux";
282+
#clock-cells = <0>;
283+
};
284+
};
285+
286+
# Example apcs with qcs404 (deprecated: use clock-controller subnode)
219287
- |
220288
#define GCC_APSS_AHB_CLK_SRC 1
221289
#define GCC_GPLL0_AO_OUT_MAIN 123
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mailbox/sophgo,cv1800b-mailbox.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo CV1800/SG2000 mailbox controller
8+
9+
maintainers:
10+
- Yuntao Dai <[email protected]>
11+
- Junhui Liu <[email protected]>
12+
13+
description:
14+
Mailboxes integrated in Sophgo CV1800/SG2000 SoCs have 8 channels, each
15+
shipping an 8-byte FIFO. Any processor can write to an arbitrary channel
16+
and raise interrupts to receivers. Sending messages to itself is also
17+
supported.
18+
19+
properties:
20+
compatible:
21+
const: sophgo,cv1800b-mailbox
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
maxItems: 1
28+
29+
"#mbox-cells":
30+
const: 2
31+
description: |
32+
<&phandle channel target>
33+
phandle : Label name of mailbox controller
34+
channel : 0-7, Channel index
35+
target : 0-3, Target processor ID
36+
37+
Sophgo CV1800/SG2000 SoCs include the following processors, numbered as:
38+
<0> Cortex-A53 (Only available on CV181X/SG200X)
39+
<1> C906B
40+
<2> C906L
41+
<3> 8051
42+
43+
required:
44+
- compatible
45+
- reg
46+
- interrupts
47+
- "#mbox-cells"
48+
49+
additionalProperties: false
50+
51+
examples:
52+
- |
53+
#include <dt-bindings/interrupt-controller/irq.h>
54+
55+
mailbox@1900000 {
56+
compatible = "sophgo,cv1800b-mailbox";
57+
reg = <0x01900000 0x1000>;
58+
interrupts = <101 IRQ_TYPE_LEVEL_HIGH>;
59+
#mbox-cells = <2>;
60+
};

drivers/mailbox/Kconfig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ config ARM_MHU_V3
3636
that provides different means of transports: supported extensions
3737
will be discovered and possibly managed at probe-time.
3838

39+
config CV1800_MBOX
40+
tristate "cv1800 mailbox"
41+
depends on ARCH_SOPHGO || COMPILE_TEST
42+
help
43+
Mailbox driver implementation for Sophgo CV18XX SoCs. This driver
44+
can be used to send message between different processors in SoC. Any
45+
processer can write data in a channel, and set co-responding register
46+
to raise interrupt to notice another processor, and it is allowed to
47+
send data to itself.
48+
3949
config EXYNOS_MBOX
4050
tristate "Exynos Mailbox"
4151
depends on ARCH_EXYNOS || COMPILE_TEST
@@ -191,8 +201,8 @@ config POLARFIRE_SOC_MAILBOX
191201

192202
config MCHP_SBI_IPC_MBOX
193203
tristate "Microchip Inter-processor Communication (IPC) SBI driver"
194-
depends on RISCV_SBI || COMPILE_TEST
195-
depends on ARCH_MICROCHIP
204+
depends on RISCV_SBI
205+
depends on ARCH_MICROCHIP || COMPILE_TEST
196206
help
197207
Mailbox implementation for Microchip devices with an
198208
Inter-process communication (IPC) controller.

drivers/mailbox/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ obj-$(CONFIG_ARM_MHU_V2) += arm_mhuv2.o
1111

1212
obj-$(CONFIG_ARM_MHU_V3) += arm_mhuv3.o
1313

14+
obj-$(CONFIG_CV1800_MBOX) += cv1800-mailbox.o
15+
1416
obj-$(CONFIG_EXYNOS_MBOX) += exynos-mailbox.o
1517

1618
obj-$(CONFIG_IMX_MBOX) += imx-mailbox.o

0 commit comments

Comments
 (0)