Skip to contentSkip to conversation

Add Mailbox support for TI K3 SoCs

PATCH In review Suman Anna 3 participants 6 messages Jun 4, 2019 – Jul 8, 2019

Subsystems (2)
lore
Share & tools
lore

Suman Anna

author
#0 lore raw

cover Add Mailbox support for TI K3 SoCs

Hi Jassi,

The following series adds the support for the Mailbox IP present within the Main NavSS module on the newer TI K3 AM65x and J721E SoCs.

The Mailbox IP is similar to the previous generation IP on OMAP SoCs with a few differences:
- Multiple IP instances from previous DRA7/AM57 family each form a cluster and are part of the same IP. The driver support will continue to be based on a cluster.
- The IP is present within a Main NaVSS, and interrupts have to go through an Interrupt Router within Main NavSS before they reach the respective processor sub-system's interrupt controllers.
- The register layout is mostly same, with difference in two registers

Support is added by enhancing the existing OMAP Mailbox driver to support the K3 IP using a new compatible. The driver also has to be adjusted to deal with the 32-bit mailbox payloads vs the 64-bit pointers used by the Mailbox API on these Arm v8 platforms.

DT nodes will be posted separately once the binding is acked.

regards
Suman

Suman Anna (2):
dt-bindings: mailbox: omap: Update bindings for TI K3 SoCs mailbox/omap: Add support for TI K3 SoCs

 .../bindings/mailbox/omap-mailbox.txt         | 59 ++++++++++++++++---
 drivers/mailbox/Kconfig                       |  2 +-
 drivers/mailbox/omap-mailbox.c                | 43 ++++++++------
 include/linux/omap-mailbox.h                  |  4 +-
 4 files changed, 80 insertions(+), 28 deletions(-)
Signature · 1 line
2.21.0
author
#1 lore raw

PATCH 1/2 dt-bindings: mailbox: omap: Update bindings for TI K3 SoCs

The TI K3 AM65x and J721E family of SoCs have a new Mailbox IP that is based on the existing Mailbox IP present in OMAP architecture based SoCs. Update the existing OMAP Mailbox bindings for this new IP present on TI K3 AM65x and J721E SoCs. The same compatible from AM65x SoCs is reused for J721E SoCs.

---
 .../bindings/mailbox/omap-mailbox.txt         | 59 ++++++++++++++++---
 1 file changed, 50 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/mailbox/omap-mailbox.txt +50 -9
index 0ef372656a3e..35c3f56b7f7b 100644
@@ -1,4 +1,4 @@
-OMAP2+ Mailbox Driver
+OMAP2+ and K3 Mailbox
 =====================
 
 The OMAP mailbox hardware facilitates communication between different processors
@@ -7,7 +7,7 @@ various processor subsystems and is connected on an interconnect bus. The
 communication is achieved through a set of registers for message storage and
 interrupt configuration registers.
 
-Each mailbox IP block has a certain number of h/w fifo queues and output
+Each mailbox IP block/cluster has a certain number of h/w fifo queues and output
 interrupt lines. An output interrupt line is routed to an interrupt controller
 within a processor subsystem, and there can be more than one line going to a
 specific processor's interrupt controller. The interrupt line connections are
@@ -23,12 +23,16 @@ All the current OMAP SoCs except for the newest DRA7xx SoC has a single IP
 instance. DRA7xx has multiple instances with different number of h/w fifo queues
 and interrupt lines between different instances. The interrupt lines can also be
 routed to different processor sub-systems on DRA7xx as they are routed through
-the Crossbar, a kind of interrupt router/multiplexer.
+the Crossbar, a kind of interrupt router/multiplexer. The K3 AM65x and J721E
+SoCs has each of these instances form a cluster and combine multiple clusters
+into a single IP block present within the Main NavSS. The interrupt lines from
+all these clusters are multiplexed and routed to different processor subsystems
+over a limited number of common interrupt output lines of an Interrupt Router.
 
 Mailbox Device Node:
 ====================
-A Mailbox device node is used to represent a Mailbox IP instance within a SoC.
-The sub-mailboxes are represented as child nodes of this parent node.
+A Mailbox device node is used to represent a Mailbox IP instance/cluster within
+a SoC. The sub-mailboxes are represented as child nodes of this parent node.
 
 Required properties:
 --------------------
@@ -37,12 +41,12 @@ Required properties:
 			    "ti,omap3-mailbox" for OMAP3430, OMAP3630 SoCs
 			    "ti,omap4-mailbox" for OMAP44xx, OMAP54xx, AM33xx,
 						   AM43xx and DRA7xx SoCs
