Skip to content

Commit 28da7be

Browse files
committed
Merge tag 'mailbox-v4.17' of git://git.linaro.org/landing-teams/working/fujitsu/integration
Pull mailbox updates from Jassi Brar: - New Hi3660 mailbox driver - Fix TEGRA Kconfig warning - Broadcom: use dma_pool_zalloc instead of dma_pool_alloc+memset * tag 'mailbox-v4.17' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: Add support for Hi3660 mailbox dt-bindings: mailbox: Introduce Hi3660 controller binding mailbox: tegra: relax TEGRA_HSP_MBOX Kconfig dependencies maillbox: bcm-flexrm-mailbox: Use dma_pool_zalloc()
2 parents 9eda2d2 + 41c0e93 commit 28da7be

5 files changed

Lines changed: 375 additions & 3 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Hisilicon Hi3660 Mailbox Controller
2+
3+
Hisilicon Hi3660 mailbox controller supports up to 32 channels. Messages
4+
are passed between processors, including application & communication
5+
processors, MCU, HIFI, etc. Each channel is unidirectional and accessed
6+
by using MMIO registers; it supports maximum to 8 words message.
7+
8+
Controller
9+
----------
10+
11+
Required properties:
12+
- compatible: : Shall be "hisilicon,hi3660-mbox"
13+
- reg: : Offset and length of the device's register set
14+
- #mbox-cells: : Must be 3
15+
<&phandle channel dst_irq ack_irq>
16+
phandle : Label name of controller
17+
channel : Channel number
18+
dst_irq : Remote interrupt vector
19+
ack_irq : Local interrupt vector
20+
21+
- interrupts: : Contains the two IRQ lines for mailbox.
22+
23+
Example:
24+
25+
mailbox: mailbox@e896b000 {
26+
compatible = "hisilicon,hi3660-mbox";
27+
reg = <0x0 0xe896b000 0x0 0x1000>;
28+
interrupts = <0x0 0xc0 0x4>,
29+
<0x0 0xc1 0x4>;
30+
#mbox-cells = <3>;
31+
};
32+
33+
Client
34+
------
35+
36+
Required properties:
37+
- compatible : See the client docs
38+
- mboxes : Standard property to specify a Mailbox (See ./mailbox.txt)
39+
Cells must match 'mbox-cells' (See Controller docs above)
40+
41+
Optional properties
42+
- mbox-names : Name given to channels seen in the 'mboxes' property.
43+
44+
Example:
45+
46+
stub_clock: stub_clock@e896b500 {
47+
compatible = "hisilicon,hi3660-stub-clk";
48+
reg = <0x0 0xe896b500 0x0 0x0100>;
49+
#clock-cells = <1>;
50+
mboxes = <&mailbox 13 3 0>;
51+
};

‎drivers/mailbox/Kconfig‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ config TI_MESSAGE_MANAGER
108108
multiple processors within the SoC. Select this driver if your
109109
platform has support for the hardware block.
110110

111+
config HI3660_MBOX
112+
tristate "Hi3660 Mailbox"
113+
depends on ARCH_HISI && OF
114+
help
115+
An implementation of the hi3660 mailbox. It is used to send message
116+
between application processors and other processors/MCU/DSP. Select
117+
Y here if you want to use Hi3660 mailbox controller.
118+
111119
config HI6220_MBOX
112120
tristate "Hi6220 Mailbox"
113121
depends on ARCH_HISI
@@ -134,7 +142,7 @@ config QCOM_APCS_IPC
134142

135143
config TEGRA_HSP_MBOX
136144
bool "Tegra HSP (Hardware Synchronization Primitives) Driver"
137-
depends on ARCH_TEGRA_186_SOC
145+
depends on ARCH_TEGRA
138146
help
139147
The Tegra HSP driver is used for the interprocessor communication
140148
between different remote processors and host processors on Tegra186

‎drivers/mailbox/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ obj-$(CONFIG_TI_MESSAGE_MANAGER) += ti-msgmgr.o
2727

2828
obj-$(CONFIG_XGENE_SLIMPRO_MBOX) += mailbox-xgene-slimpro.o
2929

30+
obj-$(CONFIG_HI3660_MBOX) += hi3660-mailbox.o
31+
3032
obj-$(CONFIG_HI6220_MBOX) += hi6220-mailbox.o
3133

3234
obj-$(CONFIG_BCM_PDC_MBOX) += bcm-pdc-mailbox.o

‎drivers/mailbox/bcm-flexrm-mailbox.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ static int flexrm_startup(struct mbox_chan *chan)
12681268
}
12691269

12701270
/* Allocate completion memory */
1271-
ring->cmpl_base = dma_pool_alloc(ring->mbox->cmpl_pool,
1271+
ring->cmpl_base = dma_pool_zalloc(ring->mbox->cmpl_pool,
12721272
GFP_KERNEL, &ring->cmpl_dma_base);
12731273
if (!ring->cmpl_base) {
12741274
dev_err(ring->mbox->dev,
@@ -1277,7 +1277,6 @@ static int flexrm_startup(struct mbox_chan *chan)
12771277
ret = -ENOMEM;
12781278
goto fail_free_bd_memory;
12791279
}
1280-
memset(ring->cmpl_base, 0, RING_CMPL_SIZE);
12811280

12821281
/* Request IRQ */
12831282
if (ring->irq == UINT_MAX) {

0 commit comments

Comments
 (0)