Skip to content

Commit 2c22dc1

Browse files
committed
Merge tag 'mailbox-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox
Pull mailbox updates from Jassi Brar: "Common: - switch back from remove_new() to remove() callback imx: - fix format specifier zynqmp: - setup IPI for each child node thead: - Add th1520 driver and bindings qcom: - add SM8750 and SAR2130p compatibles - fix expected clocks for callbacks - use IRQF_NO_SUSPEND for cpucp mtk-cmdq: - switch to __pm_runtime_put_autosuspend() - fix alloc size of clocks mpfs: - fix reg properties ti-msgmgr: - don't use of_match_ptr helper - enable COMPILE_TEST build pcc: - consider the PCC_ACK_FLAG arm_mhuv2: - fix non-fatal improper reuse of variable" * tag 'mailbox-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: mailbox: pcc: Check before sending MCTP PCC response ACK mailbox: Switch back to struct platform_driver::remove() mailbox: imx: Modify the incorrect format specifier mailbox: arm_mhuv2: clean up loop in get_irq_chan_comb() mailbox: zynqmp: setup IPI for each valid child node dt-bindings: mailbox: Add thead,th1520-mailbox bindings mailbox: Introduce support for T-head TH1520 Mailbox driver mailbox: mtk-cmdq: fix wrong use of sizeof in cmdq_get_clocks() dt-bindings: mailbox: qcom-ipcc: Add SM8750 dt-bindings: mailbox: qcom,apcs-kpss-global: correct expected clocks for fallbacks dt-bindings: mailbox: qcom-ipcc: Add SAR2130P compatible mailbox: ti-msgmgr: Allow building under COMPILE_TEST mailbox: ti-msgmgr: Remove use of of_match_ptr() helper mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag mailbox: mtk-cmdq-mailbox: Switch to __pm_runtime_put_autosuspend() mailbox: mpfs: support new, syscon based, devicetree configuration dt-bindings: mailbox: mpfs: fix reg properties
2 parents 2d32fba + 7f9e19f commit 2c22dc1

24 files changed

+874
-62
lines changed

Documentation/devicetree/bindings/mailbox/microchip,mpfs-mailbox.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ properties:
1515

1616
reg:
1717
oneOf:
18+
- items:
19+
- description: mailbox data registers
1820
- items:
1921
- description: mailbox control & data registers
2022
- description: mailbox interrupt registers
@@ -23,6 +25,7 @@ properties:
2325
- description: mailbox control registers
2426
- description: mailbox interrupt registers
2527
- description: mailbox data registers
28+
deprecated: true
2629