+			    "ti,am654-mailbox" for K3 AM65x and J721E SoCs
 - reg:			Contains the mailbox register address range (base
 			address and length)
 - interrupts:		Contains the interrupt information for the mailbox
 			device. The format is dependent on which interrupt
-			controller the OMAP device uses
-- ti,hwmods:		Name of the hwmod associated with the mailbox
+			controller the Mailbox device uses
 - #mbox-cells:		Common mailbox binding property to identify the number
 			of cells required for the mailbox specifier. Should be
 			1
@@ -50,6 +54,23 @@ Required properties:
 			device can interrupt
 - ti,mbox-num-fifos:	Number of h/w fifo queues within the mailbox IP block
 
+SoC-specific Required properties:
+---------------------------------
+The following are mandatory properties for the OMAP architecture based SoCs
+only:
+- ti,hwmods:		Name of the hwmod associated with the mailbox. This
+			should be defined in the mailbox node only if the node
+			is not defined as a child node of a corresponding sysc
+			interconnect node.
+
+The following are mandatory properties for the K3 AM65x and J721E SoCs only:
+- interrupt-parent:	Should contain a phandle to the TI-SCI interrupt
+			controller node that is used to dynamically program
+			the interrupt routes between the IP and the main GIC
+			controllers. See the following binding for additional
+			details,
+			Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt
+
 Child Nodes:
 ============
 A child node is used for representing the actual sub-mailbox device that is
@@ -98,7 +119,7 @@ to be used by the client user.
 Example:
 --------
 
