Skip to contentSkip to conversation

Dcoumentation: dt: mailbox: Add Xilinx IPI Mailbox

RFC PATCH Superseded Wendy Liang 3 participants 4 messages Sep 21, 2017 – Sep 22, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Dcoumentation: dt: mailbox: Add Xilinx IPI Mailbox

Xilinx ZynqMP IPI(Inter Processor Interrupt) is a hardware block in ZynqMP SoC used for the communication between various processor systems.

---
 .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt   | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt new file +88 -0
new file mode 100644
index 0000000..5d915d1
@@ -0,0 +1,88 @@
+Xilinx IPI Mailbox Driver
+========================================
+
+The Xilinx IPI(Inter Processor Interrupt) mailbox driver is a mailbox
+controller that manages the messaging between two IPI agents. Each IPI
+mailbox has request and response buffers between the two IPI agents.
+
++-------------------------------------+
+|                                     |
+| Xilinx ZynqMP IPI Mailbox Controller|
+|                                     |
+|                       +-------------+
+|                       |     SMC     |
+|                       |             |
++--------+--------------+------+------+
+         |                     |
+         |          +-----------------+
+         |                     |   ATF (ARM trusted firmware)
+         |                     |
++-------------------------------------+
+         |                     |   Hardware
+         |                     |
+ +--------------------------------------+
+                               |        |
+ +----------------------+ +-----------+ |
+ | | Buffers between    | | IPI Agent | |
+ | | two IPI agents     | | Registers | |
+ | +--------------------+ +-----------+ |
+ |                                      |
+ |   Xilinx ZynqMP IPI                  |
+ +--------------------------------------+
+
+
+Message Manager Device Node:
+===========================
+Required properties:
+--------------------
+- compatible:		Shall be: "xlnx,zynqmp-ipi-mailbox"
+- ipi-smc-fid-base	Base offset of SMC function IDs for IPI mailbox SMC.
+			It contains the IPI IDs of the two IPI agents.
+- reg:			IPI request and response buffers address range. It
+			can be the IPI buffers from the hardware or it can
+			be carved out shared memory.
+- reg-names:		Reg resource name of the IPI request and response
+			buffers.
+- #mbox-cells:		Shall be 1. Contains the logical channel IDs of the
+			channels on the IPI mailbox.
+- interrupt-parent:	Phandle for the interrupt controller.
+- interrupts:		Interrupt mapping.
+
+Required properties:
+--------------------
+- method:		The method of accessing the IPI agent registers.
+			Permitted values are: "smc" and "hvc". Default is
+			"smc".
+Example:
+------------
+	/* APU IPI mailbox driver */
+	ipis {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ipi_mailbox_apu_rpu0: ipi_mailbox@0 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990400 40>;
+			reg-names = "apu-rpu0";
+			ipi-smc-fid-base = <0x1010>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};
+		ipi_mailbox_apu_rpu1: ipi_mailbox@1 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990440 40>;
+			reg-names = "apu-rpu1";
+			ipi-smc-fid-base = <0x1020>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};
+	};
+	device0: device0 {
+		...
+		mbox-names = "rpu0", "rpu1",
+		mboxes = <&ipi_mailbox_apu_rpu0 0>,
+			 < &ipi_mailbox_apu_rpu1 0>;
+	};
Signature · 1 line
2.7.4
#1 lore raw
Quoted 118 lines

-----Original Message-----
From: Wendy Liang [mailto:wendy.liang at xilinx.com]
Sent: Thursday, September 21, 2017 3:59 PM
To: linux-kernel at vger.kernel.org
Cc: jassisinghbrar at gmail.com; Cyril Chemparathy <[email protected]>; Michal Simek <[email protected]>; Jiaying Liang <[email protected]>
Subject: [RFC LINUX PATCH] Dcoumentation: dt: mailbox: Add Xilinx IPI Mailbox

Xilinx ZynqMP IPI(Inter Processor Interrupt) is a hardware block in ZynqMP SoC used for the communication between various processor systems.

---
 .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt   | 88
++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt

(quoted diff) +0 -0

mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- mailbox.txt
new file mode 100644
index 0000000..5d915d1

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +89 -1
+++ txt
@@ -0,0 +1,88 @@
+Xilinx IPI Mailbox Driver
+========================================
+
+The Xilinx IPI(Inter Processor Interrupt) mailbox driver is a mailbox
+controller that manages the messaging between two IPI agents. Each IPI
+mailbox has request and response buffers between the two IPI agents.
+
++-------------------------------------+
+|                                     | Xilinx ZynqMP IPI Mailbox
+| Controller|
+|                                     |
+|                       +-------------+
+|                       |     SMC     |
+|                       |             |
++--------+--------------+------+------+
+         |                     |
+         |          +-----------------+
+         |                     |   ATF (ARM trusted firmware)
+         |                     |
++-------------------------------------+
+         |                     |   Hardware
+         |                     |
+ +--------------------------------------+
+                               |        |
+ +----------------------+ +-----------+ |
+ | | Buffers between    | | IPI Agent | |
+ | | two IPI agents     | | Registers | |
+ | +--------------------+ +-----------+ |
+ |                                      |
+ |   Xilinx ZynqMP IPI                  |
+ +--------------------------------------+
+
+
+Message Manager Device Node:
+===========================
+Required properties:
+--------------------
+- compatible:		Shall be: "xlnx,zynqmp-ipi-mailbox"
+- ipi-smc-fid-base	Base offset of SMC function IDs for IPI mailbox SMC.
+			It contains the IPI IDs of the two IPI agents.
+- reg:			IPI request and response buffers address range. It
+			can be the IPI buffers from the hardware or it can
+			be carved out shared memory.
+- reg-names:		Reg resource name of the IPI request and response
+			buffers.
+- #mbox-cells:		Shall be 1. Contains the logical channel IDs of the
+			channels on the IPI mailbox.
+- interrupt-parent:	Phandle for the interrupt controller.
+- interrupts:		Interrupt mapping.
+
+Required properties:
+--------------------
+- method:		The method of accessing the IPI agent registers.
+			Permitted values are: "smc" and "hvc". Default is
+			"smc".
+Example:
+------------
+	/* APU IPI mailbox driver */
+	ipis {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ipi_mailbox_apu_rpu0: ipi_mailbox at 0 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990400 40>;
+			reg-names = "apu-rpu0";
+			ipi-smc-fid-base = <0x1010>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};
+		ipi_mailbox_apu_rpu1: ipi_mailbox at 1 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990440 40>;
+			reg-names = "apu-rpu1";
+			ipi-smc-fid-base = <0x1020>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};
+	};
+	device0: device0 {
+		...
+		mbox-names = "rpu0", "rpu1",
+		mboxes = <&ipi_mailbox_apu_rpu0 0>,
+			 < &ipi_mailbox_apu_rpu1 0>;
+	};
--
Quoted 1 line

2.7.4

cc device tree and linux arm kernel mailing lists.
#2 lore raw
Quoted 28 lines · Jiaying Liang

Xilinx ZynqMP IPI(Inter Processor Interrupt) is a hardware block in ZynqMP SoC used for the communication between various processor systems.

---
 .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt   | 88 ++++++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt

(quoted diff) +0 -0

mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- mailbox.txt
new file mode 100644
index 0000000..5d915d1

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +9 -0
+++ txt
@@ -0,0 +1,88 @@
+Xilinx IPI Mailbox Driver
+========================================
+
+The Xilinx IPI(Inter Processor Interrupt) mailbox driver is a mailbox
+controller that manages the messaging between two IPI agents. Each IPI
+mailbox has request and response buffers between the two IPI agents.
+
++-------------------------------------+

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. line 18

Quoted 10 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +10 -0
+|                                     | Xilinx ZynqMP IPI Mailbox
+| Controller|
+|                                     |
+|                       +-------------+
+|                       |     SMC     |
+|                       |             |
++--------+--------------+------+------+
+         |                     |
+         |          +-----------------+
+         |                     |   ATF (ARM trusted firmware)

I suppose it should work with any EL3 firmware, ATF reference can be removed IMO.

