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

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

Pull mailbox updates from Jassi Brar:
"qcom:
- enable support for SM8350 and SC7280

sprd:
- refcount channel usage
- specify interrupt names in dt
- support sc9863a

arm:
- drop redundant print

ti:
- convert dt-bindings to json schema

and misc spelling fixes"

* tag 'mailbox-v5.13' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
dt-bindings: mailbox: qcom-ipcc: Add compatible for SC7280
dt-bindings: mailbox: ti,secure-proxy: Convert to json schema
mailbox: arm_mhu_db: Remove redundant dev_err call in mhu_db_probe()
mailbox: sprd: Add supplementary inbox support
dt-bindings: mailbox: Add interrupt-names to SPRD mailbox
mailbox: sprd: Introduce refcnt when clients requests/free channels
MAINTAINERS: Add DT bindings directory to mailbox
mailbox: fix various typos in comments
mailbox: pcc: fix platform_no_drv_owner.cocci warnings
dt-bindings: mailbox: Add compatible for SM8350 IPCC

+210 -103
+2
Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml
··· 25 25 items: 26 26 - enum: 27 27 - qcom,sm8250-ipcc 28 + - qcom,sm8350-ipcc 29 + - qcom,sc7280-ipcc 28 30 - const: qcom,ipcc 29 31 30 32 reg:
+11 -2
Documentation/devicetree/bindings/mailbox/sprd-mailbox.yaml
··· 15 15 compatible: 16 16 enum: 17 17 - sprd,sc9860-mailbox 18 + - sprd,sc9863a-mailbox 18 19 19 20 reg: 20 21 items: ··· 23 22 - description: outbox registers' base address 24 23 25 24 interrupts: 25 + minItems: 2 26 + maxItems: 3 27 + 28 + interrupt-names: 29 + minItems: 2 26 30 items: 27 - - description: inbox interrupt 28 - - description: outbox interrupt 31 + - const: inbox 32 + - const: outbox 33 + - const: supp-outbox 29 34 30 35 clocks: 31 36 maxItems: 1 ··· 47 40 - compatible 48 41 - reg 49 42 - interrupts 43 + - interrupt-names 50 44 - "#mbox-cells" 51 45 - clocks 52 46 - clock-names ··· 64 56 clock-names = "enable"; 65 57 clocks = <&aon_gate 53>; 66 58 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; 59 + interrupt-names = "inbox", "outbox"; 67 60 }; 68 61 ...
-50
Documentation/devicetree/bindings/mailbox/ti,secure-proxy.txt
··· 1 - Texas Instruments' Secure Proxy 2 - ======================================== 3 - 4 - The Texas Instruments' secure proxy is a mailbox controller that has 5 - configurable queues selectable at SoC(System on Chip) integration. The 6 - Message manager is broken up into different address regions that are 7 - called "threads" or "proxies" - each instance is unidirectional and is 8 - instantiated at SoC integration level by system controller to indicate 9 - receive or transmit path. 10 - 11 - Message Manager Device Node: 12 - =========================== 13 - Required properties: 14 - -------------------- 15 - - compatible: Shall be "ti,am654-secure-proxy" 16 - - reg-names target_data - Map the proxy data region 17 - rt - Map the realtime status region 18 - scfg - Map the configuration region 19 - - reg: Contains the register map per reg-names. 20 - - #mbox-cells Shall be 1 and shall refer to the transfer path 21 - called thread. 22 - - interrupt-names: Contains interrupt names matching the rx transfer path 23 - for a given SoC. Receive interrupts shall be of the 24 - format: "rx_<PID>". 25 - - interrupts: Contains the interrupt information corresponding to 26 - interrupt-names property. 27 - 28 - Example(AM654): 29 - ------------ 30 - 31 - secure_proxy: mailbox@32c00000 { 32 - compatible = "ti,am654-secure-proxy"; 33 - #mbox-cells = <1>; 34 - reg-names = "target_data", "rt", "scfg"; 35 - reg = <0x0 0x32c00000 0x0 0x100000>, 36 - <0x0 0x32400000 0x0 0x100000>, 37 - <0x0 0x32800000 0x0 0x100000>; 38 - interrupt-names = "rx_011"; 39 - interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; 40 - }; 41 - 42 - dmsc: dmsc { 43 - [...] 44 - mbox-names = "rx", "tx"; 45 - # RX Thread ID is 11 46 - # TX Thread ID is 13 47 - mboxes= <&secure_proxy 11>, 48 - <&secure_proxy 13>; 49 - [...] 50 - };
+79
Documentation/devicetree/bindings/mailbox/ti,secure-proxy.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/ti,secure-proxy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments' Secure Proxy 8 + 9 + maintainers: 10 + - Nishanth Menon <nm@ti.com> 11 + 12 + description: | 13 + The Texas Instruments' secure proxy is a mailbox controller that has 14 + configurable queues selectable at SoC(System on Chip) integration. The 15 + Message manager is broken up into different address regions that are 16 + called "threads" or "proxies" - each instance is unidirectional and is 17 + instantiated at SoC integration level by system controller to indicate 18 + receive or transmit path. 19 + 20 + properties: 21 + $nodename: 22 + pattern: "^mailbox@[0-9a-f]+$" 23 + 24 + compatible: 25 + const: ti,am654-secure-proxy 26 + 27 + "#mbox-cells": 28 + const: 1 29 + description: 30 + Contains the secure proxy thread ID used for the specific transfer path. 31 + 32 + reg-names: 33 + items: 34 + - const: target_data 35 + - const: rt 36 + - const: scfg 37 + 38 + reg: 39 + minItems: 3 40 + 41 + interrupt-names: 42 + minItems: 1 43 + maxItems: 100 44 + items: 45 + pattern: "^rx_[0-9]{3}$" 46 + description: 47 + Contains the interrupt name information for the Rx interrupt path for 48 + secure proxy thread in the form 'rx_<PID>'. 49 + 50 + interrupts: 51 + minItems: 1 52 + maxItems: 100 53 + description: 54 + Contains the interrupt information for the Rx interrupt path for secure 55 + proxy. 56 + 57 + required: 58 + - compatible 59 + - reg-names 60 + - reg 61 + - interrupt-names 62 + - interrupts 63 + - "#mbox-cells" 64 + 65 + additionalProperties: false 66 + 67 + examples: 68 + - | 69 + #include <dt-bindings/interrupt-controller/arm-gic.h> 70 + secure_proxy: mailbox@32c00000 { 71 + compatible = "ti,am654-secure-proxy"; 72 + #mbox-cells = <1>; 73 + reg-names = "target_data", "rt", "scfg"; 74 + reg = <0x32c00000 0x100000>, 75 + <0x32400000 0x100000>, 76 + <0x32800000 0x100000>; 77 + interrupt-names = "rx_011"; 78 + interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; 79 + };
+1
MAINTAINERS
··· 10772 10772 F: drivers/mailbox/ 10773 10773 F: include/linux/mailbox_client.h 10774 10774 F: include/linux/mailbox_controller.h 10775 + F: Documentation/devicetree/bindings/mailbox/ 10775 10776 10776 10777 MAILBOX ARM MHUv2 10777 10778 M: Viresh Kumar <viresh.kumar@linaro.org>
+1 -1
drivers/mailbox/Kconfig
··· 78 78 module parameter). 79 79 80 80 config ROCKCHIP_MBOX 81 - bool "Rockchip Soc Intergrated Mailbox Support" 81 + bool "Rockchip Soc Integrated Mailbox Support" 82 82 depends on ARCH_ROCKCHIP || COMPILE_TEST 83 83 help 84 84 This driver provides support for inter-processor communication
+1 -3
drivers/mailbox/arm_mhu_db.c
··· 278 278 return -ENOMEM; 279 279 280 280 mhu->base = devm_ioremap_resource(dev, &adev->res); 281 - if (IS_ERR(mhu->base)) { 282 - dev_err(dev, "ioremap failed\n"); 281 + if (IS_ERR(mhu->base)) 283 282 return PTR_ERR(mhu->base); 284 - } 285 283 286 284 chans = devm_kcalloc(dev, max_chans, sizeof(*chans), GFP_KERNEL); 287 285 if (!chans)
+2 -2
drivers/mailbox/bcm-flexrm-mailbox.c
··· 423 423 * 424 424 * In general use, number of non-HEADER descriptors can easily go 425 425 * beyond 31. To tackle this situation, we have packet (or request) 426 - * extenstion bits (STARTPKT and ENDPKT) in the HEADER descriptor. 426 + * extension bits (STARTPKT and ENDPKT) in the HEADER descriptor. 427 427 * 428 428 * To use packet extension, the first HEADER descriptor of request 429 429 * (or packet) will have STARTPKT=1 and ENDPKT=0. The intermediate ··· 1095 1095 /* 1096 1096 * Get current completion read and write offset 1097 1097 * 1098 - * Note: We should read completion write pointer atleast once 1098 + * Note: We should read completion write pointer at least once 1099 1099 * after we get a MSI interrupt because HW maintains internal 1100 1100 * MSI status which will allow next MSI interrupt only after 1101 1101 * completion write pointer is read.
+3 -3
drivers/mailbox/mailbox-xgene-slimpro.c
··· 51 51 /** 52 52 * X-Gene SlimPRO Mailbox controller data 53 53 * 54 - * X-Gene SlimPRO Mailbox controller has 8 commnunication channels. 55 - * Each channel has a separate IRQ number assgined to it. 54 + * X-Gene SlimPRO Mailbox controller has 8 communication channels. 55 + * Each channel has a separate IRQ number assigned to it. 56 56 * 57 - * @mb_ctrl: Representation of the commnunication channel controller 57 + * @mb_ctrl: Representation of the communication channel controller 58 58 * @mc: Array of SlimPRO mailbox channels of the controller 59 59 * @chans: Array of mailbox communication channels 60 60 *
+1 -1
drivers/mailbox/mailbox.h
··· 5 5 6 6 #define TXDONE_BY_IRQ BIT(0) /* controller has remote RTR irq */ 7 7 #define TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */ 8 - #define TXDONE_BY_ACK BIT(2) /* S/W ACK recevied by Client ticks the TX */ 8 + #define TXDONE_BY_ACK BIT(2) /* S/W ACK received by Client ticks the TX */ 9 9 10 10 #endif /* __MAILBOX_H */
+1 -2
drivers/mailbox/pcc.c
··· 32 32 * * Client writes WRITE cmd in communication region cmd address. 33 33 * * Client issues mbox_send_message() which rings the PCC doorbell 34 34 * for its PCC channel. 35 - * * If command completes, then writes have succeded and it can release 35 + * * If command completes, then writes have succeeded and it can release 36 36 * the channel lock. 37 37 * 38 38 * There is a Nominal latency defined for each channel which indicates ··· 577 577 .probe = pcc_mbox_probe, 578 578 .driver = { 579 579 .name = "PCCT", 580 - .owner = THIS_MODULE, 581 580 }, 582 581 }; 583 582
+1 -1
drivers/mailbox/pl320-ipc.c
··· 73 73 return data[1]; 74 74 } 75 75 76 - /* blocking implmentation from the A9 side, not usuable in interrupts! */ 76 + /* blocking implementation from the A9 side, not usable in interrupts! */ 77 77 int pl320_ipc_transmit(u32 *data) 78 78 { 79 79 int ret;
+106 -37
drivers/mailbox/sprd-mailbox.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/mailbox_controller.h> 13 13 #include <linux/module.h> 14 + #include <linux/of_device.h> 14 15 #include <linux/platform_device.h> 15 16 #include <linux/clk.h> 16 17 ··· 26 25 #define SPRD_MBOX_LOCK 0x20 27 26 #define SPRD_MBOX_FIFO_DEPTH 0x24 28 27 29 - /* Bit and mask definiation for inbox's SPRD_MBOX_FIFO_STS register */ 28 + /* Bit and mask definition for inbox's SPRD_MBOX_FIFO_STS register */ 30 29 #define SPRD_INBOX_FIFO_DELIVER_MASK GENMASK(23, 16) 31 30 #define SPRD_INBOX_FIFO_OVERLOW_MASK GENMASK(15, 8) 32 31 #define SPRD_INBOX_FIFO_DELIVER_SHIFT 16 33 32 #define SPRD_INBOX_FIFO_BUSY_MASK GENMASK(7, 0) 34 33 35 - /* Bit and mask definiation for SPRD_MBOX_IRQ_STS register */ 34 + /* Bit and mask definition for SPRD_MBOX_IRQ_STS register */ 36 35 #define SPRD_MBOX_IRQ_CLR BIT(0) 37 36 38 - /* Bit and mask definiation for outbox's SPRD_MBOX_FIFO_STS register */ 37 + /* Bit and mask definition for outbox's SPRD_MBOX_FIFO_STS register */ 39 38 #define SPRD_OUTBOX_FIFO_FULL BIT(2) 40 39 #define SPRD_OUTBOX_FIFO_WR_SHIFT 16 41 40 #define SPRD_OUTBOX_FIFO_RD_SHIFT 24 42 41 #define SPRD_OUTBOX_FIFO_POS_MASK GENMASK(7, 0) 43 42 44 - /* Bit and mask definiation for inbox's SPRD_MBOX_IRQ_MSK register */ 43 + /* Bit and mask definition for inbox's SPRD_MBOX_IRQ_MSK register */ 45 44 #define SPRD_INBOX_FIFO_BLOCK_IRQ BIT(0) 46 45 #define SPRD_INBOX_FIFO_OVERFLOW_IRQ BIT(1) 47 46 #define SPRD_INBOX_FIFO_DELIVER_IRQ BIT(2) 48 47 #define SPRD_INBOX_FIFO_IRQ_MASK GENMASK(2, 0) 49 48 50 - /* Bit and mask definiation for outbox's SPRD_MBOX_IRQ_MSK register */ 49 + /* Bit and mask definition for outbox's SPRD_MBOX_IRQ_MSK register */ 51 50 #define SPRD_OUTBOX_FIFO_NOT_EMPTY_IRQ BIT(0) 52 51 #define SPRD_OUTBOX_FIFO_IRQ_MASK GENMASK(4, 0) 53 52 53 + #define SPRD_OUTBOX_BASE_SPAN 0x1000 54 54 #define SPRD_MBOX_CHAN_MAX 8 55 + #define SPRD_SUPP_INBOX_ID_SC9863A 7 55 56 56 57 struct sprd_mbox_priv { 57 58 struct mbox_controller mbox; 58 59 struct device *dev; 59 60 void __iomem *inbox_base; 60 61 void __iomem *outbox_base; 62 + /* Base register address for supplementary outbox */ 63 + void __iomem *supp_base; 61 64 struct clk *clk; 62 65 u32 outbox_fifo_depth; 63 66 67 + struct mutex lock; 68 + u32 refcnt; 64 69 struct mbox_chan chan[SPRD_MBOX_CHAN_MAX]; 65 70 }; 66 71 ··· 101 94 return fifo_len; 102 95 } 103 96 104 - static irqreturn_t sprd_mbox_outbox_isr(int irq, void *data) 97 + static irqreturn_t do_outbox_isr(void __iomem *base, struct sprd_mbox_priv *priv) 105 98 { 106 - struct sprd_mbox_priv *priv = data; 107 99 struct mbox_chan *chan; 108 100 u32 fifo_sts, fifo_len, msg[2]; 109 101 int i, id; 110 102 111 - fifo_sts = readl(priv->outbox_base + SPRD_MBOX_FIFO_STS); 103 + fifo_sts = readl(base + SPRD_MBOX_FIFO_STS); 112 104 113 105 fifo_len = sprd_mbox_get_fifo_len(priv, fifo_sts); 114 106 if (!fifo_len) { ··· 116 110 } 117 111 118 112 for (i = 0; i < fifo_len; i++) { 119 - msg[0] = readl(priv->outbox_base + SPRD_MBOX_MSG_LOW); 120 - msg[1] = readl(priv->outbox_base + SPRD_MBOX_MSG_HIGH); 121 - id = readl(priv->outbox_base + SPRD_MBOX_ID); 113 + msg[0] = readl(base + SPRD_MBOX_MSG_LOW); 114 + msg[1] = readl(base + SPRD_MBOX_MSG_HIGH); 115 + id = readl(base + SPRD_MBOX_ID); 122 116 123 117 chan = &priv->chan[id]; 124 - mbox_chan_received_data(chan, (void *)msg); 118 + if (chan->cl) 119 + mbox_chan_received_data(chan, (void *)msg); 120 + else 121 + dev_warn_ratelimited(priv->dev, 122 + "message's been dropped at ch[%d]\n", id); 125 123 126 124 /* Trigger to update outbox FIFO pointer */ 127 - writel(0x1, priv->outbox_base + SPRD_MBOX_TRIGGER); 125 + writel(0x1, base + SPRD_MBOX_TRIGGER); 128 126 } 129 127 130 128 /* Clear irq status after reading all message. */ 131 - writel(SPRD_MBOX_IRQ_CLR, priv->outbox_base + SPRD_MBOX_IRQ_STS); 129 + writel(SPRD_MBOX_IRQ_CLR, base + SPRD_MBOX_IRQ_STS); 132 130 133 131 return IRQ_HANDLED; 132 + } 133 + 134 + static irqreturn_t sprd_mbox_outbox_isr(int irq, void *data) 135 + { 136 + struct sprd_mbox_priv *priv = data; 137 + 138 + return do_outbox_isr(priv->outbox_base, priv); 139 + } 140 + 141 + static irqreturn_t sprd_mbox_supp_isr(int irq, void *data) 142 + { 143 + struct sprd_mbox_priv *priv = data; 144 + 145 + return do_outbox_isr(priv->supp_base, priv); 134 146 } 135 147 136 148 static irqreturn_t sprd_mbox_inbox_isr(int irq, void *data) ··· 174 150 chan = &priv->chan[id]; 175 151 176 152 /* 177 - * Check if the message was fetched by remote traget, if yes, 153 + * Check if the message was fetched by remote target, if yes, 178 154 * that means the transmission has been completed. 179 155 */ 180 156 busy = fifo_sts & SPRD_INBOX_FIFO_BUSY_MASK; ··· 239 215 struct sprd_mbox_priv *priv = to_sprd_mbox_priv(chan->mbox); 240 216 u32 val; 241 217 242 - /* Select outbox FIFO mode and reset the outbox FIFO status */ 243 - writel(0x0, priv->outbox_base + SPRD_MBOX_FIFO_RST); 218 + mutex_lock(&priv->lock); 219 + if (priv->refcnt++ == 0) { 220 + /* Select outbox FIFO mode and reset the outbox FIFO status */ 221 + writel(0x0, priv->outbox_base + SPRD_MBOX_FIFO_RST); 244 222 245 - /* Enable inbox FIFO overflow and delivery interrupt */ 246 - val = readl(priv->inbox_base + SPRD_MBOX_IRQ_MSK); 247 - val &= ~(SPRD_INBOX_FIFO_OVERFLOW_IRQ | SPRD_INBOX_FIFO_DELIVER_IRQ); 248 - writel(val, priv->inbox_base + SPRD_MBOX_IRQ_MSK); 223 + /* Enable inbox FIFO overflow and delivery interrupt */ 224 + val = readl(priv->inbox_base + SPRD_MBOX_IRQ_MSK); 225 + val &= ~(SPRD_INBOX_FIFO_OVERFLOW_IRQ | SPRD_INBOX_FIFO_DELIVER_IRQ); 226 + writel(val, priv->inbox_base + SPRD_MBOX_IRQ_MSK); 249 227 250 - /* Enable outbox FIFO not empty interrupt */ 251 - val = readl(priv->outbox_base + SPRD_MBOX_IRQ_MSK); 252 - val &= ~SPRD_OUTBOX_FIFO_NOT_EMPTY_IRQ; 253 - writel(val, priv->outbox_base + SPRD_MBOX_IRQ_MSK); 228 + /* Enable outbox FIFO not empty interrupt */ 229 + val = readl(priv->outbox_base + SPRD_MBOX_IRQ_MSK); 230 + val &= ~SPRD_OUTBOX_FIFO_NOT_EMPTY_IRQ; 231 + writel(val, priv->outbox_base + SPRD_MBOX_IRQ_MSK); 232 + 233 + /* Enable supplementary outbox as the fundamental one */ 234 + if (priv->supp_base) { 235 + writel(0x0, priv->supp_base + SPRD_MBOX_FIFO_RST); 236 + val = readl(priv->supp_base + SPRD_MBOX_IRQ_MSK); 237 + val &= ~SPRD_OUTBOX_FIFO_NOT_EMPTY_IRQ; 238 + writel(val, priv->supp_base + SPRD_MBOX_IRQ_MSK); 239 + } 240 + } 241 + mutex_unlock(&priv->lock); 254 242 255 243 return 0; 256 244 } ··· 271 235 { 272 236 struct sprd_mbox_priv *priv = to_sprd_mbox_priv(chan->mbox); 273 237 274 - /* Disable inbox & outbox interrupt */ 275 - writel(SPRD_INBOX_FIFO_IRQ_MASK, priv->inbox_base + SPRD_MBOX_IRQ_MSK); 276 - writel(SPRD_OUTBOX_FIFO_IRQ_MASK, priv->outbox_base + SPRD_MBOX_IRQ_MSK); 238 + mutex_lock(&priv->lock); 239 + if (--priv->refcnt == 0) { 240 + /* Disable inbox & outbox interrupt */ 241 + writel(SPRD_INBOX_FIFO_IRQ_MASK, priv->inbox_base + SPRD_MBOX_IRQ_MSK); 242 + writel(SPRD_OUTBOX_FIFO_IRQ_MASK, priv->outbox_base + SPRD_MBOX_IRQ_MSK); 243 + 244 + if (priv->supp_base) 245 + writel(SPRD_OUTBOX_FIFO_IRQ_MASK, 246 + priv->supp_base + SPRD_MBOX_IRQ_MSK); 247 + } 248 + mutex_unlock(&priv->lock); 277 249 } 278 250 279 251 static const struct mbox_chan_ops sprd_mbox_ops = { ··· 302 258 { 303 259 struct device *dev = &pdev->dev; 304 260 struct sprd_mbox_priv *priv; 305 - int ret, inbox_irq, outbox_irq; 306 - unsigned long id; 261 + int ret, inbox_irq, outbox_irq, supp_irq; 262 + unsigned long id, supp; 307 263 308 264 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 309 265 if (!priv) 310 266 return -ENOMEM; 311 267 312 268 priv->dev = dev; 269 + mutex_init(&priv->lock); 313 270 314 271 /* 315 - * The Spreadtrum mailbox uses an inbox to send messages to the target 316 - * core, and uses an outbox to receive messages from other cores. 272 + * Unisoc mailbox uses an inbox to send messages to the target 273 + * core, and uses (an) outbox(es) to receive messages from other 274 + * cores. 317 275 * 318 - * Thus the mailbox controller supplies 2 different register addresses 319 - * and IRQ numbers for inbox and outbox. 276 + * Thus in general the mailbox controller supplies 2 different 277 + * register addresses and IRQ numbers for inbox and outbox. 278 + * 279 + * If necessary, a supplementary inbox could be enabled optionally 280 + * with an independent FIFO and an extra interrupt. 320 281 */ 321 282 priv->inbox_base = devm_platform_ioremap_resource(pdev, 0); 322 283 if (IS_ERR(priv->inbox_base)) ··· 347 298 return ret; 348 299 } 349 300 350 - inbox_irq = platform_get_irq(pdev, 0); 301 + inbox_irq = platform_get_irq_byname(pdev, "inbox"); 351 302 if (inbox_irq < 0) 352 303 return inbox_irq; 353 304 ··· 358 309 return ret; 359 310 } 360 311 361 - outbox_irq = platform_get_irq(pdev, 1); 312 + outbox_irq = platform_get_irq_byname(pdev, "outbox"); 362 313 if (outbox_irq < 0) 363 314 return outbox_irq; 364 315 ··· 367 318 if (ret) { 368 319 dev_err(dev, "failed to request outbox IRQ: %d\n", ret); 369 320 return ret; 321 + } 322 + 323 + /* Supplementary outbox IRQ is optional */ 324 + supp_irq = platform_get_irq_byname(pdev, "supp-outbox"); 325 + if (supp_irq > 0) { 326 + ret = devm_request_irq(dev, supp_irq, sprd_mbox_supp_isr, 327 + IRQF_NO_SUSPEND, dev_name(dev), priv); 328 + if (ret) { 329 + dev_err(dev, "failed to request outbox IRQ: %d\n", ret); 330 + return ret; 331 + } 332 + 333 + supp = (unsigned long) of_device_get_match_data(dev); 334 + if (!supp) { 335 + dev_err(dev, "no supplementary outbox specified\n"); 336 + return -ENODEV; 337 + } 338 + priv->supp_base = priv->outbox_base + (SPRD_OUTBOX_BASE_SPAN * supp); 370 339 } 371 340 372 341 /* Get the default outbox FIFO depth */ ··· 409 342 } 410 343 411 344 static const struct of_device_id sprd_mbox_of_match[] = { 412 - { .compatible = "sprd,sc9860-mailbox", }, 345 + { .compatible = "sprd,sc9860-mailbox" }, 346 + { .compatible = "sprd,sc9863a-mailbox", 347 + .data = (void *)SPRD_SUPP_INBOX_ID_SC9863A }, 413 348 { }, 414 349 }; 415 350 MODULE_DEVICE_TABLE(of, sprd_mbox_of_match);
+1 -1
drivers/mailbox/ti-msgmgr.c
··· 239 239 240 240 /* 241 241 * I have no idea about the protocol being used to communicate with the 242 - * remote producer - 0 could be valid data, so I wont make a judgement 242 + * remote producer - 0 could be valid data, so I won't make a judgement 243 243 * of how many bytes I should be reading. Let the client figure this 244 244 * out.. I just read the full message and pass it on.. 245 245 */