-/* OMAP4 */
+1. /* OMAP4 */
 mailbox: mailbox@4a0f4000 {
 	compatible = "ti,omap4-mailbox";
 	reg = <0x4a0f4000 0x200>;
@@ -123,7 +144,7 @@ dsp {
 	...
 };
 
-/* AM33xx */
+2. /* AM33xx */
 mailbox: mailbox@480c8000 {
 	compatible = "ti,omap4-mailbox";
 	reg = <0x480C8000 0x200>;
@@ -137,3 +158,23 @@ mailbox: mailbox@480c8000 {
 		ti,mbox-rx = <0 0 3>;
 	};
 };
+
+3. /* AM65x */
+&cbass_main {
+	cbass_main_navss: interconnect0 {
+		mailbox0_cluster0: mailbox@31f80000 {
+			compatible = "ti,am654-mailbox";
+			reg = <0x00 0x31f80000 0x00 0x200>;
+			#mbox-cells = <1>;
+			ti,mbox-num-users = <4>;
+			ti,mbox-num-fifos = <16>;
+			interrupt-parent = <&intr_main_navss>;
+			interrupts = <164 0>;
+
+			mbox_mcu_r5fss0_core0: mbox-mcu-r5fss0-core0 {
+				ti,mbox-tx = <1 0 0>;
+				ti,mbox-rx = <0 0 0>;
+			};
+		};
+	};
+};
Signature · 1 line
2.21.0
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: mailbox: omap: Update bindings for TI K3 SoCs

Quoted 11 lines · Suman Anna

The TI K3 AM65x and J721E family of SoCs have a new Mailbox IP that is based on the existing Mailbox IP present in OMAP architecture based SoCs. Update the existing OMAP Mailbox bindings for this new IP present on TI K3 AM65x and J721E SoCs. The same compatible from AM65x SoCs is reused for J721E SoCs.

---
 .../bindings/mailbox/omap-mailbox.txt         | 59 ++++++++++++++++---
 1 file changed, 50 insertions(+), 9 deletions(-)
author
#3 lore raw

PATCH 2/2 mailbox/omap: Add support for TI K3 SoCs

In reply to Suman Anna

The TI K3 AM65x and J721E family of SoCs have a new Mailbox IP that is based on the existing Mailbox IP present in OMAP architecture based SoCs. Each instance of the legacy OMAP Mailbox IP is now a single cluster within the newer Mailbox IP instance on K3 architecture based SoCs. A single K3 Mailbox IP instance has multiple clusters with each cluster providing the same functionality as the existing OMAP Mailbox IP.

Reuse the existing OMAP Mailbox driver to extend the support for this newer IP present within the Main NavSS block on K3 SoCs. The K3 family of SoCs use 64-bit ARMv8 processors for running Linux, so the driver is also enhanced to deal with the differences between the 32-bit message payloads and the 64-bit pointers used by the client drivers.

---
 drivers/mailbox/Kconfig        |  2 +-
 drivers/mailbox/omap-mailbox.c | 43 ++++++++++++++++++++--------------
 include/linux/omap-mailbox.h   |  4 +++-
 3 files changed, 30 insertions(+), 19 deletions(-)
drivers/mailbox/Kconfig +1 -1
index 595542bfae85..5f48f371a7d0 100644
@@ -53,7 +53,7 @@ config ARMADA_37XX_RWTM_MBOX
 
 config OMAP2PLUS_MBOX
 	tristate "OMAP2+ Mailbox framework support"
-	depends on ARCH_OMAP2PLUS
+	depends on ARCH_OMAP2PLUS || ARCH_K3
 	help
 	  Mailbox implementation for OMAP family chips with hardware for
 	  interprocessor communication involving DSP, IVA1.0 and IVA2 in
drivers/mailbox/omap-mailbox.c +26 -17

129 lines not on this page · raw message

include/linux/omap-mailbox.h +3 -1
index 6dbcd2da0332..8aa984ec1f38 100644
@@ -6,7 +6,9 @@
 #ifndef OMAP_MAILBOX_H
 #define OMAP_MAILBOX_H
 
-typedef u32 mbox_msg_t;
+typedef uintptr_t mbox_msg_t;
+
+#define omap_mbox_message(data) (u32)(mbox_msg_t)(data)
 
 typedef int __bitwise omap_mbox_irq_t;
 #define IRQ_TX ((__force omap_mbox_irq_t) 1)
Signature · 1 line
2.21.0
author
#4 lore raw
In reply to Suman Anna

Hi Jassi,

Quoted 15 lines · Suman Anna

Hi Jassi,

The following series adds the support for the Mailbox IP present within the Main NavSS module on the newer TI K3 AM65x and J721E SoCs.

The Mailbox IP is similar to the previous generation IP on OMAP SoCs with a few differences:
- Multiple IP instances from previous DRA7/AM57 family each form a cluster and are part of the same IP. The driver support will continue to be based on a cluster.
- The IP is present within a Main NaVSS, and interrupts have to go through an Interrupt Router within Main NavSS before they reach the respective processor sub-system's interrupt controllers.
- The register layout is mostly same, with difference in two registers

Quoted 6 lines

Support is added by enhancing the existing OMAP Mailbox driver to support the K3 IP using a new compatible. The driver also has to be adjusted to deal with the 32-bit mailbox payloads vs the 64-bit pointers used by the Mailbox API on these Arm v8 platforms.

DT nodes will be posted separately once the binding is acked.

Can you please pick this series up for 5.3 merge window if you do not have any comments.

Thanks,
Suman

Quoted 11 lines

Suman Anna (2):
dt-bindings: mailbox: omap: Update bindings for TI K3 SoCs mailbox/omap: Add support for TI K3 SoCs

 .../bindings/mailbox/omap-mailbox.txt         | 59 ++++++++++++++++---
 drivers/mailbox/Kconfig                       |  2 +-
 drivers/mailbox/omap-mailbox.c                | 43 ++++++++------
 include/linux/omap-mailbox.h                  |  4 +-
 4 files changed, 80 insertions(+), 28 deletions(-)
maintainer
#5 lore raw
Quoted 24 lines · Suman Anna

Hi Jassi,

Quoted 20 lines · Suman Anna

Hi Jassi,

The following series adds the support for the Mailbox IP present within the Main NavSS module on the newer TI K3 AM65x and J721E SoCs.

The Mailbox IP is similar to the previous generation IP on OMAP SoCs with a few differences:
- Multiple IP instances from previous DRA7/AM57 family each form a cluster and are part of the same IP. The driver support will continue to be based on a cluster.
- The IP is present within a Main NaVSS, and interrupts have to go through an Interrupt Router within Main NavSS before they reach the respective processor sub-system's interrupt controllers.
- The register layout is mostly same, with difference in two registers

Support is added by enhancing the existing OMAP Mailbox driver to support the K3 IP using a new compatible. The driver also has to be adjusted to deal with the 32-bit mailbox payloads vs the 64-bit pointers used by the Mailbox API on these Arm v8 platforms.

Quoted 5 lines
Quoted 1 line

DT nodes will be posted separately once the binding is acked.

Can you please pick this series up for 5.3 merge window if you do not have any comments.

I will. Usually I leave the code to cook in the open for as long as possible, more so when no acks are coming.
Cheers!