2730
interrupts:
2831
maxItems: 1
@@ -41,12 +44,12 @@ additionalProperties: false
4144
examples:
4245
- |
4346
soc {
44-
#address-cells = <2>;
45-
#size-cells = <2>;
46-
mbox: mailbox@37020000 {
47+
#address-cells = <1>;
48+
#size-cells = <1>;
49+
50+
mailbox@37020800 {
4751
compatible = "microchip,mpfs-mailbox";
48-
reg = <0x0 0x37020000 0x0 0x58>, <0x0 0x2000318C 0x0 0x40>,
49-
<0x0 0x37020800 0x0 0x100>;
52+
reg = <0x37020800 0x100>;
5053
interrupt-parent = <&L1>;
5154
interrupts = <96>;
5255
#mbox-cells = <1>;

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ allOf:
165165
- if:
166166
properties:
167167
compatible:
168-
enum:
169-
- qcom,msm8953-apcs-kpss-global
170-
- qcom,msm8994-apcs-kpss-global
171-
- qcom,msm8996-apcs-hmss-global
172-
- qcom,qcm2290-apcs-hmss-global
173-
- qcom,sdm845-apss-shared
168+
contains:
169+
enum:
170+
- qcom,msm8953-apcs-kpss-global
171+
- qcom,msm8994-apcs-kpss-global
172+
- qcom,msm8996-apcs-hmss-global
173+
- qcom,qcm2290-apcs-hmss-global
174+
- qcom,sdm845-apss-shared
174175
then:
175176
properties:
176177
clocks: false

Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- qcom,qdu1000-ipcc
2929
- qcom,sa8255p-ipcc
3030
- qcom,sa8775p-ipcc
31+
- qcom,sar2130p-ipcc
3132
- qcom,sc7280-ipcc
3233
- qcom,sc8280xp-ipcc
3334
- qcom,sdx75-ipcc
@@ -38,6 +39,7 @@ properties:
3839
- qcom,sm8450-ipcc
3940
- qcom,sm8550-ipcc
4041
- qcom,sm8650-ipcc
42+
- qcom,sm8750-ipcc
4143
- qcom,x1e80100-ipcc
4244
- const: qcom,ipcc
4345

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mailbox/thead,th1520-mbox.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: T-head TH1520 Mailbox Controller
8+
9+
description:
10+
The T-head mailbox controller enables communication and coordination between
11+
cores within the SoC by passing messages (e.g., data, status, and control)
12+
through mailbox channels. It also allows one core to signal another processor
13+
using interrupts via the Interrupt Controller Unit (ICU).
14+
15+
maintainers:
16+
- Michal Wilczynski <[email protected]>
17+
18+
properties:
19+
compatible:
20+
const: thead,th1520-mbox
21+
22+
clocks:
23+
items:
24+
- description: Clock for the local mailbox
25+
- description: Clock for remote ICU 0
26+
- description: Clock for remote ICU 1
27+
- description: Clock for remote ICU 2
28+
29+
clock-names:
30+
items:
31+
- const: clk-local
32+
- const: clk-remote-icu0
33+
- const: clk-remote-icu1
34+
- const: clk-remote-icu2
35+
36+
reg:
37+
items:
38+
- description: Mailbox local base address
39+
- description: Remote ICU 0 base address
40+
- description: Remote ICU 1 base address
41+
- description: Remote ICU 2 base address
42+
43+
reg-names:
44+
items:
45+
- const: local
46+
- const: remote-icu0
47+
- const: remote-icu1
48+
- const: remote-icu2
49+
50+
interrupts:
51+
maxItems: 1
52+
53+
'#mbox-cells':
54+
const: 1
55+
description:
56+
The one and only cell describes destination CPU ID.
57+
58+
required:
59+
- compatible
60+
- clocks
61+
- clock-names
62+
- reg
63+
- reg-names
64+
- interrupts
65+
- '#mbox-cells'
66+
67+
additionalProperties: false
68+
69+
examples:
70+
- |
71+
#include <dt-bindings/clock/thead,th1520-clk-ap.h>
72+
soc {
73+
#address-cells = <2>;
74+
#size-cells = <2>;
75+
mailbox@ffffc38000 {
76+
compatible = "thead,th1520-mbox";
77+
reg = <0xff 0xffc38000 0x0 0x4000>,
78+
<0xff 0xffc44000 0x0 0x1000>,
79+
<0xff 0xffc4c000 0x0 0x1000>,
80+
<0xff 0xffc54000 0x0 0x1000>;
81+
reg-names = "local", "remote-icu0", "remote-icu1", "remote-icu2";
82+
clocks = <&clk CLK_MBOX0>, <&clk CLK_MBOX1>, <&clk CLK_MBOX2>,
83+
<&clk CLK_MBOX3>;
84+
clock-names = "clk-local", "clk-remote-icu0", "clk-remote-icu1",
85+
"clk-remote-icu2";
86+
interrupts = <28>;
87+
#mbox-cells = <1>;
88+
};
89+
};

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20079,10 +20079,12 @@ L: [email protected]
2007920079
S: Maintained
2008020080
T: git https://github.com/pdp7/linux.git
2008120081
F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml
20082+
F: Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml
2008220083
F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
2008320084
F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml
2008420085
F: arch/riscv/boot/dts/thead/
2008520086
F: drivers/clk/thead/clk-th1520-ap.c
20087+
F: drivers/mailbox/mailbox-th1520.c
2008620088
F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c
2008720089
F: drivers/pinctrl/pinctrl-th1520.c
2008820090
F: include/dt-bindings/clock/thead,th1520-clk-ap.h

drivers/mailbox/Kconfig

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ config STI_MBOX
127127

128128
config TI_MESSAGE_MANAGER
129129
tristate "Texas Instruments Message Manager Driver"
130-
depends on ARCH_KEYSTONE || ARCH_K3
130+
depends on ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
131131
default ARCH_K3
132132
help
133133
An implementation of Message Manager slave driver for Keystone
@@ -168,6 +168,7 @@ config MAILBOX_TEST
168168
config POLARFIRE_SOC_MAILBOX
169169
tristate "PolarFire SoC (MPFS) Mailbox"
170170
depends on HAS_IOMEM
171+
depends on MFD_SYSCON
171172
depends on ARCH_MICROCHIP_POLARFIRE || COMPILE_TEST
172173
help
173174
This driver adds support for the PolarFire SoC (MPFS) mailbox controller.
@@ -295,4 +296,14 @@ config QCOM_IPCC
295296
acts as an interrupt controller for receiving interrupts from clients.
296297
Say Y here if you want to build this driver.
297298

299+
config THEAD_TH1520_MBOX
300+
tristate "T-head TH1520 Mailbox"
301+
depends on ARCH_THEAD || COMPILE_TEST
302+
help
303+
Mailbox driver implementation for the Thead TH-1520 platform. Enables
304+
two cores within the SoC to communicate and coordinate by passing
305+
messages. Could be used to communicate between E910 core, on which the
306+
kernel is running, and E902 core used for power management among other
307+
things.
308+
298309
endif

drivers/mailbox/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ obj-$(CONFIG_SPRD_MBOX) += sprd-mailbox.o
6464
obj-$(CONFIG_QCOM_CPUCP_MBOX) += qcom-cpucp-mbox.o
6565

6666
obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o
67+
68+
obj-$(CONFIG_THEAD_TH1520_MBOX) += mailbox-th1520.o

drivers/mailbox/arm_mhuv2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static const struct mhuv2_protocol_ops mhuv2_data_transfer_ops = {
500500
static struct mbox_chan *get_irq_chan_comb(struct mhuv2 *mhu, u32 __iomem *reg)
501501
{
502502
struct mbox_chan *chans = mhu->mbox.chans;
503-
int channel = 0, i, offset = 0, windows, protocol, ch_wn;
503+
int channel = 0, i, j, offset = 0, windows, protocol, ch_wn;
504504
u32 stat;
505505

506506
for (i = 0; i < MHUV2_CMB_INT_ST_REG_CNT; i++) {
@@ -510,9 +510,9 @@ static struct mbox_chan *get_irq_chan_comb(struct mhuv2 *mhu, u32 __iomem *reg)
510510

511511
ch_wn = i * MHUV2_STAT_BITS + __builtin_ctz(stat);
512512

513-
for (i = 0; i < mhu->length; i += 2) {
514-
protocol = mhu->protocols[i];
515-
windows = mhu->protocols[i + 1];
513+
for (j = 0; j < mhu->length; j += 2) {
514+
protocol = mhu->protocols[j];
515+
windows = mhu->protocols[j + 1];
516516

517517
if (ch_wn >= offset + windows) {
518518
if (protocol == DOORBELL)

drivers/mailbox/bcm-flexrm-mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ static struct platform_driver flexrm_mbox_driver = {
16751675
.of_match_table = flexrm_mbox_of_match,
16761676
},
16771677
.probe = flexrm_mbox_probe,
1678-
.remove_new = flexrm_mbox_remove,
1678+
.remove = flexrm_mbox_remove,
16791679
};
16801680
module_platform_driver(flexrm_mbox_driver);
16811681

drivers/mailbox/bcm-pdc-mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,7 @@ static void pdc_remove(struct platform_device *pdev)
16181618

16191619
static struct platform_driver pdc_mbox_driver = {
16201620
.probe = pdc_probe,
1621-
.remove_new = pdc_remove,
1621+
.remove = pdc_remove,
16221622
.driver = {
16231623
.name = "brcm-iproc-pdc-mbox",
16241624
.of_match_table = pdc_mbox_of_match,

drivers/mailbox/imx-mailbox.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
782782
cp->chan = &priv->mbox_chans[i];
783783
priv->mbox_chans[i].con_priv = cp;
784784
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
785-
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
785+
"%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
786786
}
787787

788788
priv->mbox.num_chans = IMX_MU_CHANS;
@@ -819,7 +819,7 @@ static int imx_mu_init_specific(struct imx_mu_priv *priv)
819819
cp->chan = &priv->mbox_chans[i];
820820
priv->mbox_chans[i].con_priv = cp;
821821
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
822-
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
822+
"%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
823823
}
824824

825825
priv->mbox.num_chans = num_chans;
@@ -1120,7 +1120,7 @@ static const struct dev_pm_ops imx_mu_pm_ops = {
11201120

11211121
static struct platform_driver imx_mu_driver = {
11221122
.probe = imx_mu_probe,
1123-
.remove_new = imx_mu_remove,
1123+
.remove = imx_mu_remove,
11241124
.driver = {
11251125
.name = "imx_mu",
11261126
.of_match_table = imx_mu_dt_ids,

0 commit comments

Comments
 (0)