Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'mailbox-v5.14' of git://git.linaro.org/landing-teams/working/fujitsu/integration

Pull mailbox updates from Jassi Brar:

- imx: add support for i.MX8ULP

- mtk: code change around callback struct

- qcom: add sm6125, MSM8939 fix for channel exhaustion

- microchip: add support for polarfire controller

- misc: cosmetic changes to bcm-2835,flexrm,pdc, arm-mhu and hisilicon

* tag 'mailbox-v5.14' of git://git.linaro.org/landing-teams/working/fujitsu/integration: (26 commits)
MAINTAINERS: add entry for polarfire soc mailbox
dt-bindings: add bindings for polarfire soc system controller
mbox: add polarfire soc system controller mailbox
dt-bindings: add bindings for polarfire soc mailbox
mailbox: imx: Avoid using val uninitialized in imx_mu_isr()
mailbox: qcom: Add MSM8939 APCS support
mailbox: qcom: Use PLATFORM_DEVID_AUTO to register platform device
dt-bindings: mailbox: qcom: Add MSM8939 APCS compatible
mailbox: qcom-apcs: Add SM6125 compatible
dt-bindings: mailbox: Add binding for sm6125
mailbox: mtk-cmdq: Fix uninitialized variable in cmdq_mbox_flush()
mailbox: bcm-flexrm-mailbox: Remove redundant dev_err call in flexrm_mbox_probe()
mailbox: bcm2835: Remove redundant dev_err call in bcm2835_mbox_probe()
mailbox: qcom-ipcc: Fix IPCC mbox channel exhaustion
mailbox: mtk-cmdq: Add struct cmdq_pkt in struct cmdq_cb_data
mailbox: mtk-cmdq: Use mailbox rx_callback
mailbox: mtk-cmdq: Remove cmdq_cb_status
mailbox: imx-mailbox: support i.MX8ULP MU
mailbox: imx: add xSR/xCR register array
mailbox: imx: replace the xTR/xRR array with single register
...

