Add Broadcom PDC mailbox driver
Subsystems (3)
v2 cover Add Broadcom PDC mailbox driver
From: Rob Rice <[email protected]>
Changes in v2:
- Added COMPILE_TEST depend to PDC Kconfig
- Renamed pdc.c to bcm-pdc-mailbox.c and moved it from subdirectory to drivers/mailbox
- Moved code from pdc.h, pdc_debug.h, and pdc_debug.c into bcm-pdc-mailbox.c
- Removed a few function parameters
The Broadcom PDC mailbox driver is a ring manager for the Broadcom Secure Processing Unit (SPU) kernel driver and other mailbox clients. The PDC driver registers with the Linux mailbox framework a mailbox controller, once for each PDC instance. Ring 0 for each PDC is registered as a mailbox channel. The PDC driver uses interrupts to determine when ring transfers to and from an offload engine are complete. The PDC driver uses threaded IRQs so that response messages are handled outside of interrupt context.
Rob Rice (3):
dt-bindings: add bindings documentation for PDC driver.
mailbox: Add Broadcom PDC mailbox driver
arm64: dts: Add Broadcom Northstar2 device tree entries for PDC
driver.
.../bindings/mailbox/brcm,iproc-pdc-mbox.txt | 23 + arch/arm64/boot/dts/broadcom/ns2.dtsi | 36 + drivers/mailbox/Kconfig | 9 + drivers/mailbox/Makefile | 2 + drivers/mailbox/bcm-pdc-mailbox.c | 1531 ++++++++++++++++++++ include/linux/mailbox/brcm-message.h | 56 + 6 files changed, 1657 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-pdc-mbox.txt create mode 100644 drivers/mailbox/bcm-pdc-mailbox.c create mode 100644 include/linux/mailbox/brcm-message.h
Signature · 1 line
2.1.0
PATCH v2 1/3 dt-bindings: add bindings documentation for PDC driver.
From: Rob Rice <[email protected]>
Add the device tree binding documentation for the PDC hardware in Broadcom iProc SoCs.
--- .../bindings/mailbox/brcm,iproc-pdc-mbox.txt | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-pdc-mbox.txt
Documentation/devicetree/bindings/mailbox/brcm,iproc-pdc-mbox.txt new file +23 -0
@@ -0,0 +1,23 @@ +The PDC driver manages data transfer to and from various offload engines +on some Broadcom SoCs. An SoC may have multiple PDC hardware blocks. There is +one device tree entry per block. + +Required properties: +- compatible : Should be "brcm,iproc-pdc-mbox". +- reg: Should contain PDC registers location and length. +- interrupts: Should contain the IRQ line for the PDC. +- #mbox-cells: 1 +- brcm,rx-status-len: Length of metadata preceding received frames, in bytes. + +Optional properties: +- brcm,use-bcm-hdr: present if a BCM header precedes each frame. + +Example: + pdc0: iproc-pdc0 at 0x612c0000 { + compatible = "brcm,iproc-pdc-mbox"; + reg = <0 0x612c0000 0 0x445>; /* PDC FS0 regs */ + interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; + #mbox-cells = <1>; /* one cell per mailbox channel */ + brcm,rx-status-len = <32>; + brcm,use-bcm-hdr; + };
Signature · 1 line
2.1.0
PATCH v2 2/3 mailbox: Add Broadcom PDC mailbox driver
In reply to Rob RiceFrom: Rob Rice <[email protected]>
The Broadcom PDC mailbox driver is a mailbox controller that manages data transfers to and from one or more offload engines.
--- drivers/mailbox/Kconfig | 9 + drivers/mailbox/Makefile | 2 + drivers/mailbox/bcm-pdc-mailbox.c | 1531 ++++++++++++++++++++++++++++++++++ include/linux/mailbox/brcm-message.h | 56 ++ 4 files changed, 1598 insertions(+) create mode 100644 drivers/mailbox/bcm-pdc-mailbox.c create mode 100644 include/linux/mailbox/brcm-message.h
drivers/mailbox/Kconfig +9 -0
@@ -123,4 +123,13 @@ config XGENE_SLIMPRO_MBOX It is used to send short messages between ARM64-bit cores and the SLIMpro Management Engine, primarily for PM. Say Y here if you want to use the APM X-Gene SLIMpro IPCM support. + +config BCM_PDC_MBOX + tristate "Broadcom PDC Mailbox" + depends on ARM64 || COMPILE_TEST + default ARCH_BCM_IPROC + help + 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. endif
drivers/mailbox/Makefile +2 -0
@@ -25,3 +25,5 @@ obj-$(CONFIG_TI_MESSAGE_MANAGER) += ti-msgmgr.o obj-$(CONFIG_XGENE_SLIMPRO_MBOX) += mailbox-xgene-slimpro.o obj-$(CONFIG_HI6220_MBOX) += hi6220-mailbox.o + +obj-$(CONFIG_BCM_PDC_MBOX) += bcm-pdc-mailbox.o
drivers/mailbox/bcm-pdc-mailbox.c new file +1531 -0
1,531 lines not on this page · raw message
include/linux/mailbox/brcm-message.h new file +56 -0
56 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH v2 3/3 arm64: dts: Add Broadcom Northstar2 device tree entries for PDC driver.
In reply to Rob RiceFrom: Rob Rice <[email protected]>
Add Broadcom Northstar2 SoC device tree entries for PDC driver.
--- arch/arm64/boot/dts/broadcom/ns2.dtsi | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/broadcom/ns2.dtsi +36 -0
@@ -191,6 +191,42 @@ #include "ns2-clock.dtsi" + pdc0: iproc-pdc0 at 612c0000 { + compatible = "brcm,iproc-pdc-mbox"; + reg = <0x612c0000 0x445>; /* PDC FS0 regs */ + interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>; + #mbox-cells = <1>; + brcm,rx-status-len = <32>; + brcm,use-bcm-hdr; + }; + + pdc1: iproc-pdc1 at 612e0000 { + compatible = "brcm,iproc-pdc-mbox"; + reg = <0x612e0000 0x445>; /* PDC FS1 regs */ + interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; + #mbox-cells = <1>; + brcm,rx-status-len = <32>; + brcm,use-bcm-hdr; + }; + + pdc2: iproc-pdc2 at 61300000 { + compatible = "brcm,iproc-pdc-mbox"; + reg = <0x61300000 0x445>; /* PDC FS2 regs */ + interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>; + #mbox-cells = <1>; + brcm,rx-status-len = <32>; + brcm,use-bcm-hdr; + }; + + pdc3: iproc-pdc3 at 61320000 { + compatible = "brcm,iproc-pdc-mbox"; + reg = <0x61320000 0x445>; /* PDC FS3 regs */ + interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>; + #mbox-cells = <1>; + brcm,rx-status-len = <32>; + brcm,use-bcm-hdr; + }; + dma0: dma at 61360000 { compatible = "arm,pl330", "arm,primecell"; reg = <0x61360000 0x1000>;
Signature · 1 line
2.1.0
Florian Fainelli
AppliedRe: [PATCH v2 3/3] arm64: dts: Add Broadcom Northstar2 device tree entries for PDC driver.
Quoted 7 lines · Rob Rice
From: Rob Rice <[email protected]>
Add Broadcom Northstar2 SoC device tree entries for PDC driver.
Signed-off-by Rob Rice <[email protected]>Reviewed-by Ray Jui <[email protected]>Reviewed-by Scott Branden <[email protected]>
Applied, thanks Rob!
Signature · 1 line
Florian