Broadcom FlexRM ring manager support
Subsystems (3)
v7 cover Broadcom FlexRM ring manager support
The Broadcom FlexRM ring manager provides producer-consumer style ring interface for offload engines on Broadcom iProc SoCs. We can have one or more instances of Broadcom FlexRM ring manager in a SoC.
This patchset adds a mailbox driver for Broadcom FlexRM ring manager which can be used by offload engine drivers as mailbox clients.
The Broadcom FlexRM mailbox driver is feature complete for RAID and Crypto offload engines. We will have incremental patches in-future for ring-level statistics using debugfs and minor optimizations.
This patchset is based on Linux-4.11-rc4 and it is also available at flexrm-v7 branch of https://github.com/Broadcom/arm64-linux.git
Changes since v6:
- Rebased patches for Linux-4.11-rc4
- Added a patch to remove depends on COMPILE_TEST for kconfig option BCM_FLEXRM_MBOX
Changes since v5:
- Rebased patches for Linux-4.11-rc2
- Merged all source files into one source file and removed driver directory
Changes since v4:
- Rebased patches for Linux-4.11-rc1
Changes since v3:
- Fixed mailbox client example DT node in DT bindings document
Changes since v2:
- Rebased patches for Linux-4.10-rc2
Changes since v1:
- Use compatile string as brcm,iproc-flexrm-mbox
- Rephrase commit message and text in DT bindings patch
Anup Patel (3):
mailbox: Add driver for Broadcom FlexRM ring manager
dt-bindings: Add DT bindings info for FlexRM ring manager
mailbox: Remove depends on COMPILE_TEST for BCM_FLEXRM_MBOX
.../bindings/mailbox/brcm,iproc-flexrm-mbox.txt | 59 + drivers/mailbox/Kconfig | 11 + drivers/mailbox/Makefile | 2 + drivers/mailbox/bcm-flexrm-mailbox.c | 1595 ++++++++++++++++++++ include/linux/mailbox/brcm-message.h | 14 +- 5 files changed, 1677 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-flexrm-mbox.txt create mode 100644 drivers/mailbox/bcm-flexrm-mailbox.c
Signature · 1 line
2.7.4
PATCH v7 1/3 mailbox: Add driver for Broadcom FlexRM ring manager
Some of the Broadcom iProc SoCs have FlexRM ring manager which provides a ring-based programming interface to various offload engines (e.g. RAID, Crypto, etc).
This patch adds a common mailbox driver for Broadcom FlexRM ring manager which can be shared by various offload engine drivers (implemented as mailbox clients).
--- drivers/mailbox/Kconfig | 11 + drivers/mailbox/Makefile | 2 + drivers/mailbox/bcm-flexrm-mailbox.c | 1595 ++++++++++++++++++++++++++++++++++ include/linux/mailbox/brcm-message.h | 14 +- 4 files changed, 1618 insertions(+), 4 deletions(-) create mode 100644 drivers/mailbox/bcm-flexrm-mailbox.c
drivers/mailbox/Kconfig +11 -0
@@ -152,4 +152,15 @@ config BCM_PDC_MBOX Mailbox implementation for the Broadcom PDC ring manager, which provides access to various offload engines on Broadcom SoCs. Say Y here if you want to use the Broadcom PDC. + +config BCM_FLEXRM_MBOX + tristate "Broadcom FlexRM Mailbox" + depends on ARM64 || COMPILE_TEST + depends on HAS_DMA + select GENERIC_MSI_IRQ_DOMAIN + default ARCH_BCM_IPROC + help + Mailbox implementation of the Broadcom FlexRM ring manager, + which provides access to various offload engines on Broadcom + SoCs. Say Y here if you want to use the Broadcom FlexRM. endif
drivers/mailbox/Makefile +2 -0
@@ -30,4 +30,6 @@ obj-$(CONFIG_HI6220_MBOX) += hi6220-mailbox.o obj-$(CONFIG_BCM_PDC_MBOX) += bcm-pdc-mailbox.o +obj-$(CONFIG_BCM_FLEXRM_MBOX) += bcm-flexrm-mailbox.o + obj-$(CONFIG_TEGRA_HSP_MBOX) += tegra-hsp.o
drivers/mailbox/bcm-flexrm-mailbox.c new file +1595 -0
1,595 lines not on this page · raw message
include/linux/mailbox/brcm-message.h +10 -4
@@ -16,6 +16,7 @@enum brcm_message_type {BRCM_MESSAGE_UNKNOWN =0 , +BRCM_MESSAGE_BATCH ,BRCM_MESSAGE_SPU ,BRCM_MESSAGE_SBA ,BRCM_MESSAGE_MAX ,
@@ -23,24 +24,29 @@ enum brcm_message_type {struct brcm_sba_command {u64 cmd; +u64 *cmd_dma; +dma_addr_t cmd_dma_addr;#define BRCM_SBA_CMD_TYPE_A BIT(0)#define BRCM_SBA_CMD_TYPE_B BIT(1)#define BRCM_SBA_CMD_TYPE_C BIT(2)#define BRCM_SBA_CMD_HAS_RESP BIT(3)#define BRCM_SBA_CMD_HAS_OUTPUT BIT(4)u64 flags; -dma_addr_t input; -size_t input_len;dma_addr_t resp;size_t resp_len; -dma_addr_t output; -size_t output_len; +dma_addr_t data; +size_t data_len; };struct brcm_message {enum brcm_message_type type;union {struct { +struct brcm_message *msgs; +unsigned int msgs_queued; +unsigned int msgs_count; + } batch; +struct {struct scatterlist *src;struct scatterlist *dst; } spu;
Signature · 1 line
2.7.4
PATCH v7 2/3 dt-bindings: Add DT bindings info for FlexRM ring manager
In reply to Anup PatelThis patch adds device tree bindings document for the FlexRM ring manager found on Broadcom iProc SoCs.
--- .../bindings/mailbox/brcm,iproc-flexrm-mbox.txt | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-flexrm-mbox.txt
Documentation/devicetree/bindings/mailbox/brcm,iproc-flexrm-mbox.txt new file +59 -0
@@ -0,0 +1,59 @@ +Broadcom FlexRM Ring Manager +============================ +The Broadcom FlexRM ring manager provides a set of rings which can be +used to submit work to offload engines. An SoC may have multiple FlexRM +hardware blocks. There is one device tree entry per FlexRM block. The +FlexRM driver will create a mailbox-controller instance for given FlexRM +hardware block where each mailbox channel is a separate FlexRM ring. + +Required properties: +-------------------- +- compatible: Should be "brcm,iproc-flexrm-mbox" +- reg: Specifies base physical address and size of the FlexRM + ring registers +- msi-parent: Phandles (and potential Device IDs) to MSI controllers + The FlexRM engine will send MSIs (instead of wired + interrupts) to CPU. There is one MSI for each FlexRM ring. + Refer devicetree/bindings/interrupt-controller/msi.txt +- #mbox-cells: Specifies the number of cells needed to encode a mailbox + channel. This should be 3. + + The 1st cell is the mailbox channel number. + + The 2nd cell contains MSI completion threshold. This is the + number of completion messages for which FlexRM will inject + one MSI interrupt to CPU. + + The 3nd cell contains MSI timer value representing time for + which FlexRM will wait to accumulate N completion messages + where N is the value specified by 2nd cell above. If FlexRM + does not get required number of completion messages in time + specified by this cell then it will inject one MSI interrupt + to CPU provided atleast one completion message is available. + +Optional properties: +-------------------- +- dma-coherent: Present if DMA operations made by the FlexRM engine (such + as DMA descriptor access, access to buffers pointed by DMA + descriptors and read/write pointer updates to DDR) are + cache coherent with the CPU. + +Example: +-------- +crypto_mbox: mbox at 67000000 { + compatible = "brcm,iproc-flexrm-mbox"; + reg = <0x67000000 0x200000>; + msi-parent = <&gic_its 0x7f00>; + #mbox-cells = <3>; +}; + +crypto at 672c0000 { + compatible = "brcm,spu2-v2-crypto"; + reg = <0x672c0000 0x1000>; + mboxes = <&crypto_mbox 0 0x1 0xffff>, + <&crypto_mbox 1 0x1 0xffff>, + <&crypto_mbox 16 0x1 0xffff>, + <&crypto_mbox 17 0x1 0xffff>, + <&crypto_mbox 30 0x1 0xffff>, + <&crypto_mbox 31 0x1 0xffff>; +};
Signature · 1 line
2.7.4
PATCH v7 3/3 mailbox: Remove depends on COMPILE_TEST for BCM_FLEXRM_MBOX
In reply to Anup PatelThe Broadcom FlexRM mailbox driver uses platform MSI support but not all ARCHs provide asm/msi.h. Due to this, we get compilation error in Broadcom FlexRM mailbox driver via linux/msi.h on ARCHs which lack asm/msi.h.
This patch removes "depends on COMPILE_TEST" for Kconfig option BCM_FLEXRM_MBOX so that Broadcom FlexRM mailbox driver is only compiled for ARM64.
--- drivers/mailbox/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/Kconfig +1 -1
@@ -155,7 +155,7 @@ config BCM_PDC_MBOX config BCM_FLEXRM_MBOX tristate "Broadcom FlexRM Mailbox" - depends on ARM64 || COMPILE_TEST + depends on ARM64 depends on HAS_DMA select GENERIC_MSI_IRQ_DOMAIN default ARCH_BCM_IPROC
Signature · 1 line
2.7.4
Jassi Brar
maintainerQuoted 11 lines · Anup Patel
The Broadcom FlexRM ring manager provides producer-consumer style ring interface for offload engines on Broadcom iProc SoCs. We can have one or more instances of Broadcom FlexRM ring manager in a SoC.
This patchset adds a mailbox driver for Broadcom FlexRM ring manager which can be used by offload engine drivers as mailbox clients.
The Broadcom FlexRM mailbox driver is feature complete for RAID and Crypto offload engines. We will have incremental patches in-future for ring-level statistics using debugfs and minor optimizations.
Quoted 8 lines
This patchset is based on Linux-4.11-rc4 and it is also available at flexrm-v7 branch of https://github.com/Broadcom/arm64-linux.git
Changes since v6:
- Rebased patches for Linux-4.11-rc4
- Added a patch to remove depends onCOMPILE_TESTfor kconfig optionBCM_FLEXRM_MBOX
You only needed to send the fix to compilation failure reports, not the whole series.
I believe only the patch-3 is new in the series and I need not even look at patch-1,2 ?
Quoted 15 lines · Jassi Brar
Quoted 14 lines · Anup Patel
The Broadcom FlexRM ring manager provides producer-consumer style ring interface for offload engines on Broadcom iProc SoCs. We can have one or more instances of Broadcom FlexRM ring manager in a SoC.
This patchset adds a mailbox driver for Broadcom FlexRM ring manager which can be used by offload engine drivers as mailbox clients.
The Broadcom FlexRM mailbox driver is feature complete for RAID and Crypto offload engines. We will have incremental patches in-future for ring-level statistics using debugfs and minor optimizations.
This patchset is based on Linux-4.11-rc4 and it is also available at flexrm-v7 branch of https://github.com/Broadcom/arm64-linux.git
Quoted 7 lines
Quoted 5 lines
Changes since v6:
- Rebased patches for Linux-4.11-rc4
- Added a patch to remove depends onCOMPILE_TESTfor kconfig optionBCM_FLEXRM_MBOXYou only needed to send the fix to compilation failure reports, not the whole series.
My bad for the noise.
Quoted 2 lines
I believe only the patch-3 is new in the series and I need not even look at patch-1,2 ?
Yes, only patch-3 is required to fix compilation failure.
Regards,
Anup