Quoted 12 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +12 -0
+         |                     |
++-------------------------------------+
+         |                     |   Hardware
+         |                     |
+ +--------------------------------------+
+                               |        |
+ +----------------------+ +-----------+ |
+ | | Buffers between    | | IPI Agent | |
+ | | two IPI agents     | | Registers | |
+ | +--------------------+ +-----------+ |
+ |                                      |
+ |   Xilinx ZynqMP IPI                  |

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. line 40

Quoted 10 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +10 -0
+ +--------------------------------------+
+
+
+Message Manager Device Node:
+===========================
+Required properties:
+--------------------
+- compatible:		Shall be: "xlnx,zynqmp-ipi-mailbox"
+- ipi-smc-fid-base	Base offset of SMC function IDs for IPI mailbox SMC.
+			It contains the IPI IDs of the two IPI agents.

Why is "SMC" associated with this hardware block ? Is it secure device ? Can Linux access it ? If so, why do you need SMC ?

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. line 43

Quoted 3 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +3 -0
+- reg:			IPI request and response buffers address range. It
+			can be the IPI buffers from the hardware or it can
+			be carved out shared memory.

It sounds like buffer used for communication and not part of this IP. Shouldn't this be part of mailbox client binding rather than controller binding.

Quoted 28 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +28 -0
+- reg-names:		Reg resource name of the IPI request and response
+			buffers.
+- #mbox-cells:		Shall be 1. Contains the logical channel IDs of the
+			channels on the IPI mailbox.
+- interrupt-parent:	Phandle for the interrupt controller.
+- interrupts:		Interrupt mapping.
+
+Required properties:
+--------------------
+- method:		The method of accessing the IPI agent registers.
+			Permitted values are: "smc" and "hvc". Default is
+			"smc".
+Example:
+------------
+	/* APU IPI mailbox driver */
+	ipis {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ipi_mailbox_apu_rpu0: ipi_mailbox at 0 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990400 40>;
+			reg-names = "apu-rpu0";
+			ipi-smc-fid-base = <0x1010>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. line 81

Quoted 10 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox. new file +10 -0
+		ipi_mailbox_apu_rpu1: ipi_mailbox at 1 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990440 40>;
+			reg-names = "apu-rpu1";
+			ipi-smc-fid-base = <0x1020>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};

Why do you need the above 2 ? They don't look like 2 controller blocks. You just need to represent single mailbox controller.

--
Regards,
Sudeep

#3 lore raw

HI Sudeep,

Quoted 77 lines

-----Original Message-----
From: Sudeep Holla [mailto:sudeep.holla at arm.com]
Sent: Friday, September 22, 2017 4:10 AM
To: Jiaying Liang <[email protected]>
Cc: linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org; devicetree at vger.kernel.org; jassisinghbrar at gmail.com; Cyril Chemparathy <[email protected]>; Michal Simek <[email protected]>;
robh+dt at kernel.org; mark.rutland at arm.com; Soren Brinkmann <[email protected]>; Sudeep Holla <[email protected]>
Subject: Re: [RFC LINUX PATCH] Dcoumentation: dt: mailbox: Add Xilinx IPI Mailbox

Quoted 3 lines · Jiaying Liang

Xilinx ZynqMP IPI(Inter Processor Interrupt) is a hardware block in ZynqMP SoC used for the communication between various processor

systems.

Quoted 4 lines
---
 .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt   | 88

++++++++++++++++++++++

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-

Quoted 13 lines
 1 file changed, 88 insertions(+)
 create mode 100644

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt

diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- mailbox.txt
new file mode 100644
index 0000000..5d915d1

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +0 -0

mailbox.

Quoted 10 lines

+++ txt

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +8 -0
@@ -0,0 +1,88 @@
+Xilinx IPI Mailbox Driver
+========================================
+
+The Xilinx IPI(Inter Processor Interrupt) mailbox driver is a mailbox
+controller that manages the messaging between two IPI agents. Each
+IPI mailbox has request and response buffers between the two IPI agents.
+
++-------------------------------------+

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- line 18

Quoted 10 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +10 -0
+|                                     | Xilinx ZynqMP IPI Mailbox
+| Controller|
+|                                     |
+|                       +-------------+
+|                       |     SMC     |
+|                       |             |
++--------+--------------+------+------+
+         |                     |
+         |          +-----------------+
+         |                     |   ATF (ARM trusted firmware)

I suppose it should work with any EL3 firmware, ATF reference can be removed IMO.

Quoted 17 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +17 -0
+         |                     |
++-------------------------------------+
+         |                     |   Hardware
+         |                     |
+ +--------------------------------------+
+                               |        |
+ +----------------------+ +-----------+ |
+ | | Buffers between    | | IPI Agent | |
+ | | two IPI agents     | | Registers | |
+ | +--------------------+ +-----------+ |
+ |                                      |
+ |   Xilinx ZynqMP IPI                  |
+ +--------------------------------------+
+
+
+Message Manager Device Node:
+===========================
Quoted 8 lines

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- line 40

Quoted 5 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +5 -0
+Required properties:
+--------------------
+- compatible:		Shall be: "xlnx,zynqmp-ipi-mailbox"
+- ipi-smc-fid-base	Base offset of SMC function IDs for IPI mailbox SMC.
+			It contains the IPI IDs of the two IPI agents.

Why is "SMC" associated with this hardware block ? Is it secure device ? Can Linux access it ? If so, why do you need SMC ?

[Wendy] one IPI agent uses its own IPI agent registers to notify (write to register to raise interrupt) Other IPI agents. The IPI agent registers are shared between secure and non-secure. And thus, I think about to access the IPI agent registers in ATF. And thus
Use SMC for registers access.

Quoted 9 lines

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- line 41

Quoted 2 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +1 -0
+- reg:			IPI request and response buffers address

range. It

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- line 43

Quoted 2 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +2 -0
+			can be the IPI buffers from the hardware or it can
+			be carved out shared memory.

It sounds like buffer used for communication and not part of this IP. Shouldn't this be part of mailbox client binding rather than controller binding.

[Wendy] the IPI hardware has IPI buffers (32bytes request buffer and 32bytes response buffer per) But we also want user to be able to use other shared memory.
The reason I am considering to make it part of the mailbox is, we can have logical Channels on top of the physical channels.
Each mailbox controller controls the physical connection(IPI agent registers and buffers), each Mailbox client requests for a logical channel.

Quoted 35 lines

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- line 46

Quoted 4 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +3 -0
+- reg-names:		Reg resource name of the IPI request and response
+			buffers.
+- #mbox-cells:		Shall be 1. Contains the logical channel IDs of

the

Quoted 30 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +30 -0
+			channels on the IPI mailbox.
+- interrupt-parent:	Phandle for the interrupt controller.
+- interrupts:		Interrupt mapping.
+
+Required properties:
+--------------------
+- method:		The method of accessing the IPI agent registers.
+			Permitted values are: "smc" and "hvc". Default is
+			"smc".
+Example:
+------------
+	/* APU IPI mailbox driver */
+	ipis {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		ipi_mailbox_apu_rpu0: ipi_mailbox at 0 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990400 40>;
+			reg-names = "apu-rpu0";
+			ipi-smc-fid-base = <0x1010>;
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};
+		ipi_mailbox_apu_rpu1: ipi_mailbox at 1 {
+			compatible = "xlnx,zynqmp-ipi-mailbox";
+			reg = <0 0xff990440 40>;
+			reg-names = "apu-rpu1";
+			ipi-smc-fid-base = <0x1020>;
Quoted 8 lines

Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- line 81

Quoted 5 lines
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi- new file +5 -0
+			method = "smc";
+			#mbox-cells = <1>;
+			interrupt-parent = <&gic>;
+			interrupts = <0 35 4>;
+		};

Why do you need the above 2 ? They don't look like 2 controller blocks. You just need to represent single mailbox controller.

[Wendy] I just wanted to have single mailbox controller to control one Physical connection and allows logical channels on top of it. Is there any framework to support logical channels on top of mailbox? Or we need to write the mailbox client driver to support logical channels on top of one mailbox client?

Thanks,
Wendy

Quoted 4 lines

--
Regards,
Sudeep