Skip to content

Commit

Permalink
Merge tag 'mailbox-v4.17' of git://git.linaro.org/landing-teams/worki…
Browse files Browse the repository at this point in the history
…ng/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()
  • Loading branch information
torvalds committed Apr 7, 2018
2 parents 9eda2d2 + 41c0e93 commit 28da7be
Show file tree
Hide file tree
Showing 5 changed files with 375 additions and 3 deletions.
@@ -0,0 +1,51 @@
Hisilicon Hi3660 Mailbox Controller

Hisilicon Hi3660 mailbox controller supports up to 32 channels. Messages
are passed between processors, including application & communication
processors, MCU, HIFI, etc. Each channel is unidirectional and accessed
by using MMIO registers; it supports maximum to 8 words message.

Controller
----------

Required properties:
- compatible: : Shall be "hisilicon,hi3660-mbox"
- reg: : Offset and length of the device's register set
- #mbox-cells: : Must be 3
<&phandle channel dst_irq ack_irq>
phandle : Label name of controller
channel : Channel number
dst_irq : Remote interrupt vector
ack_irq : Local interrupt vector

- interrupts: : Contains the two IRQ lines for mailbox.

Example:

mailbox: mailbox@e896b000 {
compatible = "hisilicon,hi3660-mbox";
reg = <0x0 0xe896b000 0x0 0x1000>;
interrupts = <0x0 0xc0 0x4>,
<0x0 0xc1 0x4>;
#mbox-cells = <3>;
};

Client
------

Required properties:
- compatible : See the client docs
- mboxes : Standard property to specify a Mailbox (See ./mailbox.txt)
Cells must match 'mbox-cells' (See Controller docs above)

Optional properties
- mbox-names : Name given to channels seen in the 'mboxes' property.

Example:

stub_clock: stub_clock@e896b500 {
compatible = "hisilicon,hi3660-stub-clk";
reg = <0x0 0xe896b500 0x0 0x0100>;
#clock-cells = <1>;
mboxes = <&mailbox 13 3 0>;
};
10 changes: 9 additions & 1 deletion drivers/mailbox/Kconfig
Expand Up @@ -108,6 +108,14 @@ config TI_MESSAGE_MANAGER
multiple processors within the SoC. Select this driver if your
platform has support for the hardware block.

config HI3660_MBOX
tristate "Hi3660 Mailbox"
depends on ARCH_HISI && OF
help
An implementation of the hi3660 mailbox. It is used to send message
between application processors and other processors/MCU/DSP. Select
Y here if you want to use Hi3660 mailbox controller.

config HI6220_MBOX
tristate "Hi6220 Mailbox"
depends on ARCH_HISI
Expand All @@ -134,7 +142,7 @@ config QCOM_APCS_IPC

config TEGRA_HSP_MBOX
bool "Tegra HSP (Hardware Synchronization Primitives) Driver"
depends on ARCH_TEGRA_186_SOC
depends on ARCH_TEGRA
help
The Tegra HSP driver is used for the interprocessor communication
between different remote processors and host processors on Tegra186
Expand Down
2 changes: 2 additions & 0 deletions drivers/mailbox/Makefile
Expand Up @@ -27,6 +27,8 @@ obj-$(CONFIG_TI_MESSAGE_MANAGER) += ti-msgmgr.o

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

obj-$(CONFIG_HI3660_MBOX) += hi3660-mailbox.o

obj-$(CONFIG_HI6220_MBOX) += hi6220-mailbox.o

obj-$(CONFIG_BCM_PDC_MBOX) += bcm-pdc-mailbox.o
Expand Down
3 changes: 1 addition & 2 deletions drivers/mailbox/bcm-flexrm-mailbox.c
Expand Up @@ -1268,7 +1268,7 @@ static int flexrm_startup(struct mbox_chan *chan)
}

/* Allocate completion memory */
ring->cmpl_base = dma_pool_alloc(ring->mbox->cmpl_pool,
ring->cmpl_base = dma_pool_zalloc(ring->mbox->cmpl_pool,
GFP_KERNEL, &ring->cmpl_dma_base);
if (!ring->cmpl_base) {
dev_err(ring->mbox->dev,
Expand All @@ -1277,7 +1277,6 @@ static int flexrm_startup(struct mbox_chan *chan)
ret = -ENOMEM;
goto fail_free_bd_memory;
}
memset(ring->cmpl_base, 0, RING_CMPL_SIZE);

/* Request IRQ */
if (ring->irq == UINT_MAX) {
Expand Down

0 comments on commit 28da7be

Please sign in to comment.