+562 -102
+1
Documentation/devicetree/bindings/mailbox/fsl,mu.yaml
··· 26 26 oneOf: 27 27 - const: fsl,imx6sx-mu 28 28 - const: fsl,imx7ulp-mu 29 + - const: fsl,imx8ulp-mu 29 30 - const: fsl,imx8-mu-scu 30 31 - items: 31 32 - enum:
+47
Documentation/devicetree/bindings/mailbox/microchip,polarfire-soc-mailbox.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/mailbox/microchip,polarfire-soc-mailbox.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) mailbox controller 8 + 9 + maintainers: 10 + - Conor Dooley <conor.dooley@microchip.com> 11 + 12 + properties: 13 + compatible: 14 + const: microchip,polarfire-soc-mailbox 15 + 16 + reg: 17 + items: 18 + - description: mailbox data registers 19 + - description: mailbox interrupt registers 20 + 21 + interrupts: 22 + maxItems: 1 23 + 24 + "#mbox-cells": 25 + const: 1 26 + 27 + required: 28 + - compatible 29 + - reg 30 + - interrupts 31 + - "#mbox-cells" 32 + 33 + additionalProperties: false 34 + 35 + examples: 36 + - | 37 + soc { 38 + #address-cells = <2>; 39 + #size-cells = <2>; 40 + mbox: mailbox@37020000 { 41 + compatible = "microchip,polarfire-soc-mailbox"; 42 + reg = <0x0 0x37020000 0x0 0x1000>, <0x0 0x2000318c 0x0 0x40>; 43 + interrupt-parent = <&L1>; 44 + interrupts = <96>; 45 + #mbox-cells = <1>; 46 + }; 47 + };
+3
Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
··· 19 19 - qcom,ipq6018-apcs-apps-global 20 20 - qcom,ipq8074-apcs-apps-global 21 21 - qcom,msm8916-apcs-kpss-global 22 + - qcom,msm8939-apcs-kpss-global 22 23 - qcom,msm8994-apcs-kpss-global 23 24 - qcom,msm8996-apcs-hmss-global 24 25 - qcom,msm8998-apcs-hmss-global ··· 28 27 - qcom,sc8180x-apss-shared 29 28 - qcom,sdm660-apcs-hmss-global 30 29 - qcom,sdm845-apss-shared 30 + - qcom,sm6125-apcs-hmss-global 31 31 - qcom,sm8150-apss-shared 32 32 33 33 reg: ··· 77 75 - qcom,sc7180-apss-shared 78 76 - qcom,sdm660-apcs-hmss-global 79 77 - qcom,sdm845-apss-shared 78 + - qcom,sm6125-apcs-hmss-global 80 79 - qcom,sm8150-apss-shared 81 80 then: 82 81 properties:
+35
Documentation/devicetree/bindings/soc/microchip/microchip,polarfire-soc-sys-controller.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/soc/microchip/microchip,polarfire-soc-sys-controller.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) system controller 8 + 9 + maintainers: 10 + - Conor Dooley <conor.dooley@microchip.com> 11 + 12 + description: | 13 + The PolarFire SoC system controller is communicated with via a mailbox. 14 + This document describes the bindings for the client portion of that mailbox. 15 + 16 + 17 + properties: 18 + mboxes: 19 + maxItems: 1 20 + 21 + compatible: 22 + const: microchip,polarfire-soc-sys-controller 23 + 24 + required: 25 + - compatible 26 + - mboxes 27 + 28 + additionalProperties: false 29 + 30 + examples: 31 + - | 32 + syscontroller: syscontroller { 33 + compatible = "microchip,polarfire-soc-sys-controller"; 34 + mboxes = <&mbox 0>; 35 + };
+9
MAINTAINERS
··· 10872 10872 F: drivers/mailbox/ 10873 10873 F: include/linux/mailbox_client.h 10874 10874 F: include/linux/mailbox_controller.h 10875 + F: include/dt-bindings/mailbox/ 10875 10876 F: Documentation/devicetree/bindings/mailbox/ 10876 10877 10877 10878 MAILBOX ARM MHUv2 ··· 15728 15727 F: arch/riscv/ 15729 15728 N: riscv 15730 15729 K: riscv 15730 + 15731 + RISC-V/MICROCHIP POLARFIRE SOC SUPPORT 15732 + M: Lewis Hanly <lewis.hanly@microchip.com> 15733 + L: linux-riscv@lists.infradead.org 15734 + S: Supported 15735 + F: drivers/mailbox/mailbox-mpfs.c 15736 + F: drivers/soc/microchip/ 15737 + F: include/soc/microchip/mpfs.h 15731 15738 15732 15739 RNBD BLOCK DRIVERS 15733 15740 M: Md. Haris Iqbal <haris.iqbal@ionos.com>
+12
drivers/mailbox/Kconfig
··· 160 160 Test client to help with testing new Controller driver 161 161 implementations. 162 162 163 + config POLARFIRE_SOC_MAILBOX 164 + tristate "PolarFire SoC (MPFS) Mailbox" 165 + depends on HAS_IOMEM 166 + depends on SOC_MICROCHIP_POLARFIRE || COMPILE_TEST 167 + help 168 + This driver adds support for the PolarFire SoC (MPFS) mailbox controller. 169 + 170 + To compile this driver as a module, choose M here. the 171 + module will be called mailbox-mpfs. 172 + 173 + If unsure, say N. 174 + 163 175 config QCOM_APCS_IPC 164 176 tristate "Qualcomm APCS IPC driver" 165 177 depends on ARCH_QCOM || COMPILE_TEST
+2
drivers/mailbox/Makefile
··· 41 41 42 42 obj-$(CONFIG_BCM_FLEXRM_MBOX) += bcm-flexrm-mailbox.o 43 43 44 + obj-$(CONFIG_POLARFIRE_SOC_MAILBOX) += mailbox-mpfs.o 45 + 44 46 obj-$(CONFIG_QCOM_APCS_IPC) += qcom-apcs-ipc-mailbox.o 45 47 46 48 obj-$(CONFIG_TEGRA_HSP_MBOX) += tegra-hsp.o
+1 -3
drivers/mailbox/arm_mhu.c
··· 122 122 return -ENOMEM; 123 123 124 124 mhu->base = devm_ioremap_resource(dev, &adev->res); 125 - if (IS_ERR(mhu->base)) { 126 - dev_err(dev, "ioremap failed\n"); 125 + if (IS_ERR(mhu->base)) 127 126 return PTR_ERR(mhu->base); 128 - } 129 127 130 128 for (i = 0; i < MHU_CHANS; i++) { 131 129 mhu->chan[i].con_priv = &mhu->mlink[i];
-1
drivers/mailbox/bcm-flexrm-mailbox.c
··· 1523 1523 mbox->regs = devm_ioremap_resource(&pdev->dev, iomem); 1524 1524 if (IS_ERR(mbox->regs)) { 1525 1525 ret = PTR_ERR(mbox->regs); 1526 - dev_err(&pdev->dev, "Failed to remap mailbox regs: %d\n", ret); 1527 1526 goto fail; 1528 1527 } 1529 1528 regs_end = mbox->regs + resource_size(iomem);
-1
drivers/mailbox/bcm-pdc-mailbox.c
··· 1577 1577 pdcs->pdc_reg_vbase = devm_ioremap_resource(&pdev->dev, pdc_regs); 1578 1578 if (IS_ERR(pdcs->pdc_reg_vbase)) { 1579 1579 err = PTR_ERR(pdcs->pdc_reg_vbase); 1580 - dev_err(&pdev->dev, "Failed to map registers: %d\n", err); 1581 1580 goto cleanup_ring_pool; 1582 1581 } 1583 1582
-1
drivers/mailbox/bcm2835-mailbox.c
··· 157 157 mbox->regs = devm_ioremap_resource(&pdev->dev, iomem); 158 158 if (IS_ERR(mbox->regs)) { 159 159 ret = PTR_ERR(mbox->regs); 160 - dev_err(&pdev->dev, "Failed to remap mailbox regs: %d\n", ret); 161 160 return ret; 162 161 } 163 162
+1 -1
drivers/mailbox/hi3660-mailbox.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - // Copyright (c) 2017-2018 Hisilicon Limited. 2 + // Copyright (c) 2017-2018 HiSilicon Limited. 3 3 // Copyright (c) 2017-2018 Linaro Limited. 4 4 5 5 #include <linux/bitops.h>
+1 -1
drivers/mailbox/hi6220-mailbox.c
··· 2 2 /* 3 3 * Hisilicon's Hi6220 mailbox driver 4 4 * 5 - * Copyright (c) 2015 Hisilicon Limited. 5 + * Copyright (c) 2015 HiSilicon Limited. 6 6 * Copyright (c) 2015 Linaro Limited. 7 7 * 8 8 * Author: Leo Yan <leo.yan@linaro.org>
+125 -75
drivers/mailbox/imx-mailbox.c
··· 15 15 #include <linux/pm_runtime.h> 16 16 #include <linux/slab.h> 17 17 18 - #define IMX_MU_xSR_GIPn(x) BIT(28 + (3 - (x))) 19 - #define IMX_MU_xSR_RFn(x) BIT(24 + (3 - (x))) 20 - #define IMX_MU_xSR_TEn(x) BIT(20 + (3 - (x))) 21 - #define IMX_MU_xSR_BRDIP BIT(9) 22 - 23 - /* General Purpose Interrupt Enable */ 24 - #define IMX_MU_xCR_GIEn(x) BIT(28 + (3 - (x))) 25 - /* Receive Interrupt Enable */ 26 - #define IMX_MU_xCR_RIEn(x) BIT(24 + (3 - (x))) 27 - /* Transmit Interrupt Enable */ 28 - #define IMX_MU_xCR_TIEn(x) BIT(20 + (3 - (x))) 29 - /* General Purpose Interrupt Request */ 30 - #define IMX_MU_xCR_GIRn(x) BIT(16 + (3 - (x))) 31 - 32 18 #define IMX_MU_CHANS 16 33 19 /* TX0/RX0/RXDB[0-3] */ 34 20 #define IMX_MU_SCU_CHANS 6 ··· 25 39 IMX_MU_TYPE_RX, /* Rx */ 26 40 IMX_MU_TYPE_TXDB, /* Tx doorbell */ 27 41 IMX_MU_TYPE_RXDB, /* Rx doorbell */ 42 + }; 43 + 44 + enum imx_mu_xcr { 45 + IMX_MU_GIER, 46 + IMX_MU_GCR, 47 + IMX_MU_TCR, 48 + IMX_MU_RCR, 49 + IMX_MU_xCR_MAX, 50 + }; 51 + 52 + enum imx_mu_xsr { 53 + IMX_MU_SR, 54 + IMX_MU_GSR, 55 + IMX_MU_TSR, 56 + IMX_MU_RSR, 28 57 }; 29 58 30 59 struct imx_sc_rpc_msg_max { ··· 68 67 struct clk *clk; 69 68 int irq; 70 69 71 - u32 xcr; 70 + u32 xcr[4]; 72 71 73 72 bool side_b; 73 + }; 74 + 75 + enum imx_mu_type { 76 + IMX_MU_V1, 77 + IMX_MU_V2, 74 78 }; 75 79 76 80 struct imx_mu_dcfg { 77 81 int (*tx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp, void *data); 78 82 int (*rx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp); 79 83 void (*init)(struct imx_mu_priv *priv); 80 - u32 xTR[4]; /* Transmit Registers */ 81 - u32 xRR[4]; /* Receive Registers */ 82 - u32 xSR; /* Status Register */ 83 - u32 xCR; /* Control Register */ 84 + enum imx_mu_type type; 85 + u32 xTR; /* Transmit Register0 */ 86 + u32 xRR; /* Receive Register0 */ 87 + u32 xSR[4]; /* Status Registers */ 88 + u32 xCR[4]; /* Control Registers */ 84 89 }; 90 + 91 + #define IMX_MU_xSR_GIPn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(28 + (3 - (x)))) 92 + #define IMX_MU_xSR_RFn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(24 + (3 - (x)))) 93 + #define IMX_MU_xSR_TEn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(20 + (3 - (x)))) 94 + 95 + /* General Purpose Interrupt Enable */ 96 + #define IMX_MU_xCR_GIEn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(28 + (3 - (x)))) 97 + /* Receive Interrupt Enable */ 98 + #define IMX_MU_xCR_RIEn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(24 + (3 - (x)))) 99 + /* Transmit Interrupt Enable */ 100 + #define IMX_MU_xCR_TIEn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(20 + (3 - (x)))) 101 + /* General Purpose Interrupt Request */ 102 + #define IMX_MU_xCR_GIRn(type, x) (type == IMX_MU_V2 ? BIT(x) : BIT(16 + (3 - (x)))) 103 + 85 104 86 105 static struct imx_mu_priv *to_imx_mu_priv(struct mbox_controller *mbox) 87 106 { ··· 118 97 return ioread32(priv->base + offs); 119 98 } 120 99 121 - static u32 imx_mu_xcr_rmw(struct imx_mu_priv *priv, u32 set, u32 clr) 100 + static u32 imx_mu_xcr_rmw(struct imx_mu_priv *priv, enum imx_mu_xcr type, u32 set, u32 clr) 122 101 { 123 102 unsigned long flags; 124 103 u32 val; 125 104 126 105 spin_lock_irqsave(&priv->xcr_lock, flags); 127 - val = imx_mu_read(priv, priv->dcfg->xCR); 106 + val = imx_mu_read(priv, priv->dcfg->xCR[type]); 128 107 val &= ~clr; 129 108 val |= set; 130 - imx_mu_write(priv, val, priv->dcfg->xCR); 109 + imx_mu_write(priv, val, priv->dcfg->xCR[type]); 131 110 spin_unlock_irqrestore(&priv->xcr_lock, flags); 132 111 133 112 return val; ··· 141 120 142 121 switch (cp->type) { 143 122 case IMX_MU_TYPE_TX: 144 - imx_mu_write(priv, *arg, priv->dcfg->xTR[cp->idx]); 145 - imx_mu_xcr_rmw(priv, IMX_MU_xCR_TIEn(cp->idx), 0); 123 + imx_mu_write(priv, *arg, priv->dcfg->xTR + cp->idx * 4); 124 + imx_mu_xcr_rmw(priv, IMX_MU_TCR, IMX_MU_xCR_TIEn(priv->dcfg->type, cp->idx), 0); 146 125 break; 147 126 case IMX_MU_TYPE_TXDB: 148 - imx_mu_xcr_rmw(priv, IMX_MU_xCR_GIRn(cp->idx), 0); 127 + imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0); 149 128 tasklet_schedule(&cp->txdb_tasklet); 150 129 break; 151 130 default: ··· 161 140 { 162 141 u32 dat; 163 142 164 - dat = imx_mu_read(priv, priv->dcfg->xRR[cp->idx]); 143 + dat = imx_mu_read(priv, priv->dcfg->xRR + (cp->idx) * 4); 165 144 mbox_chan_received_data(cp->chan, (void *)&dat); 166 145 167 146 return 0; ··· 193 172 } 194 173 195 174 for (i = 0; i < 4 && i < msg->hdr.size; i++) 196 - imx_mu_write(priv, *arg++, priv->dcfg->xTR[i % 4]); 175 + imx_mu_write(priv, *arg++, priv->dcfg->xTR + (i % 4) * 4); 197 176 for (; i < msg->hdr.size; i++) { 198 - ret = readl_poll_timeout(priv->base + priv->dcfg->xSR, 177 + ret = readl_poll_timeout(priv->base + priv->dcfg->xSR[IMX_MU_TSR], 199 178 xsr, 200 - xsr & IMX_MU_xSR_TEn(i % 4), 179 + xsr & IMX_MU_xSR_TEn(priv->dcfg->type, i % 4), 201 180 0, 100); 202 181 if (ret) { 203 182 dev_err(priv->dev, "Send data index: %d timeout\n", i); 204 183 return ret; 205 184 } 206 - imx_mu_write(priv, *arg++, priv->dcfg->xTR[i % 4]); 185 + imx_mu_write(priv, *arg++, priv->dcfg->xTR + (i % 4) * 4); 207 186 } 208 187 209 - imx_mu_xcr_rmw(priv, IMX_MU_xCR_TIEn(cp->idx), 0); 188 + imx_mu_xcr_rmw(priv, IMX_MU_TCR, IMX_MU_xCR_TIEn(priv->dcfg->type, cp->idx), 0); 210 189 break; 211 190 default: 212 191 dev_warn_ratelimited(priv->dev, "Send data on wrong channel type: %d\n", cp->type); ··· 224 203 int i, ret; 225 204 u32 xsr; 226 205 227 - imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(0)); 228 - *data++ = imx_mu_read(priv, priv->dcfg->xRR[0]); 206 + imx_mu_xcr_rmw(priv, IMX_MU_RCR, 0, IMX_MU_xCR_RIEn(priv->dcfg->type, 0)); 207 + *data++ = imx_mu_read(priv, priv->dcfg->xRR); 229 208 230 209 if (msg.hdr.size > sizeof(msg) / 4) { 231 210 dev_err(priv->dev, "Maximal message size (%zu bytes) exceeded on RX; got: %i bytes\n", sizeof(msg), msg.hdr.size << 2); ··· 233 212 } 234 213 235 214 for (i = 1; i < msg.hdr.size; i++) { 236 - ret = readl_poll_timeout(priv->base + priv->dcfg->xSR, xsr, 237 - xsr & IMX_MU_xSR_RFn(i % 4), 0, 100); 215 + ret = readl_poll_timeout(priv->base + priv->dcfg->xSR[IMX_MU_RSR], xsr, 216 + xsr & IMX_MU_xSR_RFn(priv->dcfg->type, i % 4), 0, 100); 238 217 if (ret) { 239 218 dev_err(priv->dev, "timeout read idx %d\n", i); 240 219 return ret; 241 220 } 242 - *data++ = imx_mu_read(priv, priv->dcfg->xRR[i % 4]); 221 + *data++ = imx_mu_read(priv, priv->dcfg->xRR + (i % 4) * 4); 243 222 } 244 223 245 - imx_mu_xcr_rmw(priv, IMX_MU_xCR_RIEn(0), 0); 224 + imx_mu_xcr_rmw(priv, IMX_MU_RCR, IMX_MU_xCR_RIEn(priv->dcfg->type, 0), 0); 246 225 mbox_chan_received_data(cp->chan, (void *)&msg); 247 226 248 227 return 0; ··· 262 241 struct imx_mu_con_priv *cp = chan->con_priv; 263 242 u32 val, ctrl; 264 243 265 - ctrl = imx_mu_read(priv, priv->dcfg->xCR); 266 - val = imx_mu_read(priv, priv->dcfg->xSR); 267 - 268 244 switch (cp->type) { 269 245 case IMX_MU_TYPE_TX: 270 - val &= IMX_MU_xSR_TEn(cp->idx) & 271 - (ctrl & IMX_MU_xCR_TIEn(cp->idx)); 246 + ctrl = imx_mu_read(priv, priv->dcfg->xCR[IMX_MU_TCR]); 247 + val = imx_mu_read(priv, priv->dcfg->xSR[IMX_MU_TSR]); 248 + val &= IMX_MU_xSR_TEn(priv->dcfg->type, cp->idx) & 249 + (ctrl & IMX_MU_xCR_TIEn(priv->dcfg->type, cp->idx)); 272 250 break; 273 251 case IMX_MU_TYPE_RX: 274 - val &= IMX_MU_xSR_RFn(cp->idx) & 275 - (ctrl & IMX_MU_xCR_RIEn(cp->idx)); 252 + ctrl = imx_mu_read(priv, priv->dcfg->xCR[IMX_MU_RCR]); 253 + val = imx_mu_read(priv, priv->dcfg->xSR[IMX_MU_RSR]); 254 + val &= IMX_MU_xSR_RFn(priv->dcfg->type, cp->idx) & 255 + (ctrl & IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx)); 276 256 break; 277 257 case IMX_MU_TYPE_RXDB: 278 - val &= IMX_MU_xSR_GIPn(cp->idx) & 279 - (ctrl & IMX_MU_xCR_GIEn(cp->idx)); 258 + ctrl = imx_mu_read(priv, priv->dcfg->xCR[IMX_MU_GIER]); 259 + val = imx_mu_read(priv, priv->dcfg->xSR[IMX_MU_GSR]); 260 + val &= IMX_MU_xSR_GIPn(priv->dcfg->type, cp->idx) & 261 + (ctrl & IMX_MU_xCR_GIEn(priv->dcfg->type, cp->idx)); 280 262 break; 281 263 default: 282 - break; 264 + dev_warn_ratelimited(priv->dev, "Unhandled channel type %d\n", 265 + cp->type); 266 + return IRQ_NONE; 283 267 } 284 268 285 269 if (!val) 286 270 return IRQ_NONE; 287 271 288 - if (val == IMX_MU_xSR_TEn(cp->idx)) { 289 - imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx)); 272 + if ((val == IMX_MU_xSR_TEn(priv->dcfg->type, cp->idx)) && 273 + (cp->type == IMX_MU_TYPE_TX)) { 274 + imx_mu_xcr_rmw(priv, IMX_MU_TCR, 0, IMX_MU_xCR_TIEn(priv->dcfg->type, cp->idx)); 290 275 mbox_chan_txdone(chan, 0); 291 - } else if (val == IMX_MU_xSR_RFn(cp->idx)) { 276 + } else if ((val == IMX_MU_xSR_RFn(priv->dcfg->type, cp->idx)) && 277 + (cp->type == IMX_MU_TYPE_RX)) { 292 278 priv->dcfg->rx(priv, cp); 293 - } else if (val == IMX_MU_xSR_GIPn(cp->idx)) { 294 - imx_mu_write(priv, IMX_MU_xSR_GIPn(cp->idx), priv->dcfg->xSR); 279 + } else if ((val == IMX_MU_xSR_GIPn(priv->dcfg->type, cp->idx)) && 280 + (cp->type == IMX_MU_TYPE_RXDB)) { 281 + imx_mu_write(priv, IMX_MU_xSR_GIPn(priv->dcfg->type, cp->idx), 282 + priv->dcfg->xSR[IMX_MU_GSR]); 295 283 mbox_chan_received_data(chan, NULL); 296 284 } else { 297 285 dev_warn_ratelimited(priv->dev, "Not handled interrupt\n"); ··· 347 317 348 318 switch (cp->type) { 349 319 case IMX_MU_TYPE_RX: 350 - imx_mu_xcr_rmw(priv, IMX_MU_xCR_RIEn(cp->idx), 0); 320 + imx_mu_xcr_rmw(priv, IMX_MU_RCR, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx), 0); 351 321 break; 352 322 case IMX_MU_TYPE_RXDB: 353 - imx_mu_xcr_rmw(priv, IMX_MU_xCR_GIEn(cp->idx), 0); 323 + imx_mu_xcr_rmw(priv, IMX_MU_GIER, IMX_MU_xCR_GIEn(priv->dcfg->type, cp->idx), 0); 354 324 break; 355 325 default: 356 326 break; ··· 372 342 373 343 switch (cp->type) { 374 344 case IMX_MU_TYPE_TX: 375 - imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_TIEn(cp->idx)); 345 + imx_mu_xcr_rmw(priv, IMX_MU_TCR, 0, IMX_MU_xCR_TIEn(priv->dcfg->type, cp->idx)); 376 346 break; 377 347 case IMX_MU_TYPE_RX: 378 - imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_RIEn(cp->idx)); 348 + imx_mu_xcr_rmw(priv, IMX_MU_RCR, 0, IMX_MU_xCR_RIEn(priv->dcfg->type, cp->idx)); 379 349 break; 380 350 case IMX_MU_TYPE_RXDB: 381 - imx_mu_xcr_rmw(priv, 0, IMX_MU_xCR_GIEn(cp->idx)); 351 + imx_mu_xcr_rmw(priv, IMX_MU_GIER, 0, IMX_MU_xCR_GIEn(priv->dcfg->type, cp->idx)); 382 352 break; 383 353 default: 384 354 break; ··· 474 444 return; 475 445 476 446 /* Set default MU configuration */ 477 - imx_mu_write(priv, 0, priv->dcfg->xCR); 447 + for (i = 0; i < IMX_MU_xCR_MAX; i++) 448 + imx_mu_write(priv, 0, priv->dcfg->xCR[i]); 478 449 } 479 450 480 451 static void imx_mu_init_scu(struct imx_mu_priv *priv) ··· 497 466 priv->mbox.of_xlate = imx_mu_scu_xlate; 498 467 499 468 /* Set default MU configuration */ 500 - imx_mu_write(priv, 0, priv->dcfg->xCR); 469 + for (i = 0; i < IMX_MU_xCR_MAX; i++) 470 + imx_mu_write(priv, 0, priv->dcfg->xCR[i]); 501 471 } 502 472 503 473 static int imx_mu_probe(struct platform_device *pdev) ··· 596 564 .tx = imx_mu_generic_tx, 597 565 .rx = imx_mu_generic_rx, 598 566 .init = imx_mu_init_generic, 599 - .xTR = {0x0, 0x4, 0x8, 0xc}, 600 - .xRR = {0x10, 0x14, 0x18, 0x1c}, 601 - .xSR = 0x20, 602 - .xCR = 0x24, 567 + .xTR = 0x0, 568 + .xRR = 0x10, 569 + .xSR = {0x20, 0x20, 0x20, 0x20}, 570 + .xCR = {0x24, 0x24, 0x24, 0x24}, 603 571 }; 604 572 605 573 static const struct imx_mu_dcfg imx_mu_cfg_imx7ulp = { 606 574 .tx = imx_mu_generic_tx, 607 575 .rx = imx_mu_generic_rx, 608 576 .init = imx_mu_init_generic, 609 - .xTR = {0x20, 0x24, 0x28, 0x2c}, 610 - .xRR = {0x40, 0x44, 0x48, 0x4c}, 611 - .xSR = 0x60, 612 - .xCR = 0x64, 577 + .xTR = 0x20, 578 + .xRR = 0x40, 579 + .xSR = {0x60, 0x60, 0x60, 0x60}, 580 + .xCR = {0x64, 0x64, 0x64, 0x64}, 581 + }; 582 + 583 + static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = { 584 + .tx = imx_mu_generic_tx, 585 + .rx = imx_mu_generic_rx, 586 + .init = imx_mu_init_generic, 587 + .type = IMX_MU_V2, 588 + .xTR = 0x200, 589 + .xRR = 0x280, 590 + .xSR = {0xC, 0x118, 0x124, 0x12C}, 591 + .xCR = {0x110, 0x114, 0x120, 0x128}, 613 592 }; 614 593 615 594 static const struct imx_mu_dcfg imx_mu_cfg_imx8_scu = { 616 595 .tx = imx_mu_scu_tx, 617 596 .rx = imx_mu_scu_rx, 618 597 .init = imx_mu_init_scu, 619 - .xTR = {0x0, 0x4, 0x8, 0xc}, 620 - .xRR = {0x10, 0x14, 0x18, 0x1c}, 621 - .xSR = 0x20, 622 - .xCR = 0x24, 598 + .xTR = 0x0, 599 + .xRR = 0x10, 600 + .xSR = {0x20, 0x20, 0x20, 0x20}, 601 + .xCR = {0x24, 0x24, 0x24, 0x24}, 623 602 }; 624 603 625 604 static const struct of_device_id imx_mu_dt_ids[] = { 626 605 { .compatible = "fsl,imx7ulp-mu", .data = &imx_mu_cfg_imx7ulp }, 627 606 { .compatible = "fsl,imx6sx-mu", .data = &imx_mu_cfg_imx6sx }, 607 + { .compatible = "fsl,imx8ulp-mu", .data = &imx_mu_cfg_imx8ulp }, 628 608 { .compatible = "fsl,imx8-mu-scu", .data = &imx_mu_cfg_imx8_scu }, 629 609 { }, 630 610 }; ··· 645 601 static int __maybe_unused imx_mu_suspend_noirq(struct device *dev) 646 602 { 647 603 struct imx_mu_priv *priv = dev_get_drvdata(dev); 604 + int i; 648 605 649 - if (!priv->clk) 650 - priv->xcr = imx_mu_read(priv, priv->dcfg->xCR); 606 + if (!priv->clk) { 607 + for (i = 0; i < IMX_MU_xCR_MAX; i++) 608 + priv->xcr[i] = imx_mu_read(priv, priv->dcfg->xCR[i]); 609 + } 651 610 652 611 return 0; 653 612 } ··· 658 611 static int __maybe_unused imx_mu_resume_noirq(struct device *dev) 659 612 { 660 613 struct imx_mu_priv *priv = dev_get_drvdata(dev); 614 + int i; 661 615 662 616 /* 663 617 * ONLY restore MU when context lost, the TIE could ··· 668 620 * send failed, may lead to system freeze. This issue 669 621 * is observed by testing freeze mode suspend. 670 622 */ 671 - if (!imx_mu_read(priv, priv->dcfg->xCR) && !priv->clk) 672 - imx_mu_write(priv, priv->xcr, priv->dcfg->xCR); 623 + if (!imx_mu_read(priv, priv->dcfg->xCR[0]) && !priv->clk) { 624 + for (i = 0; i < IMX_MU_xCR_MAX; i++) 625 + imx_mu_write(priv, priv->xcr[i], priv->dcfg->xCR[i]); 626 + } 673 627 674 628 return 0; 675 629 }
+251
drivers/mailbox/mailbox-mpfs.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Microchip PolarFire SoC (MPFS) system controller/mailbox controller driver 4 + * 5 + * Copyright (c) 2020 Microchip Corporation. All rights reserved. 6 + * 7 + * Author: Conor Dooley <conor.dooley@microchip.com> 8 + * 9 + */ 10 + 11 + #include <linux/io.h> 12 + #include <linux/err.h> 13 + #include <linux/init.h> 14 + #include <linux/module.h> 15 + #include <linux/kernel.h> 16 + #include <linux/interrupt.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/mailbox_controller.h> 19 + #include <soc/microchip/mpfs.h> 20 + 21 + #define SERVICES_CR_OFFSET 0x50u 22 + #define SERVICES_SR_OFFSET 0x54u 23 + #define MAILBOX_REG_OFFSET 0x800u 24 + #define MSS_SYS_MAILBOX_DATA_OFFSET 0u 25 + #define SCB_MASK_WIDTH 16u 26 + 27 + /* SCBCTRL service control register */ 28 + 29 + #define SCB_CTRL_REQ (0) 30 + #define SCB_CTRL_REQ_MASK BIT(SCB_CTRL_REQ) 31 + 32 + #define SCB_CTRL_BUSY (1) 33 + #define SCB_CTRL_BUSY_MASK BIT(SCB_CTRL_BUSY) 34 + 35 + #define SCB_CTRL_ABORT (2) 36 + #define SCB_CTRL_ABORT_MASK BIT(SCB_CTRL_ABORT) 37 + 38 + #define SCB_CTRL_NOTIFY (3) 39 + #define SCB_CTRL_NOTIFY_MASK BIT(SCB_CTRL_NOTIFY) 40 + 41 + #define SCB_CTRL_POS (16) 42 + #define SCB_CTRL_MASK GENMASK_ULL(SCB_CTRL_POS + SCB_MASK_WIDTH, SCB_CTRL_POS) 43 + 44 + /* SCBCTRL service status register */ 45 + 46 + #define SCB_STATUS_REQ (0) 47 + #define SCB_STATUS_REQ_MASK BIT(SCB_STATUS_REQ) 48 + 49 + #define SCB_STATUS_BUSY (1) 50 + #define SCB_STATUS_BUSY_MASK BIT(SCB_STATUS_BUSY) 51 + 52 + #define SCB_STATUS_ABORT (2) 53 + #define SCB_STATUS_ABORT_MASK BIT(SCB_STATUS_ABORT) 54 + 55 + #define SCB_STATUS_NOTIFY (3) 56 + #define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY) 57 + 58 + #define SCB_STATUS_POS (16) 59 + #define SCB_STATUS_MASK GENMASK_ULL(SCB_STATUS_POS + SCB_MASK_WIDTH, SCB_STATUS_POS) 60 + 61 + struct mpfs_mbox { 62 + struct mbox_controller controller; 63 + struct device *dev; 64 + int irq; 65 + void __iomem *mbox_base; 66 + void __iomem *int_reg; 67 + struct mbox_chan chans[1]; 68 + struct mpfs_mss_response *response; 69 + u16 resp_offset; 70 + }; 71 + 72 + static bool mpfs_mbox_busy(struct mpfs_mbox *mbox) 73 + { 74 + u32 status; 75 + 76 + status = readl_relaxed(mbox->mbox_base + SERVICES_SR_OFFSET); 77 + 78 + return status & SCB_STATUS_BUSY_MASK; 79 + } 80 + 81 + static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data) 82 + { 83 + struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; 84 + struct mpfs_mss_msg *msg = data; 85 + u32 tx_trigger; 86 + u16 opt_sel; 87 + u32 val = 0u; 88 + 89 + mbox->response = msg->response; 90 + mbox->resp_offset = msg->resp_offset; 91 + 92 + if (mpfs_mbox_busy(mbox)) 93 + return -EBUSY; 94 + 95 + if (msg->cmd_data_size) { 96 + u32 index; 97 + u8 extra_bits = msg->cmd_data_size & 3; 98 + u32 *word_buf = (u32 *)msg->cmd_data; 99 + 100 + for (index = 0; index < (msg->cmd_data_size / 4); index++) 101 + writel_relaxed(word_buf[index], 102 + mbox->mbox_base + MAILBOX_REG_OFFSET + index * 0x4); 103 + if (extra_bits) { 104 + u8 i; 105 + u8 byte_off = ALIGN_DOWN(msg->cmd_data_size, 4); 106 + u8 *byte_buf = msg->cmd_data + byte_off; 107 + 108 + val = readl_relaxed(mbox->mbox_base + 109 + MAILBOX_REG_OFFSET + index * 0x4); 110 + 111 + for (i = 0u; i < extra_bits; i++) { 112 + val &= ~(0xffu << (i * 8u)); 113 + val |= (byte_buf[i] << (i * 8u)); 114 + } 115 + 116 + writel_relaxed(val, 117 + mbox->mbox_base + MAILBOX_REG_OFFSET + index * 0x4); 118 + } 119 + } 120 + 121 + opt_sel = ((msg->mbox_offset << 7u) | (msg->cmd_opcode & 0x7fu)); 122 + tx_trigger = (opt_sel << SCB_CTRL_POS) & SCB_CTRL_MASK; 123 + tx_trigger |= SCB_CTRL_REQ_MASK | SCB_STATUS_NOTIFY_MASK; 124 + writel_relaxed(tx_trigger, mbox->mbox_base + SERVICES_CR_OFFSET); 125 + 126 + return 0; 127 + } 128 + 129 + static void mpfs_mbox_rx_data(struct mbox_chan *chan) 130 + { 131 + struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; 132 + struct mpfs_mss_response *response = mbox->response; 133 + u16 num_words = ALIGN((response->resp_size), (4)) / 4U; 134 + u32 i; 135 + 136 + if (!response->resp_msg) { 137 + dev_err(mbox->dev, "failed to assign memory for response %d\n", -ENOMEM); 138 + return; 139 + } 140 + 141 + if (!mpfs_mbox_busy(mbox)) { 142 + for (i = 0; i < num_words; i++) { 143 + response->resp_msg[i] = 144 + readl_relaxed(mbox->mbox_base + MAILBOX_REG_OFFSET 145 + + mbox->resp_offset + i * 0x4); 146 + } 147 + } 148 + 149 + mbox_chan_received_data(chan, response); 150 + } 151 + 152 + static irqreturn_t mpfs_mbox_inbox_isr(int irq, void *data) 153 + { 154 + struct mbox_chan *chan = data; 155 + struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; 156 + 157 + writel_relaxed(0, mbox->int_reg); 158 + 159 + mpfs_mbox_rx_data(chan); 160 + 161 + mbox_chan_txdone(chan, 0); 162 + return IRQ_HANDLED; 163 + } 164 + 165 + static int mpfs_mbox_startup(struct mbox_chan *chan) 166 + { 167 + struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; 168 + int ret = 0; 169 + 170 + if (!mbox) 171 + return -EINVAL; 172 + 173 + ret = devm_request_irq(mbox->dev, mbox->irq, mpfs_mbox_inbox_isr, 0, "mpfs-mailbox", chan); 174 + if (ret) 175 + dev_err(mbox->dev, "failed to register mailbox interrupt:%d\n", ret); 176 + 177 + return ret; 178 + } 179 + 180 + static void mpfs_mbox_shutdown(struct mbox_chan *chan) 181 + { 182 + struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; 183 + 184 + devm_free_irq(mbox->dev, mbox->irq, chan); 185 + } 186 + 187 + static const struct mbox_chan_ops mpfs_mbox_ops = { 188 + .send_data = mpfs_mbox_send_data, 189 + .startup = mpfs_mbox_startup, 190 + .shutdown = mpfs_mbox_shutdown, 191 + }; 192 + 193 + static int mpfs_mbox_probe(struct platform_device *pdev) 194 + { 195 + struct mpfs_mbox *mbox; 196 + struct resource *regs; 197 + int ret; 198 + 199 + mbox = devm_kzalloc(&pdev->dev, sizeof(*mbox), GFP_KERNEL); 200 + if (!mbox) 201 + return -ENOMEM; 202 + 203 + mbox->mbox_base = devm_platform_get_and_ioremap_resource(pdev, 0, &regs); 204 + if (IS_ERR(mbox->mbox_base)) 205 + return PTR_ERR(mbox->mbox_base); 206 + 207 + mbox->int_reg = devm_platform_get_and_ioremap_resource(pdev, 1, &regs); 208 + if (IS_ERR(mbox->int_reg)) 209 + return PTR_ERR(mbox->int_reg); 210 + 211 + mbox->irq = platform_get_irq(pdev, 0); 212 + if (mbox->irq < 0) 213 + return mbox->irq; 214 + 215 + mbox->dev = &pdev->dev; 216 + 217 + mbox->chans[0].con_priv = mbox; 218 + mbox->controller.dev = mbox->dev; 219 + mbox->controller.num_chans = 1; 220 + mbox->controller.chans = mbox->chans; 221 + mbox->controller.ops = &mpfs_mbox_ops; 222 + mbox->controller.txdone_irq = true; 223 + 224 + ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller); 225 + if (ret) { 226 + dev_err(&pdev->dev, "Registering MPFS mailbox controller failed\n"); 227 + return ret; 228 + } 229 + dev_info(&pdev->dev, "Registered MPFS mailbox controller driver\n"); 230 + 231 + return 0; 232 + } 233 + 234 + static const struct of_device_id mpfs_mbox_of_match[] = { 235 + {.compatible = "microchip,polarfire-soc-mailbox", }, 236 + {}, 237 + }; 238 + MODULE_DEVICE_TABLE(of, mpfs_mbox_of_match); 239 + 240 + static struct platform_driver mpfs_mbox_driver = { 241 + .driver = { 242 + .name = "mpfs-mailbox", 243 + .of_match_table = mpfs_mbox_of_match, 244 + }, 245 + .probe = mpfs_mbox_probe, 246 + }; 247 + module_platform_driver(mpfs_mbox_driver); 248 + 249 + MODULE_LICENSE("GPL v2"); 250 + MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>"); 251 + MODULE_DESCRIPTION("MPFS mailbox controller driver");
+16 -12
drivers/mailbox/mtk-cmdq-mailbox.c
··· 180 180 return readl(thread->base + CMDQ_THR_WAIT_TOKEN) & CMDQ_THR_IS_WAITING; 181 181 } 182 182 183 - static void cmdq_task_exec_done(struct cmdq_task *task, enum cmdq_cb_status sta) 183 + static void cmdq_task_exec_done(struct cmdq_task *task, int sta) 184 184 { 185 185 struct cmdq_task_cb *cb = &task->pkt->async_cb; 186 186 struct cmdq_cb_data data; ··· 188 188 WARN_ON(cb->cb == (cmdq_async_flush_cb)NULL); 189 189 data.sta = sta; 190 190 data.data = cb->data; 191 - cb->cb(data); 191 + data.pkt = task->pkt; 192 + if (cb->cb) 193 + cb->cb(data); 194 + 195 + mbox_chan_received_data(task->thread->chan, &data); 192 196 193 197 list_del(&task->list_entry); 194 198 } ··· 248 244 curr_task = task; 249 245 250 246 if (!curr_task || curr_pa == task_end_pa - CMDQ_INST_SIZE) { 251 - cmdq_task_exec_done(task, CMDQ_CB_NORMAL); 247 + cmdq_task_exec_done(task, 0); 252 248 kfree(task); 253 249 } else if (err) { 254 - cmdq_task_exec_done(task, CMDQ_CB_ERROR); 250 + cmdq_task_exec_done(task, -ENOEXEC); 255 251 cmdq_task_handle_error(curr_task); 256 252 kfree(task); 257 253 } ··· 419 415 420 416 list_for_each_entry_safe(task, tmp, &thread->task_busy_list, 421 417 list_entry) { 422 - cmdq_task_exec_done(task, CMDQ_CB_ERROR); 418 + cmdq_task_exec_done(task, -ECONNABORTED); 423 419 kfree(task); 424 420 } 425 421 ··· 456 452 list_for_each_entry_safe(task, tmp, &thread->task_busy_list, 457 453 list_entry) { 458 454 cb = &task->pkt->async_cb; 459 - if (cb->cb) { 460 - data.sta = CMDQ_CB_ERROR; 461 - data.data = cb->data; 455 + data.sta = -ECONNABORTED; 456 + data.data = cb->data; 457 + data.pkt = task->pkt; 458 + if (cb->cb) 462 459 cb->cb(data); 463 - } 460 + 461 + mbox_chan_received_data(task->thread->chan, &data); 464 462 list_del(&task->list_entry); 465 463 kfree(task); 466 464 } ··· 525 519 526 520 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 527 521 cmdq->base = devm_ioremap_resource(dev, res); 528 - if (IS_ERR(cmdq->base)) { 529 - dev_err(dev, "failed to ioremap gce\n"); 522 + if (IS_ERR(cmdq->base)) 530 523 return PTR_ERR(cmdq->base); 531 - } 532 524 533 525 cmdq->irq = platform_get_irq(pdev, 0); 534 526 if (cmdq->irq < 0)
+7 -1
drivers/mailbox/qcom-apcs-ipc-mailbox.c
··· 57 57 .offset = 8, .clk_name = NULL 58 58 }; 59 59 60 + static const struct qcom_apcs_ipc_data sm6125_apcs_data = { 61 + .offset = 8, .clk_name = NULL 62 + }; 63 + 60 64 static const struct qcom_apcs_ipc_data apps_shared_apcs_data = { 61 65 .offset = 12, .clk_name = NULL 62 66 }; ··· 136 132 if (apcs_data->clk_name) { 137 133 apcs->clk = platform_device_register_data(&pdev->dev, 138 134 apcs_data->clk_name, 139 - PLATFORM_DEVID_NONE, 135 + PLATFORM_DEVID_AUTO, 140 136 NULL, 0); 141 137 if (IS_ERR(apcs->clk)) 142 138 dev_err(&pdev->dev, "failed to register APCS clk\n"); ··· 162 158 { .compatible = "qcom,ipq6018-apcs-apps-global", .data = &ipq6018_apcs_data }, 163 159 { .compatible = "qcom,ipq8074-apcs-apps-global", .data = &ipq8074_apcs_data }, 164 160 { .compatible = "qcom,msm8916-apcs-kpss-global", .data = &msm8916_apcs_data }, 161 + { .compatible = "qcom,msm8939-apcs-kpss-global", .data = &msm8916_apcs_data }, 165 162 { .compatible = "qcom,msm8994-apcs-kpss-global", .data = &msm8994_apcs_data }, 166 163 { .compatible = "qcom,msm8996-apcs-hmss-global", .data = &msm8996_apcs_data }, 167 164 { .compatible = "qcom,msm8998-apcs-hmss-global", .data = &msm8998_apcs_data }, ··· 171 166 { .compatible = "qcom,sc8180x-apss-shared", .data = &apps_shared_apcs_data }, 172 167 { .compatible = "qcom,sdm660-apcs-hmss-global", .data = &sdm660_apcs_data }, 173 168 { .compatible = "qcom,sdm845-apss-shared", .data = &apps_shared_apcs_data }, 169 + { .compatible = "qcom,sm6125-apcs-hmss-global", .data = &sm6125_apcs_data }, 174 170 { .compatible = "qcom,sm8150-apss-shared", .data = &apps_shared_apcs_data }, 175 171 { .compatible = "qcom,sdx55-apcs-gcc", .data = &sdx55_apcs_data }, 176 172 {}
+6
drivers/mailbox/qcom-ipcc.c
··· 155 155 return 0; 156 156 } 157 157 158 + static void qcom_ipcc_mbox_shutdown(struct mbox_chan *chan) 159 + { 160 + chan->con_priv = NULL; 161 + } 162 + 158 163 static struct mbox_chan *qcom_ipcc_mbox_xlate(struct mbox_controller *mbox, 159 164 const struct of_phandle_args *ph) 160 165 { ··· 189 184 190 185 static const struct mbox_chan_ops ipcc_mbox_chan_ops = { 191 186 .send_data = qcom_ipcc_mbox_send_data, 187 + .shutdown = qcom_ipcc_mbox_shutdown, 192 188 }; 193 189 194 190 static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc)
+2 -6
include/linux/mailbox/mtk-cmdq-mailbox.h
··· 65 65 CMDQ_CODE_LOGIC = 0xa0, 66 66 }; 67 67 68 - enum cmdq_cb_status { 69 - CMDQ_CB_NORMAL = 0, 70 - CMDQ_CB_ERROR 71 - }; 72 - 73 68 struct cmdq_cb_data { 74 - enum cmdq_cb_status sta; 69 + int sta; 75 70 void *data; 71 + struct cmdq_pkt *pkt; 76 72 }; 77 73 78 74 typedef void (*cmdq_async_flush_cb)(struct cmdq_cb_data data);
+43
include/soc/microchip/mpfs.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * 4 + * Microchip PolarFire SoC (MPFS) 5 + * 6 + * Copyright (c) 2020 Microchip Corporation. All rights reserved. 7 + * 8 + * Author: Conor Dooley <conor.dooley@microchip.com> 9 + * 10 + */ 11 + 12 + #ifndef __SOC_MPFS_H__ 13 + #define __SOC_MPFS_H__ 14 + 15 + #include <linux/types.h> 16 + #include <linux/of_device.h> 17 + 18 + struct mpfs_sys_controller; 19 + 20 + struct mpfs_mss_msg { 21 + u8 cmd_opcode; 22 + u16 cmd_data_size; 23 + struct mpfs_mss_response *response; 24 + u8 *cmd_data; 25 + u16 mbox_offset; 26 + u16 resp_offset; 27 + }; 28 + 29 + struct mpfs_mss_response { 30 + u32 resp_status; 31 + u32 *resp_msg; 32 + u16 resp_size; 33 + }; 34 + 35 + #if IS_ENABLED(CONFIG_POLARFIRE_SOC_SYS_CTRL) 36 + 37 + int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg); 38 + 39 + struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node); 40 + 41 + #endif /* if IS_ENABLED(CONFIG_POLARFIRE_SOC_SYS_CTRL) */ 42 + 43 + #endif /* __SOC_MPFS_H__ */