Add support for Broadcom iProc mailbox controller
Subsystems (3)
v2 cover Add support for Broadcom iProc mailbox controller
This patch set contains mailbox support for Broadcom iProc based SoC's. The mailbox controller handles all communication with a Cortex-M0 MCU processor that provides support for power, clock, and reset management.
The patch set enables the mailbox controller for Cygnus and also interrupt support for the Cygnus CRMU GPIO driver which requires use of the M0 processor.
Changes from v1:
- Interrupt handling has been removed and will be added to an interrupt controller driver and sent out in a separate patchset.
- Moved location of bcm_iproc_mailbox.h to include/linux/mailbox as suggested by Jassi.
- Removed reading of client timeout from driver and used canned timeout. This removes the need of including the client mailbox header.
Jonathan Richardson (3):
dt-bindings: Document Broadcom iProc mailbox controller driver
mailbox: Add iProc mailbox controller driver
ARM: dts: Enable Broadcom iProc mailbox controller
.../bindings/mailbox/brcm,iproc-mailbox.txt | 14 ++ arch/arm/boot/dts/bcm-cygnus.dtsi | 6 + drivers/mailbox/Kconfig | 10 ++ drivers/mailbox/Makefile | 2 + drivers/mailbox/bcm-iproc-mailbox.c | 199 +++++++++++++++++++++ include/linux/mailbox/bcm_iproc_mailbox.h | 32 ++++ 6 files changed, 263 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt create mode 100644 drivers/mailbox/bcm-iproc-mailbox.c create mode 100644 include/linux/mailbox/bcm_iproc_mailbox.h
Signature · 1 line
1.9.1
PATCH v2 1/3 dt-bindings: Document Broadcom iProc mailbox controller driver
--- .../devicetree/bindings/mailbox/brcm,iproc-mailbox.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +14 -0
@@ -0,0 +1,14 @@ +* Broadcom's iProc Mailbox Controller + +Required properties: +- compatible: Must be "brcm,iproc-mailbox" +- reg: Defines the base address of the mailbox controller. +- #mbox-cells: Must be 1. + +Example: + + mailbox: mailbox at 03024024 { + compatible = "brcm,iproc-mailbox"; + reg = <0x03024024 0x8>; + #mbox-cells = <1>; + };
Signature · 1 line
1.9.1
PATCH v2 2/3 mailbox: Add iProc mailbox controller driver
In reply to Jonathan RichardsonThe Broadcom iProc mailbox controller handles all communication with a Cortex-M0 MCU processor that provides support for power, clock, and reset management.
--- drivers/mailbox/Kconfig | 10 ++ drivers/mailbox/Makefile | 2 + drivers/mailbox/bcm-iproc-mailbox.c | 199 ++++++++++++++++++++++++++++++ include/linux/mailbox/bcm_iproc_mailbox.h | 32 +++++ 4 files changed, 243 insertions(+) create mode 100644 drivers/mailbox/bcm-iproc-mailbox.c create mode 100644 include/linux/mailbox/bcm_iproc_mailbox.h
drivers/mailbox/Kconfig +10 -0
@@ -143,4 +143,14 @@ 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_IPROC_MBOX + bool "Broadcom iProc Mailbox" + depends on ARCH_BCM_IPROC || COMPILE_TEST + default ARCH_BCM_IPROC + help + Broadcom iProc architected SoC's have an always on Cortex-M0 MCU processor + that handles support for power, clock, and reset management. The iProc + mailbox controller handles all communication with this processor. + endif
drivers/mailbox/Makefile +2 -0
@@ -29,3 +29,5 @@ 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 + +obj-$(CONFIG_BCM_IPROC_MBOX) += bcm-iproc-mailbox.o
drivers/mailbox/bcm-iproc-mailbox.c new file +199 -0
199 lines not on this page · raw message
include/linux/mailbox/bcm_iproc_mailbox.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright (C) 2016 Broadcom. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation version 2. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ +#ifndef _BCM_IPROC_MAILBOX_H_ +#define _BCM_IPROC_MAILBOX_H_ + +/* +* A message to send to the M0 processor. +* @cmd Command to send. +* @param Parameter corresponding to command. +* @wait_ack true if mbox_send_message() should wait for a reply from the M0, +* false if the M0 doesn't reply. This depends on the message being sent. +* @reply_code The response code from the M0 for the command sent (wait_ack was +* set to true). +*/ +struct iproc_mbox_msg { +u32 cmd; +u32 param; +bool wait_ack; +u32 reply_code; +}; + +#endif
Signature · 1 line
1.9.1
PATCH v2 3/3 ARM: dts: Enable Broadcom iProc mailbox controller
In reply to Jonathan Richardson--- arch/arm/boot/dts/bcm-cygnus.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +6 -0
@@ -114,6 +114,12 @@ <0x0301d24c 0x2c>; }; + mailbox: mailbox at 03024024 { + compatible = "brcm,iproc-mailbox"; + reg = <0x03024024 0x8>; + #mbox-cells = <1>; + }; + gpio_crmu: gpio at 03024800 { compatible = "brcm,cygnus-crmu-gpio"; reg = <0x03024800 0x50>,
Signature · 1 line
1.9.1
Rob Herring
maintainerPATCH v2 1/3 dt-bindings: Document Broadcom iProc mailbox controller driver
In reply to Jonathan RichardsonOn Wed, Jan 18, 2017 at 05:39:38PM -0800, Jonathan Richardson wrote:
Changelog?
Quoted 18 lines
Reviewed-by Jonathan Richardson <[email protected]>Tested-by Jonathan Richardson <[email protected]>Reviewed-by Vikram Prakash <[email protected]>Reviewed-by Ray Jui <[email protected]>Reviewed-by Shreesha Rajashekar <[email protected]>Reviewed-by Scott Branden <[email protected]>Signed-off-by Jonathan Richardson <[email protected]>--- .../devicetree/bindings/mailbox/brcm,iproc-mailbox.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txtDocumentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +0
-0
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt line 10
Quoted 10 lines
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +10
-0@@ -0,0 +1,14 @@ +* Broadcom's iProc Mailbox Controller + +Required properties: +- compatible: Must be "brcm,iproc-mailbox" +- reg: Defines the base address of the mailbox controller. +- #mbox-cells: Must be 1. + +Example: + + mailbox: mailbox at 03024024 {
Drop the leading 0.
Quoted 7 lines
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +4
-0+ compatible = "brcm,iproc-mailbox"; + reg = <0x03024024 0x8>; + #mbox-cells = <1>; + };Signature · 1 line
1.9.1
PATCH v2 1/3 dt-bindings: Document Broadcom iProc mailbox controller driver
Quoted 3 lines · Rob Herring
On Wed, Jan 18, 2017 at 05:39:38PM -0800, Jonathan Richardson wrote:
Changelog?
I'll add one.
Quoted 22 lines
Quoted 22 lines
Reviewed-by Jonathan Richardson <[email protected]>Tested-by Jonathan Richardson <[email protected]>Reviewed-by Vikram Prakash <[email protected]>Reviewed-by Ray Jui <[email protected]>Reviewed-by Shreesha Rajashekar <[email protected]>Reviewed-by Scott Branden <[email protected]>Signed-off-by Jonathan Richardson <[email protected]>--- .../devicetree/bindings/mailbox/brcm,iproc-mailbox.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txtDocumentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +3
-0@@ -0,0 +1,14 @@ +* Broadcom's iProc Mailbox Controller + +Required properties:
Quoted 8 lines
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt line 10
Quoted 7 lines
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +7
-0+- compatible: Must be "brcm,iproc-mailbox" +- reg: Defines the base address of the mailbox controller. +- #mbox-cells: Must be 1. + +Example: + + mailbox: mailbox at 03024024 {Drop the leading 0.
I'll change in dtsi also.
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/mailbox/brcm,iproc-mailbox.txt new file +4
-0+ compatible = "brcm,iproc-mailbox"; + reg = <0x03024024 0x8>; + #mbox-cells = <1>; + };Signature · 1 line
1.9.1