Skip to content

Commit

Permalink
Merge tag 'mailbox-v6.13' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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
  • Loading branch information
Linus Torvalds committed Nov 26, 2024
2 parents 2d32fba + 7f9e19f commit 2c22dc1
Show file tree
Hide file tree
Showing 24 changed files with 874 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ properties:

reg:
oneOf:
- items:
- description: mailbox data registers
- items:
- description: mailbox control & data registers
- description: mailbox interrupt registers
Expand All @@ -23,6 +25,7 @@ properties:
- description: mailbox control registers
- description: mailbox interrupt registers
- description: mailbox data registers
deprecated: true

interrupts:
maxItems: 1
Expand All @@ -41,12 +44,12 @@ additionalProperties: false
examples:
- |
soc {
#address-cells = <2>;
#size-cells = <2>;
mbox: mailbox@37020000 {
#address-cells = <1>;
#size-cells = <1>;
mailbox@37020800 {
compatible = "microchip,mpfs-mailbox";
reg = <0x0 0x37020000 0x0 0x58>, <0x0 0x2000318C 0x0 0x40>,
<0x0 0x37020800 0x0 0x100>;
reg = <0x37020800 0x100>;
interrupt-parent = <&L1>;
interrupts = <96>;
#mbox-cells = <1>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ allOf:
- if:
properties:
compatible:
enum:
- qcom,msm8953-apcs-kpss-global
- qcom,msm8994-apcs-kpss-global
- qcom,msm8996-apcs-hmss-global
- qcom,qcm2290-apcs-hmss-global
- qcom,sdm845-apss-shared
contains:
enum:
- qcom,msm8953-apcs-kpss-global
- qcom,msm8994-apcs-kpss-global
- qcom,msm8996-apcs-hmss-global
- qcom,qcm2290-apcs-hmss-global
- qcom,sdm845-apss-shared
then:
properties:
clocks: false
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ properties:
- qcom,qdu1000-ipcc
- qcom,sa8255p-ipcc
- qcom,sa8775p-ipcc
- qcom,sar2130p-ipcc
- qcom,sc7280-ipcc
- qcom,sc8280xp-ipcc
- qcom,sdx75-ipcc
Expand All @@ -38,6 +39,7 @@ properties:
- qcom,sm8450-ipcc
- qcom,sm8550-ipcc
- qcom,sm8650-ipcc
- qcom,sm8750-ipcc
- qcom,x1e80100-ipcc
- const: qcom,ipcc

Expand Down
89 changes: 89 additions & 0 deletions Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mailbox/thead,th1520-mbox.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: T-head TH1520 Mailbox Controller

description:
The T-head mailbox controller enables communication and coordination between
cores within the SoC by passing messages (e.g., data, status, and control)
through mailbox channels. It also allows one core to signal another processor
using interrupts via the Interrupt Controller Unit (ICU).

maintainers:
- Michal Wilczynski <m.wilczynski@samsung.com>

properties:
compatible:
const: thead,th1520-mbox

clocks:
items:
- description: Clock for the local mailbox
- description: Clock for remote ICU 0
- description: Clock for remote ICU 1
- description: Clock for remote ICU 2

clock-names:
items:
- const: clk-local
- const: clk-remote-icu0
- const: clk-remote-icu1
- const: clk-remote-icu2

reg:
items:
- description: Mailbox local base address
- description: Remote ICU 0 base address
- description: Remote ICU 1 base address
- description: Remote ICU 2 base address

reg-names:
items:
- const: local
- const: remote-icu0
- const: remote-icu1
- const: remote-icu2

interrupts:
maxItems: 1

'#mbox-cells':
const: 1
description:
The one and only cell describes destination CPU ID.

required:
- compatible
- clocks
- clock-names
- reg
- reg-names
- interrupts
- '#mbox-cells'

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/thead,th1520-clk-ap.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
mailbox@ffffc38000 {
compatible = "thead,th1520-mbox";
reg = <0xff 0xffc38000 0x0 0x4000>,
<0xff 0xffc44000 0x0 0x1000>,
<0xff 0xffc4c000 0x0 0x1000>,
<0xff 0xffc54000 0x0 0x1000>;
reg-names = "local", "remote-icu0", "remote-icu1", "remote-icu2";
clocks = <&clk CLK_MBOX0>, <&clk CLK_MBOX1>, <&clk CLK_MBOX2>,
<&clk CLK_MBOX3>;
clock-names = "clk-local", "clk-remote-icu0", "clk-remote-icu1",
"clk-remote-icu2";
interrupts = <28>;
#mbox-cells = <1>;
};
};
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -20079,10 +20079,12 @@ L: linux-riscv@lists.infradead.org
S: Maintained
T: git https://github.com/pdp7/linux.git
F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml
F: Documentation/devicetree/bindings/mailbox/thead,th1520-mbox.yaml
F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml
F: arch/riscv/boot/dts/thead/
F: drivers/clk/thead/clk-th1520-ap.c
F: drivers/mailbox/mailbox-th1520.c
F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c
F: drivers/pinctrl/pinctrl-th1520.c
F: include/dt-bindings/clock/thead,th1520-clk-ap.h
Expand Down
13 changes: 12 additions & 1 deletion drivers/mailbox/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ config STI_MBOX

config TI_MESSAGE_MANAGER
tristate "Texas Instruments Message Manager Driver"
depends on ARCH_KEYSTONE || ARCH_K3
depends on ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
default ARCH_K3
help
An implementation of Message Manager slave driver for Keystone
Expand Down Expand Up @@ -168,6 +168,7 @@ config MAILBOX_TEST
config POLARFIRE_SOC_MAILBOX
tristate "PolarFire SoC (MPFS) Mailbox"
depends on HAS_IOMEM
depends on MFD_SYSCON
depends on ARCH_MICROCHIP_POLARFIRE || COMPILE_TEST
help
This driver adds support for the PolarFire SoC (MPFS) mailbox controller.
Expand Down Expand Up @@ -295,4 +296,14 @@ config QCOM_IPCC
acts as an interrupt controller for receiving interrupts from clients.
Say Y here if you want to build this driver.

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

endif
2 changes: 2 additions & 0 deletions drivers/mailbox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ obj-$(CONFIG_SPRD_MBOX) += sprd-mailbox.o
obj-$(CONFIG_QCOM_CPUCP_MBOX) += qcom-cpucp-mbox.o

obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o

obj-$(CONFIG_THEAD_TH1520_MBOX) += mailbox-th1520.o
8 changes: 4 additions & 4 deletions drivers/mailbox/arm_mhuv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static const struct mhuv2_protocol_ops mhuv2_data_transfer_ops = {
static struct mbox_chan *get_irq_chan_comb(struct mhuv2 *mhu, u32 __iomem *reg)
{
struct mbox_chan *chans = mhu->mbox.chans;
int channel = 0, i, offset = 0, windows, protocol, ch_wn;
int channel = 0, i, j, offset = 0, windows, protocol, ch_wn;
u32 stat;

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

ch_wn = i * MHUV2_STAT_BITS + __builtin_ctz(stat);

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

if (ch_wn >= offset + windows) {
if (protocol == DOORBELL)
Expand Down
2 changes: 1 addition & 1 deletion drivers/mailbox/bcm-flexrm-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ static struct platform_driver flexrm_mbox_driver = {
.of_match_table = flexrm_mbox_of_match,
},
.probe = flexrm_mbox_probe,
.remove_new = flexrm_mbox_remove,
.remove = flexrm_mbox_remove,
};
module_platform_driver(flexrm_mbox_driver);

Expand Down
2 changes: 1 addition & 1 deletion drivers/mailbox/bcm-pdc-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ static void pdc_remove(struct platform_device *pdev)

static struct platform_driver pdc_mbox_driver = {
.probe = pdc_probe,
.remove_new = pdc_remove,
.remove = pdc_remove,
.driver = {
.name = "brcm-iproc-pdc-mbox",
.of_match_table = pdc_mbox_of_match,
Expand Down
6 changes: 3 additions & 3 deletions drivers/mailbox/imx-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
cp->chan = &priv->mbox_chans[i];
priv->mbox_chans[i].con_priv = cp;
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
"%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
}

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

priv->mbox.num_chans = num_chans;
Expand Down Expand Up @@ -1120,7 +1120,7 @@ static const struct dev_pm_ops imx_mu_pm_ops = {

static struct platform_driver imx_mu_driver = {
.probe = imx_mu_probe,
.remove_new = imx_mu_remove,
.remove = imx_mu_remove,
.driver = {
.name = "imx_mu",
.of_match_table = imx_mu_dt_ids,
Expand Down
Loading

0 comments on commit 2c22dc1

Please sign in